-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Split run-make
into two {run-make
,run-make-cargo
} test suites
#146233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0f76784
f220710
aebcbe0
7154d39
9504090
c959d3a
e77a22f
6543e4d
1a2055a
34158ad
8665305
f755e64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1083,27 +1083,36 @@ where | |
|
||
fn test_rustc(env: &Env, args: &TestArg) -> Result<(), String> { | ||
test_rustc_inner(env, args, |_| Ok(false), false, "run-make")?; | ||
test_rustc_inner(env, args, |_| Ok(false), false, "run-make-cargo")?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @antoyo @GuillaumeGomez: could you check if these changes look right? |
||
test_rustc_inner(env, args, |_| Ok(false), false, "ui") | ||
} | ||
|
||
fn test_failing_rustc(env: &Env, args: &TestArg) -> Result<(), String> { | ||
let result1 = test_rustc_inner( | ||
let run_make_result = test_rustc_inner( | ||
env, | ||
args, | ||
retain_files_callback("tests/failing-run-make-tests.txt", "run-make"), | ||
false, | ||
"run-make", | ||
); | ||
|
||
let result2 = test_rustc_inner( | ||
let run_make_cargo_result = test_rustc_inner( | ||
env, | ||
args, | ||
retain_files_callback("tests/failing-run-make-tests.txt", "run-make-cargo"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remark: I thought about splitting out |
||
false, | ||
"run-make", | ||
); | ||
|
||
let ui_result = test_rustc_inner( | ||
env, | ||
args, | ||
retain_files_callback("tests/failing-ui-tests.txt", "ui"), | ||
false, | ||
"ui", | ||
); | ||
|
||
result1.and(result2) | ||
run_make_result.and(run_make_cargo_result).and(ui_result) | ||
} | ||
|
||
fn test_successful_rustc(env: &Env, args: &TestArg) -> Result<(), String> { | ||
|
@@ -1120,6 +1129,13 @@ fn test_successful_rustc(env: &Env, args: &TestArg) -> Result<(), String> { | |
remove_files_callback("tests/failing-run-make-tests.txt", "run-make"), | ||
false, | ||
"run-make", | ||
)?; | ||
test_rustc_inner( | ||
env, | ||
args, | ||
remove_files_callback("tests/failing-run-make-tests.txt", "run-make-cargo"), | ||
false, | ||
"run-make-cargo", | ||
) | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1522,6 +1522,12 @@ test!(Pretty { | |
}); | ||
|
||
test!(RunMake { path: "tests/run-make", mode: "run-make", suite: "run-make", default: true }); | ||
test!(RunMakeCargo { | ||
path: "tests/run-make-cargo", | ||
mode: "run-make", | ||
suite: "run-make-cargo", | ||
default: true | ||
}); | ||
|
||
test!(AssemblyLlvm { | ||
path: "tests/assembly-llvm", | ||
|
@@ -1773,7 +1779,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the | |
target, | ||
}); | ||
} | ||
if suite == "run-make" { | ||
if mode == "run-make" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remark: I almost missed this until I noticed that the snapshot tests for |
||
builder.tool_exe(Tool::RunMakeSupport); | ||
} | ||
|
||
|
@@ -1816,25 +1822,41 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the | |
|
||
let is_rustdoc = suite == "rustdoc-ui" || suite == "rustdoc-js"; | ||
|
||
// There are (potentially) 2 `cargo`s to consider: | ||
// | ||
// - A "bootstrap" cargo, which is the same cargo used to build bootstrap itself, and is | ||
// used to build the `run-make` test recipes and the `run-make-support` test library. All | ||
// of these may not use unstable rustc/cargo features. | ||
// - An in-tree cargo, which should be considered as under test. The `run-make-cargo` test | ||
// suite is intended to support the use case of testing the "toolchain" (that is, at the | ||
// minimum the interaction between in-tree cargo + rustc) together. | ||
// | ||
// For build time and iteration purposes, we partition `run-make` tests which needs an | ||
// in-tree cargo (a smaller subset) versus `run-make` tests that do not into two test | ||
// suites, `run-make` and `run-make-cargo`. That way, contributors who do not need to run | ||
// the `run-make` tests that need in-tree cargo do not need to spend time building in-tree | ||
// cargo. | ||
if mode == "run-make" { | ||
let cargo_path = if test_compiler.stage == 0 { | ||
// If we're using `--stage 0`, we should provide the bootstrap cargo. | ||
builder.initial_cargo.clone() | ||
} else { | ||
builder | ||
.ensure(tool::Cargo::from_build_compiler( | ||
builder.compiler(test_compiler.stage - 1, test_compiler.host), | ||
test_compiler.host, | ||
)) | ||
.tool_path | ||
}; | ||
|
||
cmd.arg("--cargo-path").arg(cargo_path); | ||
|
||
// We need to pass the compiler that was used to compile run-make-support, | ||
// because we have to use the same compiler to compile rmake.rs recipes. | ||
let stage0_rustc_path = builder.compiler(0, test_compiler.host); | ||
cmd.arg("--stage0-rustc-path").arg(builder.rustc(stage0_rustc_path)); | ||
|
||
if suite == "run-make-cargo" { | ||
let cargo_path = if test_compiler.stage == 0 { | ||
// If we're using `--stage 0`, we should provide the bootstrap cargo. | ||
builder.initial_cargo.clone() | ||
} else { | ||
builder | ||
.ensure(tool::Cargo::from_build_compiler( | ||
builder.compiler(test_compiler.stage - 1, test_compiler.host), | ||
test_compiler.host, | ||
)) | ||
.tool_path | ||
}; | ||
|
||
cmd.arg("--cargo-path").arg(cargo_path); | ||
} | ||
} | ||
|
||
// Avoid depending on rustdoc when we don't need it. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -444,6 +444,7 @@ const PATH_REMAP: &[(&str, &[&str])] = &[ | |
"tests/mir-opt", | ||
"tests/pretty", | ||
"tests/run-make", | ||
"tests/run-make-cargo", | ||
"tests/rustdoc", | ||
"tests/rustdoc-gui", | ||
"tests/rustdoc-js", | ||
|
@@ -1127,8 +1128,8 @@ impl<'a> Builder<'a> { | |
test::RustInstaller, | ||
test::TestFloatParse, | ||
test::CollectLicenseMetadata, | ||
// Run run-make last, since these won't pass without make on Windows | ||
test::RunMake, | ||
test::RunMakeCargo, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remark: |
||
), | ||
Kind::Miri => describe!(test::Crate), | ||
Kind::Bench => describe!(test::Crate, test::CrateLibrustc), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,9 +60,10 @@ RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/v19.0 | |
tar -xJ | ||
ENV PATH "$PATH:/wasmtime-v19.0.0-x86_64-linux" | ||
|
||
ENV WASM_WASIP_TARGET=wasm32-wasip1 | ||
ENV WASM_WASIP_TARGET=wasm32-wasip1 | ||
ENV WASM_WASIP_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_WASIP_TARGET \ | ||
tests/run-make \ | ||
tests/run-make-cargo \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remark: these CI changes should not cause CI time to regress, because we should be doing approximately the same amount of work as before (i.e. still building in-tree |
||
tests/ui \ | ||
tests/mir-opt \ | ||
tests/codegen-units \ | ||
|
@@ -73,6 +74,7 @@ ENV WASM_WASIP_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $ | |
ENV NVPTX_TARGETS=nvptx64-nvidia-cuda | ||
ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $NVPTX_TARGETS \ | ||
tests/run-make \ | ||
tests/run-make-cargo \ | ||
tests/assembly-llvm | ||
|
||
ENV MUSL_TARGETS=x86_64-unknown-linux-musl \ | ||
|
@@ -88,8 +90,8 @@ ENV UEFI_TARGETS=aarch64-unknown-uefi,i686-unknown-uefi,x86_64-unknown-uefi \ | |
CC_x86_64_unknown_uefi=clang-11 \ | ||
CXX_x86_64_unknown_uefi=clang++-11 | ||
ENV UEFI_SCRIPT python3 /checkout/x.py --stage 2 build --host='' --target $UEFI_TARGETS && \ | ||
python3 /checkout/x.py --stage 2 test tests/run-make/uefi-qemu/rmake.rs --target aarch64-unknown-uefi && \ | ||
python3 /checkout/x.py --stage 2 test tests/run-make/uefi-qemu/rmake.rs --target i686-unknown-uefi && \ | ||
python3 /checkout/x.py --stage 2 test tests/run-make/uefi-qemu/rmake.rs --target x86_64-unknown-uefi | ||
python3 /checkout/x.py --stage 2 test tests/run-make-cargo/uefi-qemu/rmake.rs --target aarch64-unknown-uefi && \ | ||
python3 /checkout/x.py --stage 2 test tests/run-make-cargo/uefi-qemu/rmake.rs --target i686-unknown-uefi && \ | ||
python3 /checkout/x.py --stage 2 test tests/run-make-cargo/uefi-qemu/rmake.rs --target x86_64-unknown-uefi | ||
|
||
ENV SCRIPT $WASM_WASIP_SCRIPT && $NVPTX_SCRIPT && $MUSL_SCRIPT && $UEFI_SCRIPT |
Uh oh!
There was an error while loading. Please reload this page.