-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Git version at build-time #685
Conversation
This commit also updates flake.lock and Cargo.lock due to built requiring rustc >= 1.81
Due to the way Nix flakes work, building Amber through Nix removes Git metadata. To work around this, I systematically append -nix-COMMIT (or -nix-dirty) to the version string for Amber built with Nix.
generally looking good to me, and i like this approach The build via nix flake works fine :) nix run git+https://github.com/Thesola10/amber?ref=git-version -- -V
amber 0.4.0-alpha-nix-a71cc4e However with cargo i noticed a commit hash that does not seem to exist (?) cargo run -- -V
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
Running `target/debug/amber -V`
amber 0.4.0-alpha-2-ga71cc4e I also tried to clean the repo (git clean -fd) and cargo clean, but still shows this commit hash for some reason. |
The hash provided by built starts with |
Yes but I don't understand why/where it prepends a Seems especially confusing with the format otherwise matching git describe |
it's just the way |
what about releases though? i dont think the commit tag is necessary anywhere else other than the developement/nightly versions |
Exactly. Does it append the tag on release versions too? |
No it doesnt append a commit if the HEAD is tagged |
This commit also updates flake.lock and Cargo.lock due to
built
requiringrustc >= 1.81
Both the command-line
-V
option and the generated script header will use the Git-formatted version if Git was available at build-time, and the commit differs from the latest tag.This fixes #635