From 0ec9799c4c6a774ffd5601959de7f102d8aab09a Mon Sep 17 00:00:00 2001 From: thanhnguyen-aws Date: Thu, 20 Feb 2025 13:09:12 -0800 Subject: [PATCH 01/10] add nightly --- .github/workflows/update-subtree.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index 0cdb42cff34c1..834e75cbf060a 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -119,7 +119,7 @@ jobs: echo "MERGE_CONFLICTS=no" >> $GITHUB_ENV fi - sed -i "s/^channel = \"nightly-.*\"/channel = \"${NEXT_TOOLCHAIN_DATE}\"/" rust-toolchain.toml + sed -i "s/^channel = \"nightly-.*\"/channel = \"nightly-${NEXT_TOOLCHAIN_DATE}\"/" rust-toolchain.toml git -c user.name=gitbot -c user.email=git@bot \ commit -m "Update toolchain to ${NEXT_TOOLCHAIN_DATE}" rust-toolchain.toml From 0f8495a65f482a2ce99fcb26b25e0278abedd7af Mon Sep 17 00:00:00 2001 From: thanhnguyen-aws Date: Fri, 21 Feb 2025 09:34:06 -0800 Subject: [PATCH 02/10] rm library folder --- .github/workflows/update-subtree.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index 834e75cbf060a..71328e123dbb7 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -77,6 +77,7 @@ jobs: git remote add rust-filtered ../rust-tmp/ git fetch rust-filtered git checkout -b subtree/library rust-filtered/subtree/library + rm -rf library SUBTREE_HEAD_MSG=$(git log --format=%s -n 1 origin/subtree/library) UPSTREAM_FROM=$(git log --grep="${SUBTREE_HEAD_MSG}" -n 1 --format=%H rust-filtered/subtree/library) UPSTREAM_HEAD=$(git log --format=%H -n 1 rust-filtered/subtree/library) From 59e3597b80ff517483eb105a4c6f952c79b70c58 Mon Sep 17 00:00:00 2001 From: thanhnguyen-aws Date: Fri, 21 Feb 2025 09:54:23 -0800 Subject: [PATCH 03/10] add check existing PR --- .github/workflows/update-subtree.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index 71328e123dbb7..bf3e40411c361 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -59,6 +59,22 @@ jobs: echo "CURRENT_COMMIT_HASH=${CURRENT_COMMIT_HASH}" >> $GITHUB_ENV echo "NEXT_COMMIT_HASH=${NEXT_COMMIT_HASH}" >> $GITHUB_ENV + - name: Check for existing pull requests + run: | + cd verify-rust-std + if gh pr list --json title --jq '.[] | select(.title == "Update subtree/library to ${{ env.NEXT_TOOLCHAIN_DATE }}") | .title' | grep -q .; then + echo "SUBTREE_PR_EXISTS=yes" >> $GITHUB_ENV + else + echo "SUBTREE_PR_EXISTS=no" >> $GITHUB_ENV + fi + if gh pr list --json title --jq '.[] | select(.title == "Merge subtree update for toolchain nightly-${{ env.NEXT_TOOLCHAIN_DATE }}") | .title' | grep -q .; then + echo "MERGE_PR_EXISTS=yes" >> $GITHUB_ENV + else + echo "MERGE_PR_EXISTS=no" >> $GITHUB_ENV + fi + env: + GH_TOKEN: ${{ github.token }} + - name: Update subtree/library locally run: | cd rust-tmp From dec57a24695bd8435d4a578c2f108dd84a5ce137 Mon Sep 17 00:00:00 2001 From: thanhnguyen-aws Date: Fri, 21 Feb 2025 10:02:48 -0800 Subject: [PATCH 04/10] add checking merge PR --- .github/workflows/update-subtree.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index bf3e40411c361..c217ca8663c18 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -74,8 +74,9 @@ jobs: fi env: GH_TOKEN: ${{ github.token }} - + - name: Update subtree/library locally + if: ${{ env.SUBTREE_PR_EXISTS == 'no' }} run: | cd rust-tmp @@ -106,8 +107,8 @@ jobs: echo "MERGE_CONFLICTS=maybe" >> $GITHUB_ENV fi - - name: Create Pull Request - if: ${{ env.MERGE_CONFLICTS != 'noop' }} + - name: Create Pull Request to update subtree/library + if: ${{ env.MERGE_CONFLICTS != 'noop' && env.SUBTREE_PR_EXISTS == 'no' }} uses: peter-evans/create-pull-request@v7 with: title: 'Update subtree/library to ${{ env.NEXT_TOOLCHAIN_DATE }}' @@ -121,7 +122,7 @@ jobs: path: verify-rust-std - name: Merge subtree/library changes - if: ${{ env.MERGE_CONFLICTS != 'noop' }} + if: ${{ env.MERGE_CONFLICTS != 'noop' && env.MERGE_PR_EXISTS == 'no' }} run: | cd verify-rust-std git checkout main @@ -141,7 +142,7 @@ jobs: commit -m "Update toolchain to ${NEXT_TOOLCHAIN_DATE}" rust-toolchain.toml - name: Create Pull Request without conflicts - if: ${{ env.MERGE_CONFLICTS == 'no' }} + if: ${{ env.MERGE_CONFLICTS == 'no' && env.MERGE_PR_EXISTS == 'no' }} uses: peter-evans/create-pull-request@v7 with: title: 'Merge subtree update for toolchain nightly-${{ env.NEXT_TOOLCHAIN_DATE }}' @@ -156,7 +157,7 @@ jobs: path: verify-rust-std - name: Create Pull Request with conflicts - if: ${{ env.MERGE_CONFLICTS == 'yes' }} + if: ${{ env.MERGE_CONFLICTS == 'yes' && env.MERGE_PR_EXISTS == 'no' }} uses: peter-evans/create-pull-request@v7 with: title: 'Merge subtree update for toolchain nightly-${{ env.NEXT_TOOLCHAIN_DATE }}' From 0022e276b772a33083027e94a66e598979824496 Mon Sep 17 00:00:00 2001 From: thanhnguyen-aws Date: Fri, 21 Feb 2025 10:11:10 -0800 Subject: [PATCH 05/10] add comment for remove folder Co-authored-by: Carolyn Zech --- .github/workflows/update-subtree.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index c217ca8663c18..df364f20fb938 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -94,6 +94,7 @@ jobs: git remote add rust-filtered ../rust-tmp/ git fetch rust-filtered git checkout -b subtree/library rust-filtered/subtree/library + # The filter-subtree operation adds an extraneous `library/` folder containing the submodules (c.f. https://github.com/model-checking/verify-rust-std/issues/249), so remove that before committing. rm -rf library SUBTREE_HEAD_MSG=$(git log --format=%s -n 1 origin/subtree/library) UPSTREAM_FROM=$(git log --grep="${SUBTREE_HEAD_MSG}" -n 1 --format=%H rust-filtered/subtree/library) From 129ec10884045d35e9d896aab576b8b157ba5ddf Mon Sep 17 00:00:00 2001 From: Carolyn Zech Date: Mon, 3 Mar 2025 11:13:49 -0500 Subject: [PATCH 06/10] Modify check for existing pull requests --- .github/workflows/update-subtree.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index df364f20fb938..e22c17e063eb4 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -62,12 +62,12 @@ jobs: - name: Check for existing pull requests run: | cd verify-rust-std - if gh pr list --json title --jq '.[] | select(.title == "Update subtree/library to ${{ env.NEXT_TOOLCHAIN_DATE }}") | .title' | grep -q .; then + if gh pr list --json title --jq '.[] | select(.title | startswith("Update subtree/library to")) | .title' | grep -q .; then echo "SUBTREE_PR_EXISTS=yes" >> $GITHUB_ENV else echo "SUBTREE_PR_EXISTS=no" >> $GITHUB_ENV fi - if gh pr list --json title --jq '.[] | select(.title == "Merge subtree update for toolchain nightly-${{ env.NEXT_TOOLCHAIN_DATE }}") | .title' | grep -q .; then + if gh pr list --json title --jq '.[] | select(.title | startswith("Merge subtree update for toolchain nightly-")) | .title' | grep -q .; then echo "MERGE_PR_EXISTS=yes" >> $GITHUB_ENV else echo "MERGE_PR_EXISTS=no" >> $GITHUB_ENV From 2c019d9acbbf8961356e8d95395ea4c55d8d2a05 Mon Sep 17 00:00:00 2001 From: thanhnguyen-aws Date: Mon, 3 Mar 2025 11:43:04 -0800 Subject: [PATCH 07/10] Update .github/workflows/update-subtree.yml Co-authored-by: Carolyn Zech --- .github/workflows/update-subtree.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index e22c17e063eb4..ce9fba9dd89b0 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -58,6 +58,8 @@ jobs: echo "NEXT_TOOLCHAIN_DATE=${NEXT_TOOLCHAIN_DATE}" >> $GITHUB_ENV echo "CURRENT_COMMIT_HASH=${CURRENT_COMMIT_HASH}" >> $GITHUB_ENV echo "NEXT_COMMIT_HASH=${NEXT_COMMIT_HASH}" >> $GITHUB_ENV + KANI_COMMIT_HASH=$(git -C kani-tmp rev-parse HEAD) + echo "KANI_COMMIT_HASH=${KANI_COMMIT_HASH}" >> $GITHUB_ENV - name: Check for existing pull requests run: | From 10db0ba52ea98353186ff1efa547d7ca17ef8651 Mon Sep 17 00:00:00 2001 From: thanhnguyen-aws Date: Mon, 3 Mar 2025 11:43:24 -0800 Subject: [PATCH 08/10] Update .github/workflows/update-subtree.yml Co-authored-by: Carolyn Zech --- .github/workflows/update-subtree.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index ce9fba9dd89b0..391a0c9bee1ee 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -143,7 +143,10 @@ jobs: sed -i "s/^channel = \"nightly-.*\"/channel = \"nightly-${NEXT_TOOLCHAIN_DATE}\"/" rust-toolchain.toml git -c user.name=gitbot -c user.email=git@bot \ commit -m "Update toolchain to ${NEXT_TOOLCHAIN_DATE}" rust-toolchain.toml - + # Update kani-version.toml with the new Kani commit hash + sed -i "s/commit = .*/commit = \"${KANI_COMMIT_HASH}\"/" tool_config/kani-version.toml + git -c user.name=gitbot -c user.email=git@bot \ + commit -m "Update Kani version to ${KANI_COMMIT_HASH}" tool_config/kani-version.toml - name: Create Pull Request without conflicts if: ${{ env.MERGE_CONFLICTS == 'no' && env.MERGE_PR_EXISTS == 'no' }} uses: peter-evans/create-pull-request@v7 From c52156691d214b11543b5b1032554096c66aa5f2 Mon Sep 17 00:00:00 2001 From: Carolyn Zech Date: Mon, 3 Mar 2025 16:49:34 -0500 Subject: [PATCH 09/10] Add instruction to use rebase strategy for subtree merge --- .github/workflows/update-subtree.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index 391a0c9bee1ee..6126c22880312 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -119,6 +119,7 @@ jobs: This is an automated PR to update the subtree/library branch to the changes from ${{ env.CURRENT_TOOLCHAIN_DATE }} (${{ env.CURRENT_COMMIT_HASH }}) to ${{ env.NEXT_TOOLCHAIN_DATE }} (${{ env.NEXT_COMMIT_HASH }}), inclusive. + **Do not merge this PR using the merge queue. Instead, use the rebase strategy.** branch: update-subtree/library delete-branch: true base: subtree/library From 36171910e47892d9d2c1883eca4138bd1c171f70 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Mon, 3 Mar 2025 23:02:12 +0100 Subject: [PATCH 10/10] Update .github/workflows/update-subtree.yml --- .github/workflows/update-subtree.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-subtree.yml b/.github/workflows/update-subtree.yml index 6126c22880312..ffa503242f89c 100644 --- a/.github/workflows/update-subtree.yml +++ b/.github/workflows/update-subtree.yml @@ -96,7 +96,8 @@ jobs: git remote add rust-filtered ../rust-tmp/ git fetch rust-filtered git checkout -b subtree/library rust-filtered/subtree/library - # The filter-subtree operation adds an extraneous `library/` folder containing the submodules (c.f. https://github.com/model-checking/verify-rust-std/issues/249), so remove that before committing. + # The filter-subtree operation adds an extraneous `library/` folder containing the submodules + # (c.f. https://github.com/model-checking/verify-rust-std/issues/249), so remove that before committing. rm -rf library SUBTREE_HEAD_MSG=$(git log --format=%s -n 1 origin/subtree/library) UPSTREAM_FROM=$(git log --grep="${SUBTREE_HEAD_MSG}" -n 1 --format=%H rust-filtered/subtree/library)