Skip to content

Commit

Permalink
Rollup merge of rust-lang#110356 - jyn514:rust-installer-tests, r=ozk…
Browse files Browse the repository at this point in the history
…anonur

Fix `x test rust-installer` when `cargo` is set to a relative path

Previously, this would give an error because the shell script had a different working directory:

```
test: basic_install
$ sh /home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh --image-dir=/home/jyn/src/rust/src/tools/rust-installer/test/image1 --work-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/workdir --output-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/outdir
/home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh: 15: ../rust3/build/host/stage2-tools-bin/cargo: not found

TEST FAILED!
```
  • Loading branch information
matthiaskrgr authored Apr 15, 2023
2 parents 300a741 + b1feb45 commit 71b2bbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,9 @@ impl Config {
});
config.initial_cargo = build
.cargo
.map(PathBuf::from)
.map(|cargo| {
t!(PathBuf::from(cargo).canonicalize(), "`initial_cargo` not found on disk")
})
.unwrap_or_else(|| config.out.join(config.build.triple).join("stage0/bin/cargo"));

// NOTE: it's important this comes *after* we set `initial_rustc` just above.
Expand Down

0 comments on commit 71b2bbc

Please sign in to comment.