Uh oh!
There was an error while loading. Please reload this page.
Fix bootstrap using host exe suffix for cargo - #85590
Conversation
rust-highfive
commented
May 22, 2021
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Mark-Simulacrum
commented
May 22, 2021
This indeed seems correct, I think. |
This comment has been minimized.
This comment has been minimized.
51e2fc5 to
903e369Comparejam1garner
commented
May 22, 2021
oops, formatted |
jam1garner
commented
May 24, 2021
@Mark-Simulacrum could I get a CI rerun when you have a moment? Thanks |
Mark-Simulacrum
commented
May 26, 2021
@bors r+ rollup |
bors
commented
May 26, 2021
📌 Commit 903e369 has been approved by |
…=Mark-Simulacrum 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.
Rollup of 12 pull requests Successful merges: - rust-lang#84048 (Avoid CJK legacy fonts in Windows) - rust-lang#85529 (doc: clarify Mutex::try_lock, etc. errors) - rust-lang#85590 (Fix bootstrap using host exe suffix for cargo) - rust-lang#85610 (Fix pointer provenance in <[T]>::copy_within) - rust-lang#85623 (Remove stray .stderr files) - rust-lang#85645 (Demote `ControlFlow::{from|into}_try` to `pub(crate)`) - rust-lang#85647 (Revert "Move llvm submodule updates to rustbuild") - rust-lang#85666 (Document shared_from_cow functions) - rust-lang#85668 (Fix tasklist example in rustdoc book.) - rust-lang#85672 (Move stability attribute for items under the `ip` feature) - rust-lang#85699 (Update books) - rust-lang#85701 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
When attempting to cross compile rustc (for example, from Linux to Windows) and tell it to build cargo/tools, the following error occurs:
Relevant part of stack trace:
Details
If I add
-vvv(which seemed to be the recommended course for debugging a similar issue according to zulip logs), it shows:and when taking a look at the contents of
build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-pc-windows-gnu/releaseit containscargo.exe, but nocargo.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.hosttarget instead of thetargettarget won't have the desired behavior when cross-compiling to/from Windows.