Skip to content

Commit

Permalink
Rollup merge of #112722 - DrMeepster:patch-2, r=clubby789
Browse files Browse the repository at this point in the history
bootstrap: check for dry run when copying env vars for msvc

The new synthetic targets for mir-opt blessing aren't added to `builder.cc` during dry runs, causing `x.py test tests/mir-opt --bless`  to crash on MSVC when it tries to copy env vars to the C compiler invocation. This PR adds a check for dry run to fix the panic.
  • Loading branch information
matthiaskrgr authored Jun 18, 2023
2 parents eb40590 + 3078de7 commit a066e1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
//
// Note that if we encounter `PATH` we make sure to append to our own `PATH`
// rather than stomp over it.
if target.contains("msvc") {
if !builder.config.dry_run() && target.contains("msvc") {
for &(ref k, ref v) in builder.cc.borrow()[&target].env() {
if k != "PATH" {
cmd.env(k, v);
Expand Down

0 comments on commit a066e1b

Please sign in to comment.