From 1584d1eda9d2fb3b70865d76f27ceb1a5686f2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 6 Jun 2024 18:35:46 +0200 Subject: [PATCH] Do not use relative paths to Rust source root in run-make tests --- src/tools/run-make-support/src/lib.rs | 1 + tests/run-make/alloc-no-oom-handling/rmake.rs | 4 ++-- tests/run-make/alloc-no-rc/rmake.rs | 4 ++-- tests/run-make/alloc-no-sync/rmake.rs | 4 ++-- tests/run-make/core-no-fp-fmt-parse/rmake.rs | 4 ++-- tests/run-make/core-no-oom-handling/rmake.rs | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs index d4b2f88fecfc9..ec84ab3fbbd74 100644 --- a/src/tools/run-make-support/src/lib.rs +++ b/src/tools/run-make-support/src/lib.rs @@ -87,6 +87,7 @@ pub fn htmldocck() -> Command { python } +/// Path to the root rust-lang/rust source checkout. pub fn source_path() -> PathBuf { env_var("S").into() } diff --git a/tests/run-make/alloc-no-oom-handling/rmake.rs b/tests/run-make/alloc-no-oom-handling/rmake.rs index 4bca5d1f1efbe..293115f5b988d 100644 --- a/tests/run-make/alloc-no-oom-handling/rmake.rs +++ b/tests/run-make/alloc-no-oom-handling/rmake.rs @@ -2,14 +2,14 @@ // when the unstable no_global_oom_handling feature is turned on. // See https://github.com/rust-lang/rust/pull/84266 -use run_make_support::rustc; +use run_make_support::{rustc, source_path}; fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") - .input("../../../library/alloc/src/lib.rs") + .input(source_path().join("library/alloc/src/lib.rs")) .cfg("no_global_oom_handling") .run(); } diff --git a/tests/run-make/alloc-no-rc/rmake.rs b/tests/run-make/alloc-no-rc/rmake.rs index 8ff73324b0832..e43378e54879a 100644 --- a/tests/run-make/alloc-no-rc/rmake.rs +++ b/tests/run-make/alloc-no-rc/rmake.rs @@ -2,14 +2,14 @@ // when the unstable no_rc feature is turned on. // See https://github.com/rust-lang/rust/pull/84266 -use run_make_support::rustc; +use run_make_support::{rustc, source_path}; fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") - .input("../../../library/alloc/src/lib.rs") + .input(source_path().join("library/alloc/src/lib.rs")) .cfg("no_rc") .run(); } diff --git a/tests/run-make/alloc-no-sync/rmake.rs b/tests/run-make/alloc-no-sync/rmake.rs index 3a3ceed686792..21ca8ed0bf8f6 100644 --- a/tests/run-make/alloc-no-sync/rmake.rs +++ b/tests/run-make/alloc-no-sync/rmake.rs @@ -2,14 +2,14 @@ // when the unstable no_sync feature is turned on. // See https://github.com/rust-lang/rust/pull/84266 -use run_make_support::rustc; +use run_make_support::{rustc, source_path}; fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") - .input("../../../library/alloc/src/lib.rs") + .input(source_path().join("library/alloc/src/lib.rs")) .cfg("no_sync") .run(); } diff --git a/tests/run-make/core-no-fp-fmt-parse/rmake.rs b/tests/run-make/core-no-fp-fmt-parse/rmake.rs index aef28fd252812..6a5821a66337a 100644 --- a/tests/run-make/core-no-fp-fmt-parse/rmake.rs +++ b/tests/run-make/core-no-fp-fmt-parse/rmake.rs @@ -1,14 +1,14 @@ // This test checks that the core library of Rust can be compiled without enabling // support for formatting and parsing floating-point numbers. -use run_make_support::rustc; +use run_make_support::{rustc, source_path}; fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") - .input("../../../library/core/src/lib.rs") + .input(source_path().join("library/core/src/lib.rs")) .cfg("no_fp_fmt_parse") .run(); } diff --git a/tests/run-make/core-no-oom-handling/rmake.rs b/tests/run-make/core-no-oom-handling/rmake.rs index 75767421cd1fa..c594b3ee8d9ad 100644 --- a/tests/run-make/core-no-oom-handling/rmake.rs +++ b/tests/run-make/core-no-oom-handling/rmake.rs @@ -2,14 +2,14 @@ // when the no_global_oom_handling feature is turned on. // See https://github.com/rust-lang/rust/pull/110649 -use run_make_support::{rustc, tmp_dir}; +use run_make_support::{rustc, tmp_dir, source_path}; fn main() { rustc() .edition("2021") .arg("-Dwarnings") .crate_type("rlib") - .input("../../../library/core/src/lib.rs") + .input(source_path().join("library/core/src/lib.rs")) .sysroot(tmp_dir().join("fakeroot")) .cfg("no_global_oom_handling") .run();