Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fallback if git_version fails #355

Merged
merged 1 commit into from
Oct 17, 2023
Merged

Conversation

jprendes
Copy link
Collaborator

Fix #341

@jsturtevant
Copy link
Contributor

This is probably fine as a work around. Is there any reason to ship the source code with a simple file that includes the git commit?

@jprendes
Copy link
Collaborator Author

When a release is created GH creates a tar file with the source. IIUC that happens automatically.
Are you suggesting we hardcode the commit id in there?

@jsturtevant
Copy link
Contributor

I was thinking something similar to https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#_exporting_your_repository

@jprendes
Copy link
Collaborator Author

Hm, I was thinking of something on the line of include_str("../LAST_COMMIT"). However, that means that a missing LAST_COMMIT file would result in a compile error. This would work fine for runwasi itself but would break dependant projects without a LAST_COMMIT file. It would be simpler if there was a option_include_str macro!

Also that approach would not reflect any local modifications that could have been done, so it could be missleading if used for debugging. We could append a .a to indicate the id comes from an archive and can't be 100% trusted, in a similar fashion to what we do now appending .m to indicate a dirty repo.

I personally prefer a <none> or <unknown> tag as is the case now.

@jsturtevant
Copy link
Contributor

I personally prefer a or tag as is the case now.

This make sense to me based on your feedback above

Copy link
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@devigned devigned left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@devigned devigned merged commit 5982176 into containerd:main Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with Git-Dependent Functions in Release Tarball
4 participants