Skip to content

Commit 1762b33

Browse files
committed
Contrib: Document submodule update process
1 parent 281989f commit 1762b33

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/doc/contrib/src/process/release.md

+40
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,46 @@ and stable releases.
2828

2929
[`dist` bootstrap module]: https://github.com/rust-lang/rust/blob/master/src/bootstrap/dist.rs
3030

31+
## Submodule updates
32+
33+
Cargo is tracked in the [rust-lang/rust] repository using a [git submodule].
34+
It is updated manually about once a week by a Cargo team member.
35+
However, anyone is welcome to update it as needed.
36+
37+
[@ehuss] has a tool called [subup](https://github.com/ehuss/subup) to automate the process of updating the submodule, updating the lockfile, running tests, and creating a PR.
38+
Running the tests ahead-of-time helps avoid long cycle times waiting for bors if there are any errors.
39+
Subup will also provide a message to include in the PR with a list of all PRs it covers.
40+
Posting this in the PR message also helps create reference links on each Cargo PR to the submodule update PR to help track when it gets merged.
41+
42+
The following is an example of the command to run in a local clone of rust-lang/rust to run a certain set of tests of things that are likely to get broken by a Cargo update:
43+
44+
```bash
45+
subup --up-branch update-cargo \
46+
--commit-message "Update cargo" \
47+
--test="src/tools/linkchecker tidy \
48+
src/tools/cargo \
49+
src/tools/rustfmt \
50+
src/tools/rls" \
51+
src/tools/cargo
52+
```
53+
54+
If doing a [beta backport](#beta-backports), the command is similar, but needs to point to the correct branches:
55+
56+
```bash
57+
subup --up-branch update-beta-cargo \
58+
--rust-branch beta \
59+
--set-config rust.channel=beta \
60+
--commit-message "[beta] Update cargo" \
61+
--test="src/tools/linkchecker tidy \
62+
src/tools/cargo \
63+
src/tools/rustfmt \
64+
src/tools/rls" \
65+
rust-1.63.0:src/tools/cargo
66+
```
67+
68+
[@ehuss]: https://github.com/ehuss/
69+
[git submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
70+
3171
## Version updates
3272

3373
Shortly after each major release, a Cargo team member will post a PR to update

0 commit comments

Comments
 (0)