Skip to content

Commit 1fc0921

Browse files
committed
Remove the add_dummy_commit.sh hack and the corresponding bootstrap test
The new git tests should be enough to check this scenario. We should ideally not be creating dummy commits on CI.
1 parent 276caf1 commit 1fc0921

File tree

7 files changed

+2
-72
lines changed

7 files changed

+2
-72
lines changed

src/bootstrap/src/core/builder/tests.rs

-39
Original file line numberDiff line numberDiff line change
@@ -238,45 +238,6 @@ fn alias_and_path_for_library() {
238238
);
239239
}
240240

241-
#[test]
242-
fn ci_rustc_if_unchanged_logic() {
243-
let config = Config::parse_inner(
244-
Flags::parse(&[
245-
"build".to_owned(),
246-
"--dry-run".to_owned(),
247-
"--set=rust.download-rustc='if-unchanged'".to_owned(),
248-
]),
249-
|&_| Ok(Default::default()),
250-
);
251-
252-
let build = Build::new(config.clone());
253-
let builder = Builder::new(&build);
254-
255-
if config.out.exists() {
256-
fs::remove_dir_all(&config.out).unwrap();
257-
}
258-
259-
builder.run_step_descriptions(&Builder::get_step_descriptions(config.cmd.kind()), &[]);
260-
261-
// Make sure "if-unchanged" logic doesn't try to use CI rustc while there are changes
262-
// in compiler and/or library.
263-
if config.download_rustc_commit.is_some() {
264-
let mut paths = vec!["compiler"];
265-
266-
// Handle library tree the same way as in `Config::download_ci_rustc_commit`.
267-
if build_helper::ci::CiEnv::is_ci() {
268-
paths.push("library");
269-
}
270-
271-
let has_changes = config.has_changes_from_upstream(&paths);
272-
273-
assert!(
274-
!has_changes,
275-
"CI-rustc can't be used with 'if-unchanged' while there are changes in compiler and/or library."
276-
);
277-
}
278-
}
279-
280241
mod defaults {
281242
use pretty_assertions::assert_eq;
282243

src/bootstrap/src/core/config/config.rs

-3
Original file line numberDiff line numberDiff line change
@@ -3034,9 +3034,6 @@ impl Config {
30343034
// these changes to speed up the build process for library developers. This provides consistent
30353035
// functionality for library developers between `download-rustc=true` and `download-rustc="if-unchanged"`
30363036
// options.
3037-
//
3038-
// If you update "library" logic here, update `builder::tests::ci_rustc_if_unchanged_logic` test
3039-
// logic accordingly.
30403037
if !CiEnv::is_ci() {
30413038
allowed_paths.push(":!library");
30423039
}

src/ci/docker/host-x86_64/x86_64-gnu-llvm-18/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ COPY scripts/shared.sh /scripts/
5959

6060
ARG SCRIPT_ARG
6161

62-
COPY scripts/add_dummy_commit.sh /tmp/
6362
COPY scripts/x86_64-gnu-llvm.sh /tmp/
6463
COPY scripts/x86_64-gnu-llvm2.sh /tmp/
6564
COPY scripts/x86_64-gnu-llvm3.sh /tmp/
6665
COPY scripts/stage_2_test_set1.sh /tmp/
6766
COPY scripts/stage_2_test_set2.sh /tmp/
6867

69-
ENV SCRIPT "/tmp/add_dummy_commit.sh && /tmp/${SCRIPT_ARG}"
68+
ENV SCRIPT "/tmp/${SCRIPT_ARG}"

src/ci/docker/host-x86_64/x86_64-gnu-llvm-19/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,10 @@ COPY scripts/shared.sh /scripts/
5858

5959
ARG SCRIPT_ARG
6060

61-
COPY scripts/add_dummy_commit.sh /tmp/
6261
COPY scripts/x86_64-gnu-llvm.sh /tmp/
6362
COPY scripts/x86_64-gnu-llvm2.sh /tmp/
6463
COPY scripts/x86_64-gnu-llvm3.sh /tmp/
6564
COPY scripts/stage_2_test_set1.sh /tmp/
6665
COPY scripts/stage_2_test_set2.sh /tmp/
6766

68-
ENV SCRIPT "/tmp/add_dummy_commit.sh && /tmp/${SCRIPT_ARG}"
67+
ENV SCRIPT "/tmp/${SCRIPT_ARG}"

src/ci/docker/scripts/add_dummy_commit.sh

-19
This file was deleted.

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

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -ex
44

5-
/tmp/add_dummy_commit.sh
6-
75
##### Test stage 1 #####
86

97
../x.py --stage 1 test --skip src/tools/tidy

src/ci/github-actions/jobs.yml

-5
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ pr:
108108
- name: x86_64-gnu-llvm-18
109109
env:
110110
ENABLE_GCC_CODEGEN: "1"
111-
# We are adding (temporarily) a dummy commit on the compiler
112-
READ_ONLY_SRC: "0"
113111
DOCKER_SCRIPT: x86_64-gnu-llvm.sh
114112
<<: *job-linux-16c
115113
- name: x86_64-gnu-tools
@@ -331,7 +329,6 @@ auto:
331329
- name: x86_64-gnu-llvm-18-1
332330
env:
333331
RUST_BACKTRACE: 1
334-
READ_ONLY_SRC: "0"
335332
IMAGE: x86_64-gnu-llvm-18
336333
DOCKER_SCRIPT: stage_2_test_set1.sh
337334
<<: *job-linux-4c
@@ -340,7 +337,6 @@ auto:
340337
- name: x86_64-gnu-llvm-18-2
341338
env:
342339
RUST_BACKTRACE: 1
343-
READ_ONLY_SRC: "0"
344340
IMAGE: x86_64-gnu-llvm-18
345341
DOCKER_SCRIPT: x86_64-gnu-llvm2.sh
346342
<<: *job-linux-4c
@@ -349,7 +345,6 @@ auto:
349345
- name: x86_64-gnu-llvm-18-3
350346
env:
351347
RUST_BACKTRACE: 1
352-
READ_ONLY_SRC: "0"
353348
IMAGE: x86_64-gnu-llvm-18
354349
DOCKER_SCRIPT: x86_64-gnu-llvm3.sh
355350
<<: *job-linux-4c

0 commit comments

Comments
 (0)