Repository navigation
feat(cli): --version appends build hash/profile and a Windows persona note (rubash#488) - #490
Merged
Merged
Conversation
… note (rubash#488)
The MSYS-persona banner made dev builds indistinguishable from the
installed release - the fake-baseline root cause behind three agent
incidents on 2026-10-10. The GNU compat block stays byte-identical;
after the license block --version appends:
build: <git-hash> (<profile>)
note: native Windows build without an MSYS runtime; MSYS identifiers
are a compatibility persona only (see docs/platform-support.md)
build.rs captures `git rev-parse --short HEAD` at compile time
(unknown when git is unavailable; RUBASH_BUILD_HASH pins release
packaging). The profile comes from cfg!(debug_assertions). The note
line is Windows-only: non-Windows binaries already report an honest
native triple. help/uname version banners are untouched - upstream
.right assets and the builtins10.sub `sed 1d` normalization gate on
them byte for byte.
Tests: a new cli_tests case pins the full output shape, build_info
unit tests cover the appendix, and the help_pages/identity/uname
suites stay green.
This was referenced Oct 10, 2026
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.
Closes #488
What
rubash --versionappends build metadata after the GNU license block, which stays byte-identical:build: <git-hash> (<profile>)—<git-hash>isgit rev-parse --short HEADcaptured by the newbuild.rsat compile time (unknownwhen git is unavailable, e.g. tarball builds; release packaging can pin it via theRUBASH_BUILD_HASHenv var),<profile>isdebug/releasefromcfg!(debug_assertions).*-pc-msysMACHTYPE must not be read as an MSYS2/Cygwin bash port. The detailed docs section is landing in parallel on the niubash side; this PR only carries the pointer.Before / After
Before (master — a dev build of the engine and the installed 1.3.3 release are indistinguishable, the #488 fake-baseline root cause):
After (
target/debug/rubash.exe --versionbuilt from this branch — hash shown is the base commit this dev build was made from; a build from a checkout of the merged commit carries that commit's hash, which is exactly what CI/release already do):RUBASH_IDENTITY=nativeswaps line 1 to(x86_64-pc-windows); the appended lines are unchanged. Non-Windows builds print thebuild:line only.Compatibility
.rightassets are unaffected.help/uname --versionversion banners are deliberately NOT touched:builtins10.subpipeshelp | sed 1dand the manpageIMPLEMENTATIONblock is pinned by the static.rightassets, so an extra banner line there would break byte comparisons. The issue's acceptance criterion (--version traceability) is fully met without them.--versionhas a single print site (no interactive/tty branch — the banner is never shown at startup), so piped and terminal output are identical.Tests
tests/cli_tests.rs::version_appends_build_metadata_after_the_gnu_block_rubash_488pins the full output shape (GNU block byte-exact + build line grammar + Windows note).src/build_info.rsunit tests: appendix shape, Windows note (4 info points), non-Windows single line, hash/profile grammar.cargo test --lib: 640 passed / 2 failed — both failures pre-exist on clean master on this machine (D:-drive POSIX-path-form env issues), verified identical via a stashed clean-master run.cargo test --test cli_tests: 447 passed (+1 new) / 29 failed — failure set verified byte-identical to clean master (bashdb fixture, examples, tilde/HOME, drive-path env failures; all environmental).cargo test --test help_pages: 12/12 green;identity(5),uname(7),support_names(2) unit tests green.cargo fmt --checkpasses (pre-commit hook enforced).