Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# - A new option
# - A change in the default values
#
# If the change-id does not match the version currently in use, x.py will
# If the change-id does not match the version currently in use, x.py will
# display the changes made to the bootstrap.
# To suppress these warnings, you can set change-id = "ignore".
#change-id = <latest change id in src/bootstrap/src/utils/change_tracker.rs>
Expand Down Expand Up @@ -442,6 +442,9 @@
# What custom diff tool to use for displaying compiletest tests.
#compiletest-diff-tool = <none>

# Whether to use the precompiled stage0 libtest with compiletest.
#compiletest-use-stage0-libtest = true

# Indicates whether ccache is used when building certain artifacts (e.g. LLVM).
# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use
# a specific version.
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/defaults/bootstrap.dist.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ test-stage = 2
doc-stage = 2
# When compiling from source, you usually want all tools.
extended = true
# Use libtest built from the source tree instead of the precompiled one from stage 0.
compiletest-use-stage0-libtest = false

# Most users installing from source want to build all parts of the project from source.
[llvm]
Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,14 @@ macro_rules! bootstrap_tool {
}
)*

let is_unstable = false $(|| $unstable)*;
let compiletest_wants_stage0 = $tool_name == "compiletest" && builder.config.compiletest_use_stage0_libtest;

builder.ensure(ToolBuild {
compiler: self.compiler,
target: self.target,
tool: $tool_name,
mode: if false $(|| $unstable)* {
mode: if is_unstable && !compiletest_wants_stage0 {
// use in-tree libraries for unstable features
Mode::ToolStd
} else {
Expand Down
6 changes: 6 additions & 0 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ pub struct Config {
/// Command for visual diff display, e.g. `diff-tool --color=always`.
pub compiletest_diff_tool: Option<String>,

/// Whether to use the precompiled stage0 libtest with compiletest.
pub compiletest_use_stage0_libtest: bool,

pub is_running_on_ci: bool,
}

Expand Down Expand Up @@ -983,6 +986,7 @@ define_config! {
optimized_compiler_builtins: Option<bool> = "optimized-compiler-builtins",
jobs: Option<u32> = "jobs",
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
compiletest_use_stage0_libtest: Option<bool> = "compiletest-use-stage0-libtest",
ccache: Option<StringOrBool> = "ccache",
exclude: Option<Vec<PathBuf>> = "exclude",
}
Expand Down Expand Up @@ -1682,6 +1686,7 @@ impl Config {
optimized_compiler_builtins,
jobs,
compiletest_diff_tool,
compiletest_use_stage0_libtest,
mut ccache,
exclude,
} = toml.build.unwrap_or_default();
Expand Down Expand Up @@ -2415,6 +2420,7 @@ impl Config {
config.optimized_compiler_builtins =
optimized_compiler_builtins.unwrap_or(config.channel != "dev");
config.compiletest_diff_tool = compiletest_diff_tool;
config.compiletest_use_stage0_libtest = compiletest_use_stage0_libtest.unwrap_or(true);

let download_rustc = config.download_rustc_commit.is_some();
config.explicit_stage_from_cli = flags.stage.is_some();
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Info,
summary: "You can now use `change-id = \"ignore\"` to suppress `change-id ` warnings in the console.",
},
ChangeInfo {
change_id: 139386,
severity: ChangeSeverity::Info,
summary: "Added a new option `build.compiletest-use-stage0-libtest` to force `compiletest` to use the stage 0 libtest.",
},
];
2 changes: 1 addition & 1 deletion src/ci/citool/tests/test-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runners:
<<: *base-job
envs:
env-x86_64-apple-tests: &env-x86_64-apple-tests
SCRIPT: ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact
SCRIPT: ./x.py check compiletest --set build.compiletest-use-stage0-libtest=true && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
# Ensure that host tooling is tested on our minimum supported macOS version.
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/host-x86_64/mingw-check/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
ENV SCRIPT \
python3 ../x.py check --stage 0 --set build.optimized-compiler-builtins=false core alloc std --target=aarch64-unknown-linux-gnu,i686-pc-windows-msvc,i686-unknown-linux-gnu,x86_64-apple-darwin,x86_64-pc-windows-gnu,x86_64-pc-windows-msvc && \
/scripts/check-default-config-profiles.sh && \
python3 ../x.py check compiletest --set build.compiletest-use-stage0-libtest=true && \
python3 ../x.py check --target=x86_64-pc-windows-gnu --host=x86_64-pc-windows-gnu && \
python3 ../x.py clippy ci && \
python3 ../x.py build --stage 0 src/tools/build-manifest && \
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,5 @@ COPY scripts/shared.sh /scripts/
# the local version of the package is different than the one used by the CI.
ENV SCRIPT /tmp/checktools.sh ../x.py && \
npm install browser-ui-test@$(head -n 1 /tmp/browser-ui-test.version) --unsafe-perm=true && \
python3 ../x.py check compiletest --set build.compiletest-use-stage0-libtest=true && \
python3 ../x.py test tests/rustdoc-gui --stage 2 --test-args "'--jobs 1'"
2 changes: 1 addition & 1 deletion src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runners:
<<: *base-job
envs:
env-x86_64-apple-tests: &env-x86_64-apple-tests
SCRIPT: ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact
SCRIPT: ./x.py check compiletest --set build.compiletest-use-stage0-libtest=true && ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
# Ensure that host tooling is tested on our minimum supported macOS version.
Expand Down
Loading