Skip to content

Commit

Permalink
Merge #276
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bors[bot] and RalfJung authored Mar 25, 2020
2 parents efa6d8f + afed8fc commit 914f9b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/sysroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ version = "0.0.0"
let dst = rustlib.parent().join("lib");
util::mkdir(&dst)?;

if cmode.triple().contains("pc-windows-gnu") {
if cmode.triple().contains("pc-windows-gnu") && cargo_mode == XargoMode::Build {
let src = &sysroot
.path()
.join("lib")
Expand Down
13 changes: 9 additions & 4 deletions tests/smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,13 @@ impl HProject {
}

/// Runs `xargo-check` with the specified subcommand
fn xargo_check_subcommand(&self, subcommand: Option<&str>) -> Result<String> {
fn xargo_check_subcommand(&self, subcommand: Option<&str>, target: Option<&str>) -> Result<String> {
let mut cmd = xargo_check()?;
if let Some(subcommand) = subcommand {
cmd.args(&[subcommand]);
cmd.arg(subcommand);
}
if let Some(target) = target {
cmd.args(&["--target", target]);
}
cmd
.current_dir(self.td.path())
Expand Down Expand Up @@ -914,7 +917,7 @@ tag = "1.0.25"
fn cargo_check_check() {
fn run() -> Result<()> {
let project = HProject::new(false)?;
project.xargo_check_subcommand(Some("check"))?;
project.xargo_check_subcommand(Some("check"), None)?;

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

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

Ok(())
Expand Down

0 comments on commit 914f9b7

Please sign in to comment.