rust/src
Yuki Okushi d75521a36e
Rollup merge of #85590 - jam1garner:tool-bootstrap-su-fix, r=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.
2021-05-26 13:30:59 +09:00
..
bootstrap Rollup merge of #85590 - jam1garner:tool-bootstrap-su-fix, r=Mark-Simulacrum 2021-05-26 13:30:59 +09:00
build_helper Add track_caller to builder_helper::output 2021-05-19 22:55:59 -04:00
ci Auto merge of #85335 - GuillaumeGomez:rollup-0tvc14g, r=GuillaumeGomez 2021-05-15 17:37:18 +00:00
doc Rollup merge of #83366 - jyn514:stabilize-key-value-attrs, r=petrochenkov 2021-05-18 22:35:54 -04:00
etc
librustdoc Rollup merge of #84048 - konan8205:master, r=jsha 2021-05-26 13:30:54 +09:00
llvm-project@5f67a57157 Update LLVM submodule 2021-05-12 21:15:39 +02:00
rustdoc-json-types
test Rollup merge of #84048 - konan8205:master, r=jsha 2021-05-26 13:30:54 +09:00
tools Auto merge of #85634 - RalfJung:miri, r=RalfJung 2021-05-25 08:31:56 +00:00
README.md
stage0.txt remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
version

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.