| 
2 | 2 | 
 
  | 
3 | 3 | set -ex  | 
4 | 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  | 
20 |  | - | 
21 |  | -# Only run the stage 1 tests on merges, not on PR CI jobs.  | 
22 |  | -if [[ -z "${PR_CI_JOB}" ]]; then  | 
23 |  | -    ../x.py --stage 1 test --skip src/tools/tidy  | 
24 |  | - | 
25 |  | -    # Run the `mir-opt` tests again but this time for a 32-bit target.  | 
26 |  | -    # This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have  | 
27 |  | -    # both 32-bit and 64-bit outputs updated by the PR author, before  | 
28 |  | -    # the PR is approved and tested for merging.  | 
29 |  | -    # It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,  | 
30 |  | -    # despite having different output on 32-bit vs 64-bit targets.  | 
31 |  | -    ../x.py --stage 1 test tests/mir-opt --host='' --target=i686-unknown-linux-gnu  | 
32 |  | - | 
33 |  | -    # Run `ui-fulldeps` in `--stage=1`, which actually uses the stage0  | 
34 |  | -    # compiler, and is sensitive to the addition of new flags.  | 
35 |  | -    ../x.py --stage 1 test tests/ui-fulldeps  | 
36 |  | - | 
37 |  | -    # Rebuild the stdlib with the size optimizations enabled and run tests again.  | 
38 |  | -    RUSTFLAGS_NOT_BOOTSTRAP="--cfg feature=\"optimize_for_size\"" ../x.py --stage 1 test \  | 
39 |  | -        library/std library/alloc library/core  | 
40 |  | -fi  | 
 | 5 | +/tmp/add_dummy_commit.sh  | 
41 | 6 | 
 
  | 
42 | 7 | # NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.  | 
43 | 8 | ../x.py --stage 2 test --skip src/tools/tidy  | 
 | 
0 commit comments