Rollup merge of #110356 - jyn514:rust-installer-tests, r=ozkanonur

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!
```
This commit is contained in:
Yuki Okushi 2023-04-16 06:55:22 +09:00 committed by GitHub
commit be2e8078d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.