about summary refs log tree commit diff
path: root/src/ci/docker/scripts/add_dummy_commit.sh
diff options
context:
space:
mode:
authorLaurențiu Nicola <lnicola@dend.ro>2024-12-23 11:27:07 +0200
committerLaurențiu Nicola <lnicola@dend.ro>2024-12-23 11:27:07 +0200
commit9420a0b11a5403af2d08f2a2b3ece9d331b538dd (patch)
tree14d045ee9ceb0d2f0121f789571bb01dfd0dea6b /src/ci/docker/scripts/add_dummy_commit.sh
parent214134902f952ff8f1f2b24db6d3f6f531675742 (diff)
parent0eca4dd3205a01dba4bd7b7c140ec370aff03440 (diff)
downloadrust-9420a0b11a5403af2d08f2a2b3ece9d331b538dd.tar.gz
rust-9420a0b11a5403af2d08f2a2b3ece9d331b538dd.zip
Merge from rust-lang/rust
Diffstat (limited to 'src/ci/docker/scripts/add_dummy_commit.sh')
-rwxr-xr-xsrc/ci/docker/scripts/add_dummy_commit.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ci/docker/scripts/add_dummy_commit.sh b/src/ci/docker/scripts/add_dummy_commit.sh
new file mode 100755
index 00000000000..029e4ae141f
--- /dev/null
+++ b/src/ci/docker/scripts/add_dummy_commit.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -ex
+
+if [ "$READ_ONLY_SRC" = "0" ]; then
+    # `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
+    # "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
+    # compiler and/or library. Here we are adding a dummy commit on compiler and running
+    # that test to make sure we never download CI rustc with a change on the compiler tree.
+    echo "" >> ../compiler/rustc/src/main.rs
+    git config --global user.email "dummy@dummy.com"
+    git config --global user.name "dummy"
+    git add ../compiler/rustc/src/main.rs
+    git commit -m "test commit for rust.download-rustc=if-unchanged logic"
+    DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
+        -- core::builder::tests::ci_rustc_if_unchanged_logic
+    # Revert the dummy commit
+    git reset --hard HEAD~1
+fi