fix(release): read binary [package] version, not workspace 0.x version#395
Merged
Conversation
The workspace split added a [workspace.package] version = "0.2.0" line that sorts ahead of the binary's [package] version in Cargo.toml. Release tooling that did `grep '^version' | head -1` then read 0.2.0 instead of the binary version, which would: - make pre-release-check.sh fail version consistency with a false mismatch - build the Ubuntu PPA package as 0.2.0, and (worse) git-archive the ancient v0.2.0 tag as the release source - mis-derive the OBS fallback version on non-tag runs Anchor all three on the [package] section via awk. Also fix the pre-release-check Dockerfile asset scan: the baked-in oui.gz/services assets moved to crates/rustnet-core/, so the src/-only include_bytes\! scan silently checked nothing; scan crates/ too and cover include_str\!. Update RELEASE.md for the two version tracks and the four-crate crates.io publish order.
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.
Why
The workspace split (#367) added a
[workspace.package] version = "0.2.0"line toCargo.tomlthat sorts ahead of the binary's[package] version(currently1.3.0). Several release tools derive the version withgrep '^version' Cargo.toml | head -1, which now reads0.2.0(the library version) instead of the binary version.Left unfixed, the next release would have:
pre-release-check.shfail version-consistency with a false0.2.0 != x.y.zmismatch, blocking the pre-release gate.ppa-release.ymlbuild the Ubuntu PPA package as0.2.0, and — worse —git archivethe ancientv0.2.0tag (2024 source) as the release source (BASE_VERSION→RELEASE_TAG="v0.2.0").obs-release.ymlmis-derive the version on the non-tag fallback path.release.ymlis unaffected (it already usestoml get Cargo.toml package.version).What
[package]section:awk -F'"' '/^\[package\]/{p=1} p && /^version = /{print $2; exit}' Cargo.tomlApplied in
pre-release-check.sh,ppa-release.yml(both reads), and theobs-release.ymlfallback.pre-release-check.shDockerfile asset scan: the baked-inoui.gz/servicesassets moved tocrates/rustnet-core/, so thesrc/-onlyinclude_bytes!scan silently validated nothing. Now scanscrates/too and coversinclude_str!(theservicesasset). The Dockerfile itself was already correct.RELEASE.md: document the two version tracks (binary1.xvs library0.x) and the four-crate crates.io publish order.Verification
./scripts/pre-release-check.sh 1.3.0against currentmainnow reports the correctCargo.toml version: 1.3.0and validates bothcrates/rustnet-core/assets/{oui.gz,services}against the Dockerfile.cargo test --workspacepasses.