[release] Allow build version to be injected at compile time - #48436
Merged
Merged
Conversation
clintjedwards
force-pushed
the
cje/build_version_envvar
branch
from
September 17, 2026 02:09
a1916aa to
2e7d1d6
Compare
This adds a new build envvar that will overwrite the default `CARGO_PKG_VERSION` and removes some of the logic we were using to generate unique build versions for dev versions. In short: * We introduce a new `PUSHPIN_BUILD_VERSION` environment variable (prefixed to not collide with CI env vars) that we use whenever we want to overwrite the build version listed in `cargo.toml`. * Building the normal way (`cargo build --release`) without any extra envvars still uses the version in `cargo.toml` as the version. * This allows us some flexibility when building final assets as to what the version string actually gets set as. Very useful when hotfixing, for downstream forks, or just generally doing things that need the version string to change but don't want `cargo.toml` to be updated. (Things like appending the date to the build version and such) * This PR also cleans up the `-dev` logic for appending dates since we're moving away from explicitly tagging out of band release builds with a `-dev` suffix.
clintjedwards
force-pushed
the
cje/build_version_envvar
branch
from
September 17, 2026 02:55
2e7d1d6 to
2a200d8
Compare
deg4uss3r
approved these changes
Sep 17, 2026
jkarneges
approved these changes
Sep 17, 2026
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.
This adds a new build envvar that will overwrite the default
CARGO_PKG_VERSIONand removes some of the logic we were using to generate unique build versions for dev versions.In short:
PUSHPIN_BUILD_VERSIONenvironment variable (prefixed to not collide with CI env vars) that we use whenever we want to overwrite the build version listed incargo.toml.cargo build --release) without any extra envvars still uses the version incargo.tomlas the version.cargo.tomlto be updated. (Things like appending the date to the build version and such)-devlogic for appending dates since we're moving away from explicitly tagging out of band release builds with a-devsuffix.-devor-rcor whatever (Or vice-versa).