From e25c6243cadc679c34018c1bc058223ea3ad9a07 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 31 Mar 2024 14:03:45 +0200 Subject: [PATCH] update josh version and guidance --- src/tools/miri/.github/workflows/ci.yml | 2 +- src/tools/miri/CONTRIBUTING.md | 18 +++++++----------- src/tools/miri/miri-script/src/commands.rs | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/tools/miri/.github/workflows/ci.yml b/src/tools/miri/.github/workflows/ci.yml index ec14fffc1d0c..b0dab9f509d4 100644 --- a/src/tools/miri/.github/workflows/ci.yml +++ b/src/tools/miri/.github/workflows/ci.yml @@ -195,7 +195,7 @@ jobs: with: fetch-depth: 256 # get a bit more of the history - name: install josh-proxy - run: RUSTFLAGS="--cap-lints warn" cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r22.12.06 + run: RUSTFLAGS="--cap-lints warn" cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r23.12.04 - name: setup bot git name and email run: | git config --global user.name 'The Miri Cronjob Bot' diff --git a/src/tools/miri/CONTRIBUTING.md b/src/tools/miri/CONTRIBUTING.md index 3416fb0d9ba0..60bc1d5282dd 100644 --- a/src/tools/miri/CONTRIBUTING.md +++ b/src/tools/miri/CONTRIBUTING.md @@ -241,18 +241,20 @@ We use the [`josh` proxy](https://github.com/josh-project/josh) to transmit chan rustc and Miri repositories. You can install it as follows: ```sh -cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r22.12.06 +RUSTFLAGS="--cap-lints=warn" cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r23.12.04 ``` Josh will automatically be started and stopped by `./miri`. ### Importing changes from the rustc repo +*Note: this usually happens automatically, so these steps rarely have to be done by hand.* + We assume we start on an up-to-date master branch in the Miri repo. ```sh # Fetch and merge rustc side of the history. Takes ca 5 min the first time. -# This will also update the 'rustc-version' file. +# This will also update the `rustc-version` file. ./miri rustc-pull # Update local toolchain and apply formatting. ./miri toolchain && ./miri fmt @@ -266,12 +268,6 @@ needed. ### Exporting changes to the rustc repo -Keep in mind that pushing is the most complicated job that josh has to do -- pulling just filters -the rustc history, but pushing needs to construct a new rustc history that would filter to the given -Miri history! To avoid problems, it is a good idea to always pull immediately before you push. If -you are getting strange errors, chances are you are running into [this josh -bug](https://github.com/josh-project/josh/issues/998). In that case, please get in touch on Zulip. - We will use the josh proxy to push to your fork of rustc. Run the following in the Miri repo, assuming we are on an up-to-date master branch: @@ -280,9 +276,9 @@ assuming we are on an up-to-date master branch: ./miri rustc-push YOUR_NAME miri ``` -This will create a new branch called 'miri' in your fork, and the output should -include a link to create a rustc PR that will integrate those changes into the -main repository. +This will create a new branch called `miri` in your fork, and the output should include a link that +creates a rustc PR to integrate those changes into the main repository. If that PR has conflicts, +you need to pull rustc changes into Miri first, and then re-do the rustc push. If this fails due to authentication problems, it can help to make josh push via ssh instead of https. Add the following to your `.gitconfig`: diff --git a/src/tools/miri/miri-script/src/commands.rs b/src/tools/miri/miri-script/src/commands.rs index 58deac66560d..55b3b62819f5 100644 --- a/src/tools/miri/miri-script/src/commands.rs +++ b/src/tools/miri/miri-script/src/commands.rs @@ -297,7 +297,7 @@ impl Command { }; // Prepare the branch. Pushing works much better if we use as base exactly // the commit that we pulled from last time, so we use the `rust-version` - // file as a good approximation of that. + // file to find out which commit that would be. println!("Preparing {github_user}/rust (base: {base})..."); if cmd!(sh, "git fetch https://github.com/{github_user}/rust {branch}") .ignore_stderr()