diff options
| author | bors <bors@rust-lang.org> | 2025-01-23 01:03:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-23 01:03:32 +0000 |
| commit | 3cd8fcbf87bd28a1f31be000ca906fb66f4d451d (patch) | |
| tree | 80686070e5783cfda5a586eee1fe2ebb3104e220 /src | |
| parent | a30f9151fe4a841c4643af4e47ad18a23e1fb044 (diff) | |
| parent | 5482bbac0f18d45f0e02bbe8153e47b160287fff (diff) | |
| download | rust-3cd8fcbf87bd28a1f31be000ca906fb66f4d451d.tar.gz rust-3cd8fcbf87bd28a1f31be000ca906fb66f4d451d.zip | |
Auto merge of #135164 - Kobzol:run-make-test-glibc-symbols, r=jieyouxu
Add test for checking used glibc symbols This test checks that we do not use too new glibc symbols in the compiler on x64 GNU Linux, in order not to break our [glibc promises](https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html). One thing that isn't solved in the PR yet is to make sure that this test will only run on `dist` CI, more specifically on the `dist-x86_64-linux` runner, in the opt-dist post-optimization tests (it can fail elsewhere, that doesn't matter). Any suggestions on how to do that are welcome. Fixes: https://github.com/rust-lang/rust/issues/134037 r? `@jieyouxu`
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/tests/directives.md | 2 | ||||
| -rw-r--r-- | src/tools/compiletest/src/directive-list.rs | 1 | ||||
| -rw-r--r-- | src/tools/compiletest/src/header/cfg.rs | 6 | ||||
| -rw-r--r-- | src/tools/opt-dist/src/tests.rs | 9 |
4 files changed, 17 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/src/tests/directives.md b/src/doc/rustc-dev-guide/src/tests/directives.md index e80857b7afa..426a6ff1da5 100644 --- a/src/doc/rustc-dev-guide/src/tests/directives.md +++ b/src/doc/rustc-dev-guide/src/tests/directives.md @@ -152,6 +152,8 @@ Some examples of `X` in `ignore-X` or `only-X`: `compare-mode-split-dwarf`, `compare-mode-split-dwarf-single` - The two different test modes used by coverage tests: `ignore-coverage-map`, `ignore-coverage-run` +- When testing a dist toolchain: `dist` + - This needs to be enabled with `COMPILETEST_ENABLE_DIST_TESTS=1` The following directives will check rustc build settings and target settings: diff --git a/src/tools/compiletest/src/directive-list.rs b/src/tools/compiletest/src/directive-list.rs index 01068af3e8c..5784cd83119 100644 --- a/src/tools/compiletest/src/directive-list.rs +++ b/src/tools/compiletest/src/directive-list.rs @@ -175,6 +175,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "only-beta", "only-bpf", "only-cdb", + "only-dist", "only-gnu", "only-i686-pc-windows-gnu", "only-i686-pc-windows-msvc", diff --git a/src/tools/compiletest/src/header/cfg.rs b/src/tools/compiletest/src/header/cfg.rs index 3f7225195ce..6e5ced17c20 100644 --- a/src/tools/compiletest/src/header/cfg.rs +++ b/src/tools/compiletest/src/header/cfg.rs @@ -235,6 +235,12 @@ fn parse_cfg_name_directive<'a>( message: "when the test mode is {name}", } + condition! { + name: "dist", + condition: std::env::var("COMPILETEST_ENABLE_DIST_TESTS") == Ok("1".to_string()), + message: "when performing tests on dist toolchain" + } + if prefix == "ignore" && outcome == MatchOutcome::Invalid { // Don't error out for ignore-tidy-* diretives, as those are not handled by compiletest. if name.starts_with("tidy-") { diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs index 06ed076a864..8b3bd77141b 100644 --- a/src/tools/opt-dist/src/tests.rs +++ b/src/tools/opt-dist/src/tests.rs @@ -69,6 +69,7 @@ change-id = 115898 [rust] channel = "{channel}" +verbose-tests = true [build] rustc = "{rustc}" @@ -102,13 +103,19 @@ llvm-config = "{llvm_config}" "tests/incremental", "tests/mir-opt", "tests/pretty", + "tests/run-make/glibc-symbols-x86_64-unknown-linux-gnu", "tests/ui", "tests/crashes", ]; for test_path in env.skipped_tests() { args.extend(["--skip", test_path]); } - cmd(&args).env("COMPILETEST_FORCE_STAGE0", "1").run().context("Cannot execute tests") + cmd(&args) + .env("COMPILETEST_FORCE_STAGE0", "1") + // Also run dist-only tests + .env("COMPILETEST_ENABLE_DIST_TESTS", "1") + .run() + .context("Cannot execute tests") } /// Tries to find the version of the dist artifacts (either nightly, beta, or 1.XY.Z). |
