Skip to content

run-make: Allow blessing snapshot files that don't exist yet #144954

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Aug 5, 2025

This makes it possible to bless the snapshot files used by diff() in newly-created run-make tests, without having to create the files manually beforehand.

r? jieyouxu

This makes it possible to bless the snapshot files used by `diff()` in
newly-created run-make tests, without having to create the files manually
beforehand.
@rustbot
Copy link
Collaborator

rustbot commented Aug 5, 2025

jieyouxu is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 5, 2025

The run-make-support library was changed

cc @jieyouxu

@rust-log-analyzer
Copy link
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
[TIMING] core::build_steps::tool::ToolBuild { build_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 12.996
[TIMING] core::build_steps::tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/src/tools/run-make-support/src/diff/mod.rs:48:
         let path = path.as_ref();
         // In `--bless` mode, create the snapshot file if it doesn't already exist.
         // The empty file will be overwritten with the actual text.
-        if self.bless_dir.is_some() && let Ok(false) = std::fs::exists(path) {
+        if self.bless_dir.is_some()
+            && let Ok(false) = std::fs::exists(path)
+        {
             fs::write(path, "");
         }
         let content = fs::read_to_string(path);
fmt: checked 6293 files
Build completed unsuccessfully in 0:00:47
  local time: Tue Aug  5 12:42:58 UTC 2025
  network time: Tue, 05 Aug 2025 12:42:59 GMT
##[error]Process completed with exit code 1.

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks, r=me after fixing tidy

@jieyouxu
Copy link
Member

jieyouxu commented Aug 5, 2025

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 5, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants