Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move llvm submodule updates to rustbuild #81601

Merged
merged 2 commits into from
May 23, 2021
Merged

Commits on May 20, 2021

  1. Add track_caller to builder_helper::output

    If something goes wrong here, showing `fn output` is unhelpful. Show
    where the command is being run instead.
    jyn514 committed May 20, 2021
    Configuration menu
    Copy the full SHA
    e652f88 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2021

  1. 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:/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
    jyn514 committed May 22, 2021
    Configuration menu
    Copy the full SHA
    0be4046 View commit details
    Browse the repository at this point in the history