Bring the updating LLVM guide up to date

This commit is contained in:
Alex Crichton 2019-04-29 07:26:21 -07:00 committed by Who? Me?!
parent 041020ab2d
commit 5fbdd8652f
1 changed files with 26 additions and 34 deletions

View File

@ -36,24 +36,25 @@ For updates of LLVM that typically just update a bug, we cherry-pick the bugfix
to the branch we're already using. The steps for this are: to the branch we're already using. The steps for this are:
1. Make sure the bugfix is in upstream LLVM. 1. Make sure the bugfix is in upstream LLVM.
2. Identify the branch that rustc is currently using. The `src/llvm` submodule 2. Identify the branch that rustc is currently using. The `src/llvm-project`
is always pinned to a branch of the submodule is always pinned to a branch of the
[rust-lang/llvm](https://github.com/rust-lang/llvm) repository. [rust-lang/llvm-project](https://github.com/rust-lang/llvm-project) repository.
3. Fork the rust-lang/llvm repository 3. Fork the rust-lang/llvm-project repository
4. Check out the appropriate branch (typically named `rust-llvm-release-*`) 4. Check out the appropriate branch (typically named `rustc/a.b-yyyy-mm-dd`)
5. Cherry-pick the upstream commit onto the branch 5. Cherry-pick the upstream commit onto the branch
6. Push this branch to your fork 6. Push this branch to your fork
7. Send a Pull Request to rust-lang/llvm to the same branch as before 7. Send a Pull Request to rust-lang/llvm-project to the same branch as before
8. Wait for the PR to be merged 8. Wait for the PR to be merged
9. Send a PR to rust-lang/rust updating the `src/llvm` submodule with your bugfix 9. Send a PR to rust-lang/rust updating the `src/llvm-project` submodule with
your bugfix
10. Wait for PR to be merged 10. Wait for PR to be merged
The tl;dr; is that we can cherry-pick bugfixes at any time and pull them back The tl;dr; is that we can cherry-pick bugfixes at any time and pull them back
into the rust-lang/llvm branch that we're using, and getting it into the into the rust-lang/llvm-project branch that we're using, and getting it into the
compiler is just updating the submodule via a PR! compiler is just updating the submodule via a PR!
Example PRs look like: Example PRs look like:
[#56313](https://github.com/rust-lang/rust/pull/56313) [#59089](https://github.com/rust-lang/rust/pull/59089)
## Feature updates ## Feature updates
@ -66,37 +67,28 @@ lot more work. This is where we can't reasonably cherry-pick commits backwards
so we need to do a full update. There's a lot of stuff to do here, so let's go so we need to do a full update. There's a lot of stuff to do here, so let's go
through each in detail. through each in detail.
1. Create new branches in all repositories for this update. Branches should be 1. Create a new branch in the rust-lang/llvm-project repository. This branch
named `rust-llvm-release-X-Y-Z-vA` where `X.Y.Z` is the LLVM version and `A` should be named `rustc/a.b-yyyy-mm-dd` where `a.b` is the current version
is just increasing based on if there's previous branches of this name. All number of LLVM in-tree at the time of the branch and the remaining part is
repositories here should be branched at the same time from the upstream LLVM today's date.
projects, we currently use https://github.com/llvm-mirror repositories. The
list of repositories that need a new branch are:
* rust-lang/llvm 2. Apply Rust-specific patches to the llvm-project repository. All features and
* rust-lang/compiler-rt bugfixes are upstream, but there's often some weird build-related patches
* rust-lang/lld that don't make sense to upstream which we have on our repositories. These
* rust-lang-nursery/lldb patches are around the latest patches in the rust-lang/llvm-project branch
* rust-lang-nursery/clang that rustc is currently using.
2. Apply Rust-specific patches to LLVM repositories. All features and bugfixes
are upstream, but there's often some weird build-related patches that don't
make sense to upstream which we have on our repositories. These patches are
typically the latest patches on the branch. All repositories, except `clang`,
currently have Rust-specific patches.
3. Update the `compiler-rt` submodule in the 3. Update the `compiler-rt` submodule in the
`rust-lang-nursery/compiler-builtins` repository. Push this update to a `rust-lang-nursery/compiler-builtins` repository. Push this update to the
`rust-llvm-release-*` branch of the `compiler-builtins` repository. same branch name of the `llvm-project` submodule to the
of the `rust-lang/compiler-rt` repository. Then push this update to a branch
of `compiler-builtins` with the same-named branch. Note that this step is
frequently optional since we may not need to update `compiler-rt`.
4. Prepare a commit to rust-lang/rust 4. Prepare a commit to rust-lang/rust
* Update `src/llvm` * Update `src/llvm-project`
* Update `src/tools/lld` * Update `compiler-builtins` crate in `Cargo.lock` (if necessary)
* Update `src/tools/lldb`
* Update `src/tools/clang`
* Update `src/libcompiler_builtins
* Edit `src/rustllvm/llvm-rebuild-trigger` to update its contents
5. Build your commit. Make sure you've committed the previous changes to ensure 5. Build your commit. Make sure you've committed the previous changes to ensure
submodule updates aren't reverted. Some commands you should execute are: submodule updates aren't reverted. Some commands you should execute are: