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

version binfmt wire format #103

Merged
merged 4 commits into from
Aug 13, 2020
Merged

version binfmt wire format #103

merged 4 commits into from
Aug 13, 2020

Conversation

japaric
Copy link
Member

@japaric japaric commented Aug 11, 2020

binfmt.x contains the target side version; this version will be stored in the
ELF
binfmt_decoder will check that the version stored in the ELF matches the
version it supports (BINFMT_VERSION const in binfmt_decoder crate)

TODO

  • change VERSION from "1" to git rev-parse --short HEAD (32-bit hash of) to catch mismatch between cargo install --git tools and binfmt used as a git dependency

(meant to open this as a draft PR but I can't?)

binfmt.x contains the target side version; this version will be stored in the
ELF
`binfmt_decoder` will check that the version stored in the ELF matches the
version it supports (`BINFMT_VERSION` const in `binfmt_decoder` crate)
@japaric japaric added this to the 0.1.0-alpha milestone Aug 11, 2020
@japaric japaric changed the title [WIP] version binfmt wire format version binfmt wire format Aug 13, 2020
let mut hasher = DefaultHasher::new();
let output = Command::new("git")
.args(&["rev-parse", "HEAD"])
.output()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

So this won't work with the crates.io version, we'd need some kind of fallback when the git command fails that will use the package version instead (same in decoder/build.rs). Feel free to merge without that though, and maybe open an issue to keep track of this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, for crates.io releases we should use e.g. hash32of("0.1.0-alpha.1"), instead of the git commit hash, and update those version strings for as long as we intend to make breaking changes (until 1.0). That should be part of the release process; is that canonically documented somewhere? e.g. /RELEASE.md

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it needs to be manual, Cargo sets CARGO_PKG_VERSION to the version string when running the build script. We just need to make sure the versions match.

@japaric japaric merged commit 07a5a8b into main Aug 13, 2020
@jonas-schievink jonas-schievink deleted the version branch August 13, 2020 11:02
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.

2 participants