@@ -48,10 +48,10 @@ Update and activate the rustup toolchain 'miri' to the commit given in the
48
48
`rustup-toolchain-install-master` must be installed for this to work. Any extra
49
49
flags are passed to `rustup-toolchain-install-master`.
50
50
51
- ./miri rustc-pull:
52
- Pull and merge Miri changes from the rustc repo. The fetched commit is stored in
53
- the `rust-version` file, so the next `./miri toolchain` will install the rustc
54
- we just pulled.
51
+ ./miri rustc-pull <commit> :
52
+ Pull and merge Miri changes from the rustc repo. Defaults to fetching the latest
53
+ rustc commit. The fetched commit is stored in the `rust-version` file, so the
54
+ next `./miri toolchain` will install the rustc that just got pulled.
55
55
56
56
./miri rustc-push <github user> <branch>:
57
57
Push Miri changes back to the rustc repo. This will pull a copy of the rustc
@@ -113,18 +113,17 @@ toolchain)
113
113
;;
114
114
rustc-pull)
115
115
cd " $MIRIDIR "
116
- FETCH_COMMIT=$( git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1)
117
- # We can't pull from a commit with josh
118
- # (https://github.com/josh-project/josh/issues/1034), so we just hope that
119
- # nothing gets merged into rustc *during* this pull.
120
- git fetch http://localhost:8000/rust-lang/rust.git$JOSH_FILTER .git master
121
- # Just verify that `master` didn't move.
122
- if [[ $FETCH_COMMIT != $( git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1) ]]; then
123
- echo " Looks like something got merged into Rust *while we were pulling*. Aborting. Please try again."
116
+ FETCH_COMMIT=" $1 "
117
+ if [ -z " $FETCH_COMMIT " ]; then
118
+ FETCH_COMMIT=$( git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1)
124
119
fi
125
- echo " $FETCH_COMMIT " > rust-version # do this *before* merging as merging will fail in case of conflicts
120
+ # Update rust-version file. As a separate commit, since making it part of
121
+ # the merge has confused the heck out of josh in the past.
122
+ echo " $FETCH_COMMIT " > rust-version
123
+ git commit rust-version -m " Preparing for merge from rustc"
124
+ # Fetch given rustc commit and note down which one that was
125
+ git fetch http://localhost:8000/rust-lang/rust.git@$FETCH_COMMIT$JOSH_FILTER .git
126
126
git merge FETCH_HEAD --no-ff -m " Merge from rustc"
127
- git commit rust-version --amend -m " Merge from rustc"
128
127
exit 0
129
128
;;
130
129
rustc-push)
@@ -157,11 +156,22 @@ rustc-push)
157
156
fi
158
157
git fetch https://github.com/rust-lang/rust $BASE
159
158
git push https://github.com/$USER /rust $BASE :refs/heads/$BRANCH -f
159
+ echo
160
160
# Do the actual push.
161
161
cd " $MIRIDIR "
162
162
echo " Pushing Miri changes..."
163
163
git push http://localhost:8000/$USER /rust.git$JOSH_FILTER .git HEAD:$BRANCH
164
- exit 0
164
+ # Do a round-trip check to make sure the push worked as expected.
165
+ echo
166
+ git fetch http://localhost:8000/$USER /rust.git@$JOSH_FILTER .git $BRANCH & > /dev/null
167
+ if [[ $( git rev-parse HEAD) != $( git rev-parse FETCH_HEAD) ]]; then
168
+ echo " ERROR: Josh created a non-roundtrip push! Do NOT merge this into rustc!"
169
+ exit 1
170
+ else
171
+ echo " Confirmed that the push round-trips back to Miri properly. Please create a rustc PR:"
172
+ echo " https://github.com/$USER /rust/pull/new/$BRANCH "
173
+ exit 0
174
+ fi
165
175
;;
166
176
many-seeds)
167
177
for SEED in $( { echo obase=16; seq 0 255; } | bc) ; do
0 commit comments