From af66f9807518d185257d7c657310ecdfdcc47666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 16 Sep 2026 21:01:22 +0200 Subject: [PATCH 1/4] Update `rustup.sh` to use `rustc-josh-sync` --- scripts/rustup.sh | 60 ++++------------------------------------------- 1 file changed, 5 insertions(+), 55 deletions(-) diff --git a/scripts/rustup.sh b/scripts/rustup.sh index e26be30732..99eb66d027 100755 --- a/scripts/rustup.sh +++ b/scripts/rustup.sh @@ -4,73 +4,23 @@ set -e TOOLCHAIN=${TOOLCHAIN:-$(date +%Y-%m-%d)} -function check_git_fixed_subtree() { - if [[ ! -e ./git-fixed-subtree.sh ]]; then - echo "Missing git-fixed-subtree.sh. Please run the following commands to download it:" - echo "curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/bjorn3/git/tqc-subtree-portable/contrib/subtree/git-subtree.sh -o git-fixed-subtree.sh" - echo "chmod u+x git-fixed-subtree.sh" - exit 1 - fi - if [[ ! -x ./git-fixed-subtree.sh ]]; then - echo "git-fixed-subtree.sh is not executable. Please run the following command to make it executable:" - echo "chmod u+x git-fixed-subtree.sh" - exit 1 - fi -} - case $1 in "prepare") - echo "=> Installing new nightly" - rustup toolchain install --profile minimal "nightly-${TOOLCHAIN}" # Sanity check to see if the nightly exists - sed -i "s/\"nightly-.*\"/\"nightly-${TOOLCHAIN}\"/" rust-toolchain.toml - - echo "=> Uninstalling all old nightlies" - for nightly in $(rustup toolchain list | grep nightly | grep -v "$TOOLCHAIN" | grep -v nightly-x86_64); do - rustup toolchain uninstall "$nightly" - done - ./clean_all.sh ./y.sh prepare ;; - "commit") - git add rust-toolchain.toml - git commit -m "Rustup to $(rustc -V)" - ;; "push") - check_git_fixed_subtree - - cg_clif=$(pwd) - pushd ../rust - git pull origin main + username=${2:-bjorn3} branch=sync_cg_clif-$(date +%Y-%m-%d) - git checkout -b "$branch" - "$cg_clif/git-fixed-subtree.sh" pull --prefix=compiler/rustc_codegen_cranelift/ https://github.com/rust-lang/rustc_codegen_cranelift.git main - git push -u my "$branch" - - # immediately merge the merge commit into cg_clif to prevent merge conflicts when syncing - # from rust-lang/rust later - "$cg_clif/git-fixed-subtree.sh" push --prefix=compiler/rustc_codegen_cranelift/ "$cg_clif" sync_from_rust - popd - git merge sync_from_rust + rustc-josh-sync push "$branch" "$username" ;; "pull") - check_git_fixed_subtree - - RUST_VERS=$(curl "https://static.rust-lang.org/dist/$TOOLCHAIN/channel-rust-nightly-git-commit-hash.txt") - echo "Pulling $RUST_VERS ($TOOLCHAIN)" - - cg_clif=$(pwd) - pushd ../rust - git fetch origin main - git -c advice.detachedHead=false checkout "$RUST_VERS" - "$cg_clif/git-fixed-subtree.sh" push --prefix=compiler/rustc_codegen_cranelift/ "$cg_clif" sync_from_rust - popd - git merge sync_from_rust -m "Sync from rust $RUST_VERS" - git branch -d sync_from_rust + git checkout -b sync_from_rust + rustc-josh-sync pull ;; *) echo "Unknown command '$1'" - echo "Usage: ./rustup.sh prepare|commit" + echo "Usage: ./rustup.sh prepare|pull|push " ;; esac From 4621dcf7041179e0325e7a1f58957ad0535f75f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 18 Sep 2026 09:15:33 +0200 Subject: [PATCH 2/4] Put nightly installation back in --- scripts/rustup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/rustup.sh b/scripts/rustup.sh index 99eb66d027..efeaefab25 100755 --- a/scripts/rustup.sh +++ b/scripts/rustup.sh @@ -6,6 +6,14 @@ TOOLCHAIN=${TOOLCHAIN:-$(date +%Y-%m-%d)} case $1 in "prepare") + echo "=> Installing new nightly" + rustup toolchain install --profile minimal "nightly-${TOOLCHAIN}" # Sanity check to see if the nightly exists + sed -i "s/\"nightly-.*\"/\"nightly-${TOOLCHAIN}\"/" rust-toolchain.toml + + echo "=> Uninstalling all old nightlies" + for nightly in $(rustup toolchain list | grep nightly | grep -v "$TOOLCHAIN" | grep -v nightly-x86_64); do + rustup toolchain uninstall "$nightly" + done ./clean_all.sh ./y.sh prepare @@ -21,6 +29,6 @@ case $1 in ;; *) echo "Unknown command '$1'" - echo "Usage: ./rustup.sh prepare|pull|push " + echo "Usage: ./rustup.sh prepare|pull|push [fork]" ;; esac From cf02eb2a05944878a8ee33fb13adc47b3b5fa174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 18 Sep 2026 11:39:16 +0200 Subject: [PATCH 3/4] Add git config --- scripts/rustup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/rustup.sh b/scripts/rustup.sh index efeaefab25..406fde1117 100755 --- a/scripts/rustup.sh +++ b/scripts/rustup.sh @@ -4,6 +4,9 @@ set -e TOOLCHAIN=${TOOLCHAIN:-$(date +%Y-%m-%d)} +export GIT_CONFIG_GLOBAL=../rust/josh.gitconfig +export RUSTC_GIT=../rust + case $1 in "prepare") echo "=> Installing new nightly" From c4a61825f13ce16746111ff837dc16a544d6699b Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 18 Sep 2026 12:14:48 +0200 Subject: [PATCH 4/4] Revert change --- scripts/rustup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/rustup.sh b/scripts/rustup.sh index 406fde1117..991524a1be 100755 --- a/scripts/rustup.sh +++ b/scripts/rustup.sh @@ -17,6 +17,7 @@ case $1 in for nightly in $(rustup toolchain list | grep nightly | grep -v "$TOOLCHAIN" | grep -v nightly-x86_64); do rustup toolchain uninstall "$nightly" done + ./clean_all.sh ./y.sh prepare