Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #85590 - jam1garner:tool-bootstrap-su-fix, r=Mark-Sim…
…ulacrum Fix bootstrap using host exe suffix for cargo When attempting to cross compile rustc (for example, from Linux to Windows) and tell it to build cargo/tools, the following error occurs: ``` thread 'main' panicked at 'src.symlink_metadata() failed with No such file or directory (os error 2)', src/bootstrap/lib.rs:1196:24 ``` Relevant part of stack trace: <details> ``` 2: bootstrap::Build::copy at ./src/bootstrap/lib.rs:1196:24 3: <bootstrap::tool::ToolBuild as bootstrap::builder::Step>::run at ./src/bootstrap/tool.rs:220:13 ``` </details> If I add `-vvv` (which seemed to be the recommended course for debugging a similar issue according to [zulip logs](https://zulip-archive.rust-lang.org/182449tcompilerhelp/19655failedtobootstrap.html)), it shows: ``` Copy ".../rust/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-pc-windows-gnu/release/cargo" to ".../rust/build/x86_64-unknown-linux-gnu/stage2-tools-bin/cargo" ``` and when taking a look at the contents of `build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-pc-windows-gnu/release` it contains `cargo.exe`, but no `cargo`. I tried to study the surrounding code to make sure this was the intended behavior and while I can't be 100% certain, it does seem that using the exe suffix for the `compiler.host` target instead of the `target` target won't have the desired behavior when cross-compiling to/from Windows.
- Loading branch information