about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-19 22:22:07 +0000
committerbors <bors@rust-lang.org>2022-06-19 22:22:07 +0000
commit611e7b9cea2b982b63de7f6697b2a9079b0bf188 (patch)
treec3448ee402d72d6b595bea149096065dd82d996c /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentbb8c2f41174caceec00c28bc6c5c20ae9f9a175c (diff)
parent057eab7ae96ee491f8939e52722b6c29ce3cc445 (diff)
downloadrust-611e7b9cea2b982b63de7f6697b2a9079b0bf188.tar.gz
rust-611e7b9cea2b982b63de7f6697b2a9079b0bf188.zip
Auto merge of #97268 - jyn514:faster-assemble, r=Mark-Simulacrum
Make "Assemble stage1 compiler" orders of magnitude faster (take 2)

This used to take upwards of 5 seconds for me locally. I found that the culprit was copying the downloaded LLVM shared object:
```
[22:28:03] Install "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so" to "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-14-rust-1.62.0-nightly.so"
[22:28:09]   c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) } }
```

It turned out that `install()` used full copies unconditionally. Change it to try using a hard-link before falling back to copying.

- Panic if we generate a symbolic link in a tarball
- Change install to use copy internally, like in my previous PR
- Change copy to dereference symbolic links, which avoids the previous regression in #96803.

I also took the liberty of fixing `x dist llvm-tools` to work even if you don't call `x build` previously.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions