openvmm: add minimal tag-derived source identity - #3989
Draft
benhillis wants to merge 17 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the support/build_rs_git_info build-script helper from emitting just SHA/branch to collecting a more complete repository-scoped source identity (revision, branch, exact tags, dirty state, shallow state), with additional repository-root validation and focused tests.
Changes:
- Introduces a
GitInfostruct pluscollect_git_info()/collect_git_info_at()APIs to return structured Git identity data. - Expands Cargo rebuild triggers beyond
HEADto include tag refs / packed refs and the current branch ref. - Adds unit tests covering exact tags + dirty state detection and rejection of nested directories inside a parent repository.
This was referenced Jul 21, 2026
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
benhillis
commented
Jul 21, 2026
added 17 commits
July 29, 2026 13:07
Extend the build-script helper to collect exact tags, dirty and shallow state, and repository-scoped Git information. Reject parent repositories so vendored source cannot inherit the containing checkout's identity. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Read status output as raw bytes so non-UTF8 paths cannot panic the build script, and watch the shallow marker so unshallowing invalidates cached build metadata. Clarify that the compatibility emit API intentionally exposes only its legacy variables. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Retry unique temporary repository names so parallel tests and coarse filesystem clocks cannot fail with AlreadyExists. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Fold OpenVMM identity into one product-specific crate and restore the generic Git helper to its upstream API. Keep only canonical exact tags, dirty state, Git revision fallback, official release metadata, and repository-root protection; remove branch, shallow-checkout, arbitrary-tag, and generated development-source metadata plumbing. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Watch individual OpenVMM tag refs, derive the tag glob from the canonical prefix, and document why product-specific Git collection remains local to the identity crate. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Link the minimal build-info crate into openvmm and use it for --version/-V so the first release-identity layer produces an observable artifact without pulling in Windows resources, Flowey, or test-snapshot wiring. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Compare raw arguments through OsStr and document the displayed version flags. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Recognize version flags anywhere in the command line and document dirty and metadata-free version forms. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Document that development version output uses the first nine revision characters. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Watch every tracked repository file so Cargo reruns the identity build script when workspace edits can change the dirty marker. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Stop global version-flag detection at -- and cover the behavior with a regression assertion. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Keep tracked-file invalidation for local builds while avoiding thousands of unnecessary rerun directives in GitHub Actions. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Exercise Git identity collection with the annotated tag form used for releases. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Lock in the intentional failure for noncanonical tags using the reserved openvmm-v prefix. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Ignore untracked files so dirty identity remains consistent with Cargo rebuild triggers and document the tracked-file semantics. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Configure the existing Clap options with the source identity and remove the binary-level argument pre-parser. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
Rerun the build-info script when the Git index changes so newly tracked files cannot leave the cached dirty identity stale. Copilot-Session: 13086ab2-fa94-4be1-b276-ee1b96e7caea
benhillis
force-pushed
the
user/benhill/openvmm-git-build-info
branch
from
July 29, 2026 20:15
79d3118 to
9aef473
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
openvmm/openvmm_build_info/build.rs:96
- The
git for-each-refpatternrefs/tags/openvmm-vonly matches a ref named exactlyopenvmm-v, so the build script won’t registerrerun-if-changedinputs for real release tags likeopenvmm-v0.12.3. This can leaveOPENVMM_VERSIONstale when tags are created/updated locally (directory watch + packed-refs aren’t reliable across setups). Use a glob that matches allopenvmm-v*tag refs.
if let Some(tag_refs) = git_output(
repo,
&["for-each-ref", "--format=%(refname)", "refs/tags/openvmm-v"],
) {
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
Add the minimal source identity needed for standalone OpenVMM releases and expose it through the existing
openvmm_entryClap parser foropenvmm --version/-V.MAJOR.MINOR.PATCHfrom one canonical exactopenvmm-vMAJOR.MINOR.PATCHtag.openvmm-release.jsonwhen.gitis absent0.0.0-devwhen neither Git nor release metadata is availableThis intentionally does not collect branch names, shallow-checkout state, arbitrary tags, or generated development-source metadata.
Draft follow-up stack: benhillis#5, #6, and #7. Documentation: #3988.
Stack boundary: Windows executable resource wiring is implemented in benhillis#5. Official source-bundle publication is implemented in #7 and depends on #5, so release bundles cannot publish before matching Windows resource identity lands.