about summary refs log tree commit diff
path: root/compiler/rustc_llvm/src
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-01-31 12:20:30 -0500
committerJoshua Nelson <jyn514@gmail.com>2021-05-22 18:41:03 -0500
commit0be4046bf91ea3726098e7714642697c43af7e98 (patch)
tree2e54b0e51b3c6e54ca24dc4899e07a07ad922f10 /compiler/rustc_llvm/src
parente652f88d726f9d47a66919f0d267239cc112048a (diff)
downloadrust-0be4046bf91ea3726098e7714642697c43af7e98.tar.gz
rust-0be4046bf91ea3726098e7714642697c43af7e98.zip
Move llvm submodule updates to rustbuild
This enables better caching, since LLVM is only updated when needed, not
whenever x.py is run. Before, bootstrap.py had to use heuristics to
guess if LLVM would be needed, and updated the module more often than
necessary as a result.

This syncs the LLVM submodule only just before building the compiler, so
people working on the standard library never have to worry about it.
Example output:

```
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Updating submodule src/llvm-project
Submodule 'src/llvm-project' (https://github.com/rust-lang/llvm-project.git) registered for path 'src/llvm-project'
Submodule path 'src/llvm-project': checked out 'f9a8d70b6e0365ac2172ca6b7f1de0341297458d'
```

- Don't try to update the LLVM submodule when using system LLVM

  Previously, this would try to update LLVM unconditionally. Now the
  submodule is only initialized if `llvm-config` is not set.

- Don't update LLVM submodule in dry runs

  This prevents the following test failures:

  ```
  running 17 tests
  fatal: invalid gitfile format: /checkout/src/llvm-project/.git
  test builder::tests::defaults::build_cross_compile ... FAILED

  ---- builder::tests::defaults::build_default stdout ----
  thread 'main' panicked at 'command did not execute successfully: "git" "rev-parse" "HEAD"
  expected success, got: exit code: 128', src/build_helper/lib.rs:139:9
  ```

- Try running git without --progress if it fails the first time

  This avoids having to do version detection to see if --progress is
  supported or not.

- Don't try to update submodules when the source repository isn't managed by git

- Update LLVM submodules that have already been checked out

- Only check for whether the submodule should be updated in lib.rs; update
it unconditionally in native.rs
Diffstat (limited to 'compiler/rustc_llvm/src')
0 files changed, 0 insertions, 0 deletions