]> git.proxmox.com Git - cargo.git/commitdiff
Contrib: Document submodule update process
authorEric Huss <eric@huss.org>
Sat, 30 Jul 2022 00:34:11 +0000 (17:34 -0700)
committerEric Huss <eric@huss.org>
Sat, 30 Jul 2022 01:05:41 +0000 (18:05 -0700)
src/doc/contrib/src/process/release.md

index e6fbcaf8f78c18707e593a7682e1a5921bdc819e..cc7b489129c4bdcb4ba6d388a9ed923c73d91308 100644 (file)
@@ -28,6 +28,46 @@ and stable releases.
 
 [`dist` bootstrap module]: https://github.com/rust-lang/rust/blob/master/src/bootstrap/dist.rs
 
+## Submodule updates
+
+Cargo is tracked in the [rust-lang/rust] repository using a [git submodule].
+It is updated manually about once a week by a Cargo team member.
+However, anyone is welcome to update it as needed.
+
+[@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.
+Running the tests ahead-of-time helps avoid long cycle times waiting for bors if there are any errors.
+Subup will also provide a message to include in the PR with a list of all PRs it covers.
+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.
+
+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:
+
+```bash
+subup --up-branch update-cargo \
+    --commit-message "Update cargo" \
+    --test="src/tools/linkchecker tidy \
+        src/tools/cargo \
+        src/tools/rustfmt \
+        src/tools/rls" \
+    src/tools/cargo
+```
+
+If doing a [beta backport](#beta-backports), the command is similar, but needs to point to the correct branches:
+
+```bash
+subup --up-branch update-beta-cargo \
+    --rust-branch beta \
+    --set-config rust.channel=beta \
+    --commit-message "[beta] Update cargo" \
+    --test="src/tools/linkchecker tidy \
+        src/tools/cargo \
+        src/tools/rustfmt \
+        src/tools/rls" \
+    rust-1.63.0:src/tools/cargo
+```
+
+[@ehuss]: https://github.com/ehuss/
+[git submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
+
 ## Version updates
 
 Shortly after each major release, a Cargo team member will post a PR to update