Skip to content

deps: Replace vergen with a new support crate#2905

Open
smalis-msft wants to merge 4 commits intomicrosoft:mainfrom
smalis-msft:novergen
Open

deps: Replace vergen with a new support crate#2905
smalis-msft wants to merge 4 commits intomicrosoft:mainfrom
smalis-msft:novergen

Conversation

@smalis-msft
Copy link
Contributor

The vergen crate, and especially its new version 9, pulls in a lot of dependencies for the relatively small pieces of it we use. Replace it with a new home-grown crate that has no dependencies beyond anyhow and just does what we need.

@smalis-msft smalis-msft requested a review from a team as a code owner March 6, 2026 21:38
Copilot AI review requested due to automatic review settings March 6, 2026 21:38
@smalis-msft smalis-msft requested a review from a team as a code owner March 6, 2026 21:38
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

@github-actions github-actions bot added the unsafe Related to unsafe code label Mar 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the vergen dependency and replaces it with a small in-repo build-script helper crate that emits git SHA/branch information via cargo:rustc-env, reducing transitive dependency footprint while preserving build metadata.

Changes:

  • Add new support/build_rs_git_info crate to emit BUILD_GIT_SHA / BUILD_GIT_BRANCH using the git CLI.
  • Update OpenHCL crates’ build.rs and runtime code to use the new env var names instead of VERGEN_*.
  • Remove vergen from workspace dependencies and lockfile.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
support/build_rs_git_info/src/lib.rs New helper implementation for invoking git and emitting build env vars.
support/build_rs_git_info/Cargo.toml Defines the new support crate and its minimal dependencies.
openhcl/underhill_init/src/lib.rs Switch runtime logging to BUILD_GIT_SHA / BUILD_GIT_BRANCH.
openhcl/underhill_init/build.rs Use build_rs_git_info instead of vergen.
openhcl/underhill_init/Cargo.toml Replace vergen build-dependency with build_rs_git_info.
openhcl/underhill_crash/src/lib.rs Switch crash metadata to BUILD_GIT_SHA.
openhcl/underhill_crash/build.rs Use build_rs_git_info instead of vergen.
openhcl/underhill_crash/Cargo.toml Replace vergen build-dependency with build_rs_git_info.
openhcl/build_info/src/lib.rs Switch BuildInfo fields to read BUILD_GIT_SHA / BUILD_GIT_BRANCH.
openhcl/build_info/build.rs Use build_rs_git_info instead of vergen.
openhcl/build_info/Cargo.toml Replace vergen build-dependency with build_rs_git_info.
Cargo.toml Add build_rs_git_info workspace dep; remove vergen version.
Cargo.lock Lockfile updates reflecting dependency removal/addition.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.


You can also share your feedback on Copilot code review. Take the survey.

@smalis-msft smalis-msft enabled auto-merge (squash) March 9, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants