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

Don't print unnecessary sysroot messages #3599

Merged
merged 1 commit into from
May 12, 2024

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented May 11, 2024

Currently, when running cargo miri setup, we always print that a sysroot is being prepared, even if we just bail out of building after checking the hash. So that message is wrong; we didn't actually prepare a sysroot.

We also always print the preparing message for cargo miri run, even if no sysroot is prepared.

With this PR, cargo miri run prints no sysroot messages when an existing one is reused, and when a redundant cargo miri setup is requested, we print:

A sysroot for Miri is already available in `/home/ben/.cache/miri`.

}
write!(msg, "...").unwrap();
if only_setup {
let mut msg = String::new();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only needed inside the closure, it seems? Does it have to be computed outside?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructing the message inside just requires giving the hook a lifetime that's not 'static inside `rustc-build-sysroot.

cargo-miri/src/setup.rs Outdated Show resolved Hide resolved
@saethlin saethlin force-pushed the quiet-when-no-change branch 2 times, most recently from 5191888 to d574828 Compare May 12, 2024 16:35
@saethlin
Copy link
Member Author

Ah, fmt.

@RalfJung
Copy link
Member

I published a new rustc-build-sysroot, can you update the PR?

@saethlin saethlin force-pushed the quiet-when-no-change branch from d574828 to a18a0f8 Compare May 12, 2024 18:31
@saethlin saethlin marked this pull request as ready for review May 12, 2024 18:32
@RalfJung
Copy link
Member

LGTM, thanks!
@bors r+

@bors
Copy link
Contributor

bors commented May 12, 2024

📌 Commit a18a0f8 has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 12, 2024

⌛ Testing commit a18a0f8 with merge 8617fc4...

@bors
Copy link
Contributor

bors commented May 12, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 8617fc4 to master...

1 similar comment
@bors
Copy link
Contributor

bors commented May 12, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 8617fc4 to master...

@bors bors merged commit 8617fc4 into rust-lang:master May 12, 2024
8 checks passed
@saethlin saethlin deleted the quiet-when-no-change branch May 12, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants