Skip to content

Commit c76946a

Browse files
committed
add exclude to config.toml
1 parent f5a1ef7 commit c76946a

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

config.example.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,10 @@
436436
# a specific version.
437437
#ccache = false
438438

439+
# List of paths to exclude from the build and test processes.
440+
# For example, exclude = ["tests/ui", "src/tools/tidy"].
441+
#exclude = []
442+
439443
# =============================================================================
440444
# General install configuration options
441445
# =============================================================================

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

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ define_config! {
943943
jobs: Option<u32> = "jobs",
944944
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
945945
ccache: Option<StringOrBool> = "ccache",
946+
exclude: Option<Vec<PathBuf>> = "exclude",
946947
}
947948
}
948949

@@ -1374,22 +1375,6 @@ impl Config {
13741375
"flags.exclude" = ?flags.exclude
13751376
);
13761377

1377-
config.skip = flags
1378-
.skip
1379-
.into_iter()
1380-
.chain(flags.exclude)
1381-
.map(|p| {
1382-
// Never return top-level path here as it would break `--skip`
1383-
// logic on rustc's internal test framework which is utilized
1384-
// by compiletest.
1385-
if cfg!(windows) {
1386-
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
1387-
} else {
1388-
p
1389-
}
1390-
})
1391-
.collect();
1392-
13931378
#[cfg(feature = "tracing")]
13941379
span!(
13951380
target: "CONFIG_HANDLING",
@@ -1635,8 +1620,29 @@ impl Config {
16351620
jobs,
16361621
compiletest_diff_tool,
16371622
mut ccache,
1623+
exclude,
16381624
} = toml.build.unwrap_or_default();
16391625

1626+
let mut paths: Vec<PathBuf> = flags.skip.into_iter().chain(flags.exclude).collect();
1627+
1628+
if let Some(exclude) = exclude {
1629+
paths.extend(exclude);
1630+
}
1631+
1632+
config.skip = paths
1633+
.into_iter()
1634+
.map(|p| {
1635+
// Never return top-level path here as it would break `--skip`
1636+
// logic on rustc's internal test framework which is utilized
1637+
// by compiletest.
1638+
if cfg!(windows) {
1639+
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
1640+
} else {
1641+
p
1642+
}
1643+
})
1644+
.collect();
1645+
16401646
config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));
16411647

16421648
if let Some(file_build) = build {

0 commit comments

Comments
 (0)