Change:
stable is fine: but beta and nightly are no longer showing commit-hash and commit-date information: ` <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
it's weird because the info is still displayed correctly in the very first oneliner-summary, but if there was some tool that reads the data by looking at or we still should display the right thing.
This appears to have been introduced by . The issue is that the macro uses CFGVERDATE/CFGVERHASH which is only set when compiling rustc. One option is to try to share some code with . Another option is to go the other way and get rustc to share some code with .
Mentoring instructions: set in (Maybe we should try to unify those functions so they don't duplicate so much code and problems like this don't happen in the future?)
I think it should be possible to write a run-make test ensuring this works properly.
claim
Hi im starting my journey of contributing to Rust, i found this issue a good starter for myself, do you think you would be open to let me take this chance to get familiar with the code base?
Hey! Go for it!
Alternatively, you could check out . I THINK that might be more straightforward. But I'll let you decide(:
claim
I tried doing this change in Then i did a and tried running this command on the stage2 rustodc But it appears that the commit-hash and commit-date is still unknown. Im wondering if the issue is that is passed as true in This is my first time making changes and testing in this project, please feel free to correct me if im testing / building in the wrong way.
I'd suggest changing to use instead of so it's easier to tell when these variables are unset without having to build a full stage 2 compiler.
Retagging as stable/stable regression, this already shipped in 1.67 as far as I can tell.
Are you still (interested in) working on this issue? I'd like to claim it otherwise.
please go ahead and claim it!
claim

Discussion:
cmd.arg("--channel").arg(&builder.config.channel); <ins> if !builder.config.omit_git_hash { cmd.arg("--git-hash"); } </ins> if let Some(commit) = builder.config.download_rustc_commit() { cmd.env("FAKE_DOWNLOAD_RUSTC_PREFIX", format!("/rustc/{commit}")); }

cargo.env("CFG_VERSION", builder.rust_version()); cargo.env("CFG_RELEASE_NUM", &builder.version); cargo.env("DOC_RUST_LANG_ORG_CHANNEL", builder.doc_rust_lang_org_channel()); <ins> if let Some(ref ver_date) = builder.rust_info().commit_date() { cargo.env("CFG_VER_DATE", ver_date); } if let Some(ref ver_hash) = builder.rust_info().sha() { cargo.env("CFG_VER_HASH", ver_hash); } </ins> let info = GitInfo::new(builder.config.omit_git_hash, &dir); if let Some(sha) = info.sha() {

/// The current Rust channel pub channel: String, <ins> /// Whether adding git commit information such as the commit hash has been enabled for building pub git_hash: bool, </ins> /// The default Rust edition pub edition: Option<String>,

condition: cache.x86_64_dlltool, ignore_reason: "ignored when dlltool for x86_64 is not present", }, <ins> Need { name: "needs-git-hash", condition: config.git_hash, ignore_reason: "ignored when git hashes have been omitted for building", }, </ins> ]; let (name, comment) = match ln.split_once([':', ' ']) {

} #[test] <ins> fn git_hash() { let mut config = config(); config.git_hash = false; assert!(check_ignore(&config, "// needs-git-hash")); config.git_hash = true; assert!(!check_ignore(&config, "// needs-git-hash")); } #[test] </ins> fn sanitizers() { let mut config = config();

.optflag("", "nocapture", "") .optflag("h", "help", "show this message") .reqopt("", "channel", "current Rust channel", "CHANNEL") <ins> .optflag("", "git-hash", "run tests which rely on commit version being compiled into the binaries") </ins> .optopt("", "edition", "default Rust edition", "EDITION"); let (argv0, args_) = args.split_first().unwrap();

rustfix_coverage: matches.opt_present("rustfix-coverage"), has_tidy, channel: matches.opt_str("channel").unwrap(), <ins> git_hash: matches.opt_present("git-hash"), </ins> edition: matches.opt_str("edition"), cc: matches.opt_str("cc").unwrap(),

<ins> # needs-git-hash include ../tools.mk all: $(BARE_RUSTC) --version --verbose | $(CGREP) -i -e "commit-hash: [0-9a-f]{40}" "commit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}" $(BARE_RUSTDOC) --version --verbose | $(CGREP) -i -e "commit-hash: [0-9a-f]{40}" "commit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}" </ins>