From 103816d704133fc954344d551af04cb333b03e94 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 22 Dec 2022 13:21:48 -0600 Subject: [PATCH] Avoid running the `Profile` step twice on `x setup` Prevents runs like the following: ``` $ x setup Welcome to the Rust project! What do you want to do with x.py? a) library: Contribute to the standard library b) compiler: Contribute to the compiler itself c) codegen: Contribute to the compiler, and also modify LLVM or codegen d) tools: Contribute to tools which depend on the compiler, but do not modify it directly (e.g. rustdoc, clippy, miri) e) user: Install Rust from source Please choose one (a/b/c/d/e): b To get started, try one of the following commands: - `x.py check` - `x.py build` - `x.py test` For more suggestions, see https://rustc-dev-guide.rust-lang.org/building/suggested.html `x.py` will now use the configuration at /home/nilsh/projects/rustfast/src/bootstrap/defaults/config.compiler.toml Welcome to the Rust project! What do you want to do with x.py? ... ``` --- src/bootstrap/setup.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bootstrap/setup.rs b/src/bootstrap/setup.rs index 57426ce3d51..cd360cbef96 100644 --- a/src/bootstrap/setup.rs +++ b/src/bootstrap/setup.rs @@ -96,6 +96,10 @@ impl Step for Profile { } fn make_run(run: RunConfig<'_>) { + if run.builder.config.dry_run() { + return; + } + // for Profile, `run.paths` will have 1 and only 1 element // this is because we only accept at most 1 path from user input. // If user calls `x.py setup` without arguments, the interactive TUI