Skip to content

Unify reported snarkOS versions through .cargo/release-version#4287

Draft
Copilot wants to merge 2 commits into
stagingfrom
copilot/bugfix-registered-versions
Draft

Unify reported snarkOS versions through .cargo/release-version#4287
Copilot wants to merge 2 commits into
stagingfrom
copilot/bugfix-registered-versions

Conversation

Copilot AI commented May 29, 2026

Copy link
Copy Markdown
Contributor

Reported versions were coming from multiple crate-local sources (CARGO_PKG_VERSION / PKG_VERSION), which required updating the same release number in several places. This change makes the user-facing/runtime-reported version come from a single root source: .cargo/release-version.

  • Centralize the reported version

    • Added shared build-script logic to read .cargo/release-version
    • Normalizes the stored tag (v4.6.04.6.0)
    • Exposes the result uniformly as SNARKOS_VERSION
  • Switch version consumers to the shared source

    • Updated the CLI updater to use SNARKOS_VERSION instead of crate-local CARGO_PKG_VERSION
    • Updated REST and metrics version reporting to stop reading built_info::PKG_VERSION
    • Updated the CDN user agent to use the shared version value
  • Align CLI version output

    • snarkos --version now includes the unified release version alongside git branch/commit and enabled features
  • Add a focused guardrail

    • Added a unit test in the CLI crate that asserts SNARKOS_VERSION matches .cargo/release-version
.current_version(env!("SNARKOS_VERSION"))

This keeps reported versions tied to one root file without changing the existing package/dependency version structure used by the workspace.

Copilot AI linked an issue May 29, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix multiple registrations of package versions Unify reported snarkOS versions through .cargo/release-version May 29, 2026
Copilot AI requested a review from vicsn May 29, 2026 09:50
Copilot finished work on behalf of vicsn May 29, 2026 09:50
Comment thread node/rest/build.rs

fn main() {
version_env::emit_version_env();
built::write_built_file().expect("Failed to acquire build-time information");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot do we still need this or can we throw it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We still need built::write_built_file() here. node/rest/src/version.rs still reads the generated built_info::GIT_COMMIT_HASH and built_info::GIT_HEAD_REF, so dropping it would break that module.

Comment thread node/metrics/build.rs

fn main() {
version_env::emit_version_env();
built::write_built_file().expect("Failed to acquire build-time information");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot do we still need this or can we throw it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We still need built::write_built_file() here. node/metrics/src/lib.rs still uses the generated built_info::GIT_COMMIT_HASH, built_info::GIT_HEAD_REF, and built_info::FEATURES_LOWERCASE_STR, so this build step can't be removed yet.

Copilot finished work on behalf of vicsn June 4, 2026 14:50
Copilot AI requested a review from vicsn June 4, 2026 14:50
@vicsn vicsn requested a review from ljedrz June 9, 2026 17:03
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.

[Bug] version is registered multiple times

2 participants