Skip to content

Commit 97da297

Browse files
authored
Unrolled build for rust-lang#126081
Rollup merge of rust-lang#126081 - Kobzol:run-make-relative-paths, r=jieyouxu Do not use relative paths to Rust source root in run-make tests Pre-requisite for rust-lang#126080. Fixes: rust-lang#126071 r? `@jieyouxu`
2 parents 98489f2 + 6e1121b commit 97da297

File tree

8 files changed

+16
-15
lines changed

8 files changed

+16
-15
lines changed

src/tools/run-make-support/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ pub fn python_command() -> Command {
8383

8484
pub fn htmldocck() -> Command {
8585
let mut python = python_command();
86-
python.arg(source_path().join("src/etc/htmldocck.py"));
86+
python.arg(source_root().join("src/etc/htmldocck.py"));
8787
python
8888
}
8989

90-
pub fn source_path() -> PathBuf {
90+
/// Path to the root rust-lang/rust source checkout.
91+
pub fn source_root() -> PathBuf {
9192
env_var("S").into()
9293
}
9394

tests/run-make/alloc-no-oom-handling/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// when the unstable no_global_oom_handling feature is turned on.
33
// See https://github.com/rust-lang/rust/pull/84266
44

5-
use run_make_support::rustc;
5+
use run_make_support::{rustc, source_root};
66

77
fn main() {
88
rustc()
99
.edition("2021")
1010
.arg("-Dwarnings")
1111
.crate_type("rlib")
12-
.input("../../../library/alloc/src/lib.rs")
12+
.input(source_root().join("library/alloc/src/lib.rs"))
1313
.cfg("no_global_oom_handling")
1414
.run();
1515
}

tests/run-make/alloc-no-rc/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// when the unstable no_rc feature is turned on.
33
// See https://github.com/rust-lang/rust/pull/84266
44

5-
use run_make_support::rustc;
5+
use run_make_support::{rustc, source_root};
66

77
fn main() {
88
rustc()
99
.edition("2021")
1010
.arg("-Dwarnings")
1111
.crate_type("rlib")
12-
.input("../../../library/alloc/src/lib.rs")
12+
.input(source_root().join("library/alloc/src/lib.rs"))
1313
.cfg("no_rc")
1414
.run();
1515
}

tests/run-make/alloc-no-sync/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// when the unstable no_sync feature is turned on.
33
// See https://github.com/rust-lang/rust/pull/84266
44

5-
use run_make_support::rustc;
5+
use run_make_support::{rustc, source_root};
66

77
fn main() {
88
rustc()
99
.edition("2021")
1010
.arg("-Dwarnings")
1111
.crate_type("rlib")
12-
.input("../../../library/alloc/src/lib.rs")
12+
.input(source_root().join("library/alloc/src/lib.rs"))
1313
.cfg("no_sync")
1414
.run();
1515
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// This test checks that the core library of Rust can be compiled without enabling
22
// support for formatting and parsing floating-point numbers.
33

4-
use run_make_support::rustc;
4+
use run_make_support::{rustc, source_root};
55

66
fn main() {
77
rustc()
88
.edition("2021")
99
.arg("-Dwarnings")
1010
.crate_type("rlib")
11-
.input("../../../library/core/src/lib.rs")
11+
.input(source_root().join("library/core/src/lib.rs"))
1212
.cfg("no_fp_fmt_parse")
1313
.run();
1414
}

tests/run-make/core-no-oom-handling/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// when the no_global_oom_handling feature is turned on.
33
// See https://github.com/rust-lang/rust/pull/110649
44

5-
use run_make_support::{rustc, tmp_dir};
5+
use run_make_support::{rustc, source_root, tmp_dir};
66

77
fn main() {
88
rustc()
99
.edition("2021")
1010
.arg("-Dwarnings")
1111
.crate_type("rlib")
12-
.input("../../../library/core/src/lib.rs")
12+
.input(source_root().join("library/core/src/lib.rs"))
1313
.sysroot(tmp_dir().join("fakeroot"))
1414
.cfg("no_global_oom_handling")
1515
.run();

tests/run-make/rustdoc-scrape-examples-remap/scrape.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use run_make_support::{htmldocck, rustc, rustdoc, source_path, tmp_dir};
1+
use run_make_support::{htmldocck, rustc, rustdoc, source_root, tmp_dir};
22
use std::fs::read_dir;
33
use std::path::Path;
44

tests/run-make/rustdoc-themes/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Test that rustdoc will properly load in a theme file and display it in the theme selector.
22

3-
use run_make_support::{htmldocck, rustdoc, source_path, tmp_dir};
3+
use run_make_support::{htmldocck, rustdoc, source_root, tmp_dir};
44

55
fn main() {
66
let out_dir = tmp_dir().join("rustdoc-themes");
77
let test_css = out_dir.join("test.css");
88

99
let no_script =
10-
std::fs::read_to_string(source_path().join("src/librustdoc/html/static/css/noscript.css"))
10+
std::fs::read_to_string(source_root().join("src/librustdoc/html/static/css/noscript.css"))
1111
.unwrap();
1212

1313
let mut test_content = String::new();

0 commit comments

Comments
 (0)