Skip to content

Commit 914f9b7

Browse files
bors[bot]RalfJung
andauthored
Merge #276
276: skip copy of windows-gnu libs in check-only mode r=RalfJung a=RalfJung Unfortunately we cannot test `--target x86_64-pc-windows-gnu` until rust-lang/backtrace-rs#297 lands and propagates. But I confirmed locally that using both together makes that target work on my Linux box. Co-authored-by: Ralf Jung <[email protected]>
2 parents efa6d8f + afed8fc commit 914f9b7

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/sysroot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ version = "0.0.0"
5555
let dst = rustlib.parent().join("lib");
5656
util::mkdir(&dst)?;
5757

58-
if cmode.triple().contains("pc-windows-gnu") {
58+
if cmode.triple().contains("pc-windows-gnu") && cargo_mode == XargoMode::Build {
5959
let src = &sysroot
6060
.path()
6161
.join("lib")

tests/smoke.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,13 @@ impl HProject {
347347
}
348348

349349
/// Runs `xargo-check` with the specified subcommand
350-
fn xargo_check_subcommand(&self, subcommand: Option<&str>) -> Result<String> {
350+
fn xargo_check_subcommand(&self, subcommand: Option<&str>, target: Option<&str>) -> Result<String> {
351351
let mut cmd = xargo_check()?;
352352
if let Some(subcommand) = subcommand {
353-
cmd.args(&[subcommand]);
353+
cmd.arg(subcommand);
354+
}
355+
if let Some(target) = target {
356+
cmd.args(&["--target", target]);
354357
}
355358
cmd
356359
.current_dir(self.td.path())
@@ -914,7 +917,7 @@ tag = "1.0.25"
914917
fn cargo_check_check() {
915918
fn run() -> Result<()> {
916919
let project = HProject::new(false)?;
917-
project.xargo_check_subcommand(Some("check"))?;
920+
project.xargo_check_subcommand(Some("check"), None)?;
918921

919922
Ok(())
920923
}
@@ -931,7 +934,9 @@ fn cargo_check_check_no_ctoml() {
931934
std::fs::remove_file(project.td.path().join("Cargo.toml"))
932935
.chain_err(|| format!("Could not remove Cargo.toml"))?;
933936

934-
let stderr = project.xargo_check_subcommand(None)?;
937+
// windows-gnu specifically needs some extra files to be copied for full builds;
938+
// make sure check-builds work without those files.
939+
let stderr = project.xargo_check_subcommand(None, Some("i686-pc-windows-gnu"))?;
935940
assert!(stderr.contains("Checking core"));
936941

937942
Ok(())

0 commit comments

Comments
 (0)