Skip to content

Commit 76381aa

Browse files
committed
Add test verifying behavior of links_overrides with target-applies-to-host and an implicit target
1 parent a2b58c3 commit 76381aa

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/testsuite/build_script.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5777,3 +5777,41 @@ hello
57775777
"#]])
57785778
.run();
57795779
}
5780+
5781+
#[cargo_test]
5782+
fn links_overrides_with_target_applies_to_host() {
5783+
let p = project()
5784+
.file(
5785+
"Cargo.toml",
5786+
r#"
5787+
[package]
5788+
name = "mylib-sys"
5789+
edition = "2021"
5790+
version = "0.0.1"
5791+
authors = []
5792+
links = "mylib"
5793+
"#,
5794+
)
5795+
.file("src/lib.rs", "")
5796+
.file("build.rs", "bad file")
5797+
.build();
5798+
5799+
p.cargo("build -v")
5800+
.masquerade_as_nightly_cargo(&["target-applies-to-host"])
5801+
.args(&[
5802+
"-Ztarget-applies-to-host",
5803+
"--config",
5804+
"target-applies-to-host=false",
5805+
])
5806+
.args(&[
5807+
"--config",
5808+
&format!(r#"target.{}.mylib.rustc-link-search=["foo"]"#, rustc_host()),
5809+
])
5810+
.with_status(101)
5811+
.with_stderr_data(
5812+
"thread 'main' panicked at src/cargo/core/compiler/custom_build.rs:256:10:
5813+
running a script not depending on an actual script
5814+
...",
5815+
)
5816+
.run();
5817+
}

0 commit comments

Comments
 (0)