Skip to content

fix(core): exclude vm-dev tag from git describe version glob#843

Open
mjamiv wants to merge 1 commit intoNVIDIA:mainfrom
mjamiv:fix/version-string-excludes-vm-dev
Open

fix(core): exclude vm-dev tag from git describe version glob#843
mjamiv wants to merge 1 commit intoNVIDIA:mainfrom
mjamiv:fix/version-string-excludes-vm-dev

Conversation

@mjamiv
Copy link
Copy Markdown

@mjamiv mjamiv commented Apr 15, 2026

Summary

Exclude the vm-dev development tag from the git describe glob that derives the build-time version string. Currently --match "v*" catches it, producing a binary that reports itself as m-dev. Fixed by requiring a numeric segment after v.

Related Issue

Closes #832

Changes

  • crates/openshell-core/build.rs::git_version: change --match "v*" to --match "v[0-9]*". Leaves a short comment explaining why (the vm-dev collision) so the next reader doesn't think the glob is over-restrictive.

Root Cause

git describe --tags --long --match "v*" matches every tag that starts with v, including vm-dev and vm-prod. On current main, vm-dev sits on or past the latest release tag in the commit graph, so git picks it:

$ git describe --tags --long --match 'v*'
vm-dev-0-g355d845

git_version then strips the leading v (line 77), producing m-dev-0-g355d845, which parses cleanly as tag="m-dev", commits=0 and is returned verbatim. The resulting binary reports:

$ openshell --version
openshell m-dev

The original issue logged this for v0.0.28; I reproduced it on v0.0.29 as well (installed via uv tool install openshell==0.0.29 --force, same m-dev output). See comment: #832 (comment)

Fix verification

On current repo HEAD:

# before
$ git describe --tags --long --match 'v*'
vm-dev-0-g355d845

# after
$ git describe --tags --long --match 'v[0-9]*'
v0.0.29-2-g355d845

The fixed glob walks past vm-dev/vm-prod and lands on the newest numeric release tag. All real release tags follow v\d+\.\d+\.\d+, so this loses no valid version — it only filters out the dev tags that the format string was never meant to interpret.

The guess-next-dev path on line 90 (v0.0.29-2-gSHA0.0.30-dev.2+g355d845) now works as intended.

Testing

  • cargo check --package openshell-core compiles clean
  • cargo fmt --package openshell-core -- --check clean
  • Demonstrated glob behavior change above with git describe directly — the fix is one glob character so unit tests aren't useful, but the before/after demonstration on real tags is
  • mise run pre-commitmise not installed in this environment; ran cargo fmt --check + cargo check for the affected crate by hand

Checklist

  • Follows Conventional Commitsfix(core): …
  • Commit is signed off (DCO)
  • Architecture docs updated — not applicable

`git describe --tags --long --match "v*"` matches the `vm-dev` tag
alongside release tags. When `vm-dev` sits on or past the latest
release tag in the commit graph (currently the case on main), git
picks it, and the resulting `vm-dev-N-gSHA` string strips the leading
`v` down to `m-dev-N-gSHA`. With `commits == 0` that's returned
verbatim, producing a binary that reports itself as `m-dev`:

    $ openshell --version
    openshell m-dev

Confirmed on v0.0.28 (NVIDIA#832) and reproduced on v0.0.29 as well.

Restrict the glob to numeric release tags (`v[0-9]*`). All release
tags follow `v\d+\.\d+\.\d+`, so this loses no valid version — it
only filters out `vm-dev`, `vm-prod`, and any similar non-release
tags that share the `v` prefix.

Verified locally on this repo's current HEAD:

    # before
    $ git describe --tags --long --match 'v*'
    vm-dev-0-g355d845
    # after
    $ git describe --tags --long --match 'v[0-9]*'
    v0.0.29-2-g355d845

Closes NVIDIA#832

Signed-off-by: mjamiv <michael.commack@gmail.com>
@mjamiv mjamiv requested a review from a team as a code owner April 15, 2026 05:33
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 15, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions
Copy link
Copy Markdown

Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text:


I have read the DCO document and I hereby sign the DCO.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

@mjamiv
Copy link
Copy Markdown
Author

mjamiv commented Apr 15, 2026

I have read the DCO document and I hereby sign the DCO.

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.

The v0.0.28 release binary identifies as m-dev instead of 0.0.28

1 participant