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