Skip to content
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

Check exit status of subcommands spawned by rustc_tools_util #13217

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Aug 4, 2024

The git commands git rev-parse --short HEAD and git log -1 --date=short --pretty=format:%cd that clippy runs from its build script might fail with "fatal: not a git repository (or any of the parent directories): .git" if clippy is being built from a source tarball rather than a git repository. That message is written by git to stderr, and nothing is written to stdout.

For clippy-driver --version this PR wouldn't make a difference because it treats empty stdout and failed spawns (git is not installed) identically:

println!(
"cargo:rustc-env=GIT_HASH={}",
$crate::get_commit_hash().unwrap_or_default()
);
println!(
"cargo:rustc-env=COMMIT_DATE={}",
$crate::get_commit_date().unwrap_or_default()
);

But other users of rustc_tools_util should be able to expect that the distinction between Some and None is meaningful. They shouldn't need extra code to handle None vs Some-and-empty vs Some-and-nonempty.


changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2024

r? @xFrednet

rustbot has assigned @xFrednet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 4, 2024
@flip1995
Copy link
Member

flip1995 commented Aug 5, 2024

@bors r+

Thanks!

@bors
Copy link
Collaborator

bors commented Aug 5, 2024

📌 Commit 234ea1f has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 5, 2024

⌛ Testing commit 234ea1f with merge e611c8e...

@bors
Copy link
Collaborator

bors commented Aug 5, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing e611c8e to master...

@bors bors merged commit e611c8e into rust-lang:master Aug 5, 2024
8 checks passed
@dtolnay dtolnay deleted the toolsutil branch August 5, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants