Skip to content

Do not use relative paths to Rust source root in run-make tests #126081

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

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all 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: 3 additions & 2 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ pub fn python_command() -> Command {

pub fn htmldocck() -> Command {
let mut python = python_command();
python.arg(source_path().join("src/etc/htmldocck.py"));
python.arg(source_root().join("src/etc/htmldocck.py"));
python
}

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

Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/alloc-no-oom-handling/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_root};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_root().join("library/alloc/src/lib.rs"))
.cfg("no_global_oom_handling")
.run();
}
4 changes: 2 additions & 2 deletions tests/run-make/alloc-no-rc/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_root};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_root().join("library/alloc/src/lib.rs"))
.cfg("no_rc")
.run();
}
4 changes: 2 additions & 2 deletions tests/run-make/alloc-no-sync/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_root};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/alloc/src/lib.rs")
.input(source_root().join("library/alloc/src/lib.rs"))
.cfg("no_sync")
.run();
}
4 changes: 2 additions & 2 deletions tests/run-make/core-no-fp-fmt-parse/rmake.rs
Original file line number Diff line number Diff line change
@@ -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_root};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/core/src/lib.rs")
.input(source_root().join("library/core/src/lib.rs"))
.cfg("no_fp_fmt_parse")
.run();
}
4 changes: 2 additions & 2 deletions tests/run-make/core-no-oom-handling/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, source_root, tmp_dir};

fn main() {
rustc()
.edition("2021")
.arg("-Dwarnings")
.crate_type("rlib")
.input("../../../library/core/src/lib.rs")
.input(source_root().join("library/core/src/lib.rs"))
.sysroot(tmp_dir().join("fakeroot"))
.cfg("no_global_oom_handling")
.run();
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use run_make_support::{htmldocck, rustc, rustdoc, source_path, tmp_dir};
use run_make_support::{htmldocck, rustc, rustdoc, source_root, tmp_dir};
use std::fs::read_dir;
use std::path::Path;

Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/rustdoc-themes/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Test that rustdoc will properly load in a theme file and display it in the theme selector.

use run_make_support::{htmldocck, rustdoc, source_path, tmp_dir};
use run_make_support::{htmldocck, rustdoc, source_root, tmp_dir};

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

let no_script =
std::fs::read_to_string(source_path().join("src/librustdoc/html/static/css/noscript.css"))
std::fs::read_to_string(source_root().join("src/librustdoc/html/static/css/noscript.css"))
.unwrap();

let mut test_content = String::new();
Expand Down
Loading