feat: embed build information into binary and update CLI version display#38
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds build-time information embedding into the CLI binary to provide detailed version information when users run gixor --version --long. The implementation includes a Cargo build script that collects Cargo features, git commit hash, branch name, and Rust compiler version, then embeds this information into the binary for display.
Changes:
- Added build.rs script to collect and embed build metadata (features, git info, rustc version) into the binary
- Modified CLI to display long version information from embedded build data
- Updated GitHub Actions workflow to use GitHub Actions cache instead of registry cache for Docker builds
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| cli/build.rs | New build script that collects build metadata and writes it to a file included in the binary |
| cli/src/cli.rs | Updated CLI configuration to use the embedded long version string from build.rs |
| cli/Cargo.toml | Added build script reference to enable build.rs execution |
| .github/workflows/publish.yaml | Changed Docker build cache from registry-based to GitHub Actions cache |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| #[derive(Parser, Debug)] | ||
| #[command(name = "gixor", author, version, about, arg_required_else_help = true)] | ||
| #[command(name = "gixor", author, version, long_version=BUILD_LONG_VERSION)] |
There was a problem hiding this comment.
Missing space after the equals sign in the attribute. The attribute should be long_version = BUILD_LONG_VERSION (with spaces around the equals sign) for consistency with Rust style conventions.
| #[command(name = "gixor", author, version, long_version=BUILD_LONG_VERSION)] | |
| #[command(name = "gixor", author, version, long_version = BUILD_LONG_VERSION)] |
Pull Request Test Coverage Report for Build 20912452440Details
💛 - Coveralls |
No description provided.