Skip to content

Commit 2bf1cec

Browse files
committed
refactor
1 parent a1abbaa commit 2bf1cec

File tree

5 files changed

+25
-60
lines changed

5 files changed

+25
-60
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
if [ "$READ_ONLY_SRC" = "0" ]; then
6+
# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
7+
# "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
8+
# compiler and/or library. Here we are adding a dummy commit on compiler and running
9+
# that test to make sure we never download CI rustc with a change on the compiler tree.
10+
echo "" >> ../compiler/rustc/src/main.rs
11+
git config --global user.email "[email protected]"
12+
git config --global user.name "dummy"
13+
git add ../compiler/rustc/src/main.rs
14+
git commit -m "test commit for rust.download-rustc=if-unchanged logic"
15+
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
16+
-- core::builder::tests::ci_rustc_if_unchanged_logic
17+
# Revert the dummy commit
18+
git reset --hard HEAD~1
19+
fi

src/ci/docker/scripts/x86_64-gnu-llvm.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,7 @@
22

33
set -ex
44

5-
if [ "$READ_ONLY_SRC" = "0" ]; then
6-
# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
7-
# "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
8-
# compiler and/or library. Here we are adding a dummy commit on compiler and running
9-
# that test to make sure we never download CI rustc with a change on the compiler tree.
10-
echo "" >> ../compiler/rustc/src/main.rs
11-
git config --global user.email "[email protected]"
12-
git config --global user.name "dummy"
13-
git add ../compiler/rustc/src/main.rs
14-
git commit -m "test commit for rust.download-rustc=if-unchanged logic"
15-
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
16-
-- core::builder::tests::ci_rustc_if_unchanged_logic
17-
# Revert the dummy commit
18-
git reset --hard HEAD~1
19-
fi
5+
./add_dummy_commit.sh
206

217
# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
228
../x.py --stage 2 test --skip src/tools/tidy

src/ci/docker/scripts/x86_64-gnu-llvm1.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,7 @@
22

33
set -ex
44

5-
if [ "$READ_ONLY_SRC" = "0" ]; then
6-
# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
7-
# "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
8-
# compiler and/or library. Here we are adding a dummy commit on compiler and running
9-
# that test to make sure we never download CI rustc with a change on the compiler tree.
10-
echo "" >> ../compiler/rustc/src/main.rs
11-
git config --global user.email "[email protected]"
12-
git config --global user.name "dummy"
13-
git add ../compiler/rustc/src/main.rs
14-
git commit -m "test commit for rust.download-rustc=if-unchanged logic"
15-
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
16-
-- core::builder::tests::ci_rustc_if_unchanged_logic
17-
# Revert the dummy commit
18-
git reset --hard HEAD~1
19-
fi
5+
./add_dummy_commit.sh
206

217
../x.py --stage 2 test \
228
--skip tests \

src/ci/docker/scripts/x86_64-gnu-llvm2.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,9 @@
22

33
set -ex
44

5-
if [ "$READ_ONLY_SRC" = "0" ]; then
6-
# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
7-
# "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
8-
# compiler and/or library. Here we are adding a dummy commit on compiler and running
9-
# that test to make sure we never download CI rustc with a change on the compiler tree.
10-
echo "" >> ../compiler/rustc/src/main.rs
11-
git config --global user.email "[email protected]"
12-
git config --global user.name "dummy"
13-
git add ../compiler/rustc/src/main.rs
14-
git commit -m "test commit for rust.download-rustc=if-unchanged logic"
15-
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
16-
-- core::builder::tests::ci_rustc_if_unchanged_logic
17-
# Revert the dummy commit
18-
git reset --hard HEAD~1
19-
fi
5+
./add_dummy_commit.sh
6+
7+
##### Test stage 2 #####
208

219
../x.py --stage 2 test \
2210
--skip compiler \

src/ci/docker/scripts/x86_64-gnu-llvm3.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,7 @@
22

33
set -ex
44

5-
if [ "$READ_ONLY_SRC" = "0" ]; then
6-
# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
7-
# "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
8-
# compiler and/or library. Here we are adding a dummy commit on compiler and running
9-
# that test to make sure we never download CI rustc with a change on the compiler tree.
10-
echo "" >> ../compiler/rustc/src/main.rs
11-
git config --global user.email "[email protected]"
12-
git config --global user.name "dummy"
13-
git add ../compiler/rustc/src/main.rs
14-
git commit -m "test commit for rust.download-rustc=if-unchanged logic"
15-
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
16-
-- core::builder::tests::ci_rustc_if_unchanged_logic
17-
# Revert the dummy commit
18-
git reset --hard HEAD~1
19-
fi
5+
./add_dummy_commit.sh
206

217
##### Test stage 1 #####
228

0 commit comments

Comments
 (0)