fix: dev version format leaking to release builds#282
Merged
Conversation
build.rs checked for DAFT_BUILD_RELEASE env var to distinguish dev from release builds, but this env var was never set anywhere — not in CI, not in the build task. All builds got the dev format, including cargo-dist release builds (e.g., "daft 1.0.34 (dev HEAD a5d0d1b)"). Replace the env var check with automatic git tag detection: if HEAD has a tag matching the Cargo.toml version, treat it as a release build and output the clean version string. Keep DAFT_BUILD_RELEASE as a manual override fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds `mise run test:version-format` which asserts that: 1. Dev builds show branch + commit hash (dev format) 2. Release builds show clean version (simulates cargo-dist conditions: detached HEAD with a version tag pointing at HEAD) 3. DAFT_BUILD_RELEASE env var override produces clean version Co-Authored-By: Claude Opus 4.6 <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.
Summary
daft 1.0.34 (dev HEAD a5d0d1b)) instead of cleandaft 1.0.34build.rsgated onDAFT_BUILD_RELEASEenv var which was never set anywhere (not in CI, not in build tasks)DAFT_BUILD_RELEASEas a manual overrideTest plan
mise run fmt-- passesmise run clippy-- passesmise run test:unit-- passesdaft 1.0.34 (dev fix/... b95fa97)daft 1.0.34DAFT_BUILD_RELEASE=1override still works🤖 Generated with Claude Code