Repository navigation
fix(release): make the version stamp work on macOS and RPM - #85
Merged
Merged
Conversation
The stamp shipped in #83 broke two of the seven build jobs. macOS — `sed: 1: "Cargo.toml`. Two separate GNU-isms, only one of which was obvious: BSD sed reads the argument after -i as a backup suffix, and the `0,/re/` address range used to match only the first occurrence is a GNU extension BSD rejects outright. Fixing the first alone would still have failed. Uses awk instead, which behaves the same on both. RPM — `invalid version "0.1.0-rc.10": contains invalid character (allowed: alphanumeric, '.', '_', '+', '%', '{', '}', '~', '^')`. RPM forbids '-' in a version, but cargo requires semver. The tool's own error names the way out: '+' is legal in RPM, and semver allows it as build metadata. So the pre-release marker becomes +rc.N rather than -rc.N, which cargo, dpkg and rpm all accept. '~' would sort better for rpm and deb, but cargo rejects it. This is the same failure I made earlier today with BSD grep in non_utf8_argv_test: verified against GNU tooling on Windows, shipped to a macOS runner. Checked explicitly for it this time — the awk rewrite was prompted by noticing the 0,/re/ range would fail on BSD even after the -i fix. Verified: - all five tag forms derive correctly - cargo metadata reports 0.1.0+rc.10 - 0.1.0+rc.10 contains only characters rpm's error message lists as legal - the stamp rewrites line 3 only; clap/serde/serde_json versions intact - the stable path yields a bare 0.1.0 - a malformed tag is rejected rather than corrupting the manifest Still unverified locally: the .deb/.rpm filenames, which need cargo-deb and cargo-generate-rpm on Linux, and BSD sed/awk behaviour itself. The next RC's published assets and the macOS job are the checks. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The version stamp from #83 broke two of the seven build jobs. Both failures are mine and neither was visible without running it.
macOS: two GNU-isms, not one
BSD sed reads the argument after
-ias a backup suffix, so the GNU form consumes the script. But fixing that alone would still have failed:0,/re/— the address range used to match only the firstversion =— is also a GNU extension that BSD sed rejects. Usesawkinstead, which behaves identically on both.This is the same mistake as the BSD grep failure in
non_utf8_argv_testearlier today: verified against GNU tooling on Windows, shipped to a macOS runner.RPM: cargo and rpm disagree about
-RPM forbids
-in a version; cargo requires semver. The error message names the escape —+is legal in RPM, and semver permits it as build metadata. So the pre-release marker becomes+rc.N:0.1.0-rc.100.1.0+rc.10~would sort better for both rpm and deb (it orders before the release), but cargo rejects it outright.Verified
Still unverified
The
.deb/.rpmfilenames, and BSDawkitself — both need the real runners. The macOS job and the next RC's published assets are the checks worth watching after merge.