Skip to content

Commit 68552a3

Browse files
committed
Remove sysroot-abi feature flag from proc-macro-test
1 parent 5871b61 commit 68552a3

File tree

5 files changed

+15
-23
lines changed

5 files changed

+15
-23
lines changed

crates/proc-macro-srv/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ expect-test = "1.4.0"
3737
proc-macro-test.path = "./proc-macro-test"
3838

3939
[features]
40-
sysroot-abi = ["proc-macro-test/sysroot-abi"]
40+
sysroot-abi = []
4141
in-rust-tree = ["mbe/in-rust-tree", "sysroot-abi"]
4242

4343
[lints]

crates/proc-macro-srv/proc-macro-test/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ cargo_metadata = "0.18.1"
1414

1515
# local deps
1616
toolchain.workspace = true
17-
18-
[features]
19-
sysroot-abi = []

crates/proc-macro-srv/proc-macro-test/build.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,23 @@ use cargo_metadata::Message;
1717

1818
fn main() {
1919
println!("cargo:rerun-if-changed=imp");
20-
println!("cargo:rerun-if-env-changed=PROC_MACRO_TEST_TOOLCHAIN");
20+
21+
let is_nightly = String::from_utf8(
22+
Command::new(toolchain::cargo()).arg("--version").output().unwrap().stdout,
23+
)
24+
.unwrap()
25+
.contains("nightly");
2126

2227
let out_dir = env::var_os("OUT_DIR").unwrap();
2328
let out_dir = Path::new(&out_dir);
2429

30+
if !is_nightly {
31+
println!("proc-macro-test testing only works on nightly");
32+
let info_path = out_dir.join("proc_macro_test_location.txt");
33+
fs::File::create(info_path).unwrap();
34+
return;
35+
}
36+
2537
let name = "proc-macro-test-impl";
2638
let version = "0.0.0";
2739

@@ -53,15 +65,7 @@ fn main() {
5365

5466
let target_dir = out_dir.join("target");
5567

56-
let mut cmd = if let Ok(toolchain) = std::env::var("PROC_MACRO_TEST_TOOLCHAIN") {
57-
// leverage rustup to find user-specific toolchain
58-
let mut cmd = Command::new("cargo");
59-
cmd.arg(format!("+{toolchain}"));
60-
cmd
61-
} else {
62-
Command::new(toolchain::cargo())
63-
};
64-
68+
let mut cmd = Command::new(toolchain::cargo());
6569
cmd.current_dir(&staging_dir)
6670
.args(["build", "-p", "proc-macro-test-impl", "--message-format", "json"])
6771
// Explicit override the target directory to avoid using the same one which the parent
@@ -70,9 +74,6 @@ fn main() {
7074
// instance to use the same target directory.
7175
.arg("--target-dir")
7276
.arg(&target_dir);
73-
if cfg!(feature = "sysroot-abi") {
74-
cmd.args(["--features", "sysroot-abi"]);
75-
}
7677

7778
if let Ok(target) = std::env::var("TARGET") {
7879
cmd.args(["--target", &target]);

crates/proc-macro-srv/proc-macro-test/imp/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@ proc-macro = true
1313
# this crate should not have any dependencies, since it uses its own workspace,
1414
# and its own `Cargo.lock`
1515

16-
[features]
17-
sysroot-abi = []
18-
1916
[workspace]

crates/proc-macro-srv/proc-macro-test/imp/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
//! Exports a few trivial procedural macros for testing.
22
3-
#![allow(unexpected_cfgs)]
4-
#![cfg(feature = "sysroot-abi")]
5-
#![cfg(any(feature = "sysroot-abi", rust_analyzer))]
63
#![warn(rust_2018_idioms, unused_lifetimes)]
74
#![feature(proc_macro_span, proc_macro_def_site)]
85

0 commit comments

Comments
 (0)