Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The build script fails outside Git checkouts unless an override is supplied, and unstaged source edits can leave cached version metadata incorrectly reporting a clean build.
2 open issues
What changed in this PR
Adds Git revision information to the version reported by GetFirmwareInfo, sharing one version string between the host server and embedded firmware.
Changes:
- Generates Git version metadata at build time, with an environment-variable override.
- Defines a shared version string using the workspace package version and Git metadata.
- Updates both request handlers to return the shared string.
| File | Description |
|---|---|
crates/ziggurat-server/src/main.rs |
Returns the shared version in host firmware-info responses. |
crates/ziggurat-protocol/src/lib.rs |
Exposes the combined package and Git version string. |
crates/ziggurat-protocol/Cargo.toml |
Inherits the package version from the workspace. |
crates/ziggurat-protocol/build.rs |
Obtains Git metadata and configures build-script rerun triggers. |
crates/ziggurat-ncp-api/src/protocol.rs |
Returns the shared version in embedded firmware-info responses. |
Review effort: Balanced
Comment on lines
+4
to
+5
| let output = Command::new("git").args(args).output().unwrap(); | ||
| assert!(output.status.success(), "git {args:?} failed"); |
Comment on lines
+18
to
+19
| // An edit that is not staged does not re-run this script. | ||
| for path in ["HEAD", "logs/HEAD", "index"] { |
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.


For example,
ziggurat/0.1.0+0490795-dirty.