Skip to content

Commit a4b0481

Browse files
committed
Auto merge of #33317 - michaelwoerister:fix-partitioning-tests-race, r=alexcrichton
Fix a race condition caused by concurrently executed codegen unit tests. This hopefully fixes issue #33315. This short-term solution just makes sure that every test uses its own directory so they can't get into conflict with each other. As a more long-term solution, I'd probably prefer to make the partitioning scheme specifiable via `-Ccodegen-units` (e.g. like `-Ccodegen-units=per-module`) so that we don't have to rely on `-Zincremental` in these test cases. r? @alexcrichton
2 parents 2a815a2 + a4128e5 commit a4b0481

10 files changed

+31
-10
lines changed

src/test/codegen-units/partitioning/extern-drop-glue.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp
12+
13+
// We specify -Z incremental here because we want to test the partitioning for
14+
// incremental compilation
15+
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/extern-drop-glue
1316

1417
#![allow(dead_code)]
1518
#![crate_type="lib"]

src/test/codegen-units/partitioning/extern-generic.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=eager -Zincremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=eager -Zincremental=tmp/partitioning-tests/extern-generic
1315

1416
#![allow(dead_code)]
1517
#![crate_type="lib"]

src/test/codegen-units/partitioning/inlining-from-extern-crate.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/inlining-from-extern-crate
1315

1416
#![crate_type="lib"]
1517

src/test/codegen-units/partitioning/local-drop-glue.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/local-drop-glue
1315

1416
#![allow(dead_code)]
1517
#![crate_type="lib"]

src/test/codegen-units/partitioning/local-generic.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=eager -Zincremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=eager -Zincremental=tmp/partitioning-tests/local-generic
1315

1416
#![allow(dead_code)]
1517
#![crate_type="lib"]

src/test/codegen-units/partitioning/local-inlining.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/local-inlining
1315

1416
#![allow(dead_code)]
1517
#![crate_type="lib"]

src/test/codegen-units/partitioning/local-transitive-inlining.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/local-transitive-inlining
1315

1416
#![allow(dead_code)]
1517
#![crate_type="lib"]

src/test/codegen-units/partitioning/methods-are-with-self-type.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/methods-are-with-self-type
1315

1416
#![allow(dead_code)]
1517

src/test/codegen-units/partitioning/regular-modules.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=eager -Z incremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=eager -Zincremental=tmp/partitioning-tests/regular-modules
1315

1416
#![allow(dead_code)]
1517
#![crate_type="lib"]

src/test/codegen-units/partitioning/statics.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// ignore-tidy-linelength
12-
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp
12+
// We specify -Z incremental here because we want to test the partitioning for
13+
// incremental compilation
14+
// compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/statics
1315

1416
#![crate_type="lib"]
1517

0 commit comments

Comments
 (0)