Skip to content

Commit

Permalink
Auto merge of #190 - japaric:no-lockfile, r=japaric
Browse files Browse the repository at this point in the history
Revert "use Cargo.lock file from rust-src if present"

None
  • Loading branch information
homunkulus committed Dec 27, 2017
2 parents 71cb96b + 192bbc2 commit 64c7275
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
22 changes: 2 additions & 20 deletions src/sysroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::hash::{Hash, Hasher};
use std::path::PathBuf;
use std::process::Command;
use std::io::{self, Write};
use std::{fs, env};
use std::{env, fs};

use rustc_version::VersionMeta;
use tempdir::TempDir;
Expand Down Expand Up @@ -35,7 +35,6 @@ fn build(
ctoml: &cargo::Toml,
home: &Home,
rustflags: &Rustflags,
src: &Src,
sysroot: &Sysroot,
hash: u64,
verbose: bool,
Expand Down Expand Up @@ -84,13 +83,6 @@ version = "0.0.0"
stoml.push_str(&profile.to_string())
}

{
// Recent rust-src comes with a lockfile for libstd. Use it.
let lockfile = src.path().join("Cargo.lock");
if lockfile.exists() {
fs::copy(lockfile, &td.join("Cargo.lock")).chain_err(|| "couldn't copy lock file")?;
}
}
util::write(&td.join("Cargo.toml"), &stoml)?;
util::mkdir(&td.join("src"))?;
util::write(&td.join("src/lib.rs"), "")?;
Expand Down Expand Up @@ -226,17 +218,7 @@ pub fn update(
let hash = hash(cmode, &blueprint, rustflags, &ctoml, meta)?;

if old_hash(cmode, home)? != Some(hash) {
build(
cmode,
blueprint,
&ctoml,
home,
rustflags,
src,
sysroot,
hash,
verbose,
)?;
build(cmode, blueprint, &ctoml, home, rustflags, sysroot, hash, verbose)?;
}

// copy host artifacts into the sysroot, if necessary
Expand Down
12 changes: 4 additions & 8 deletions tests/smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,22 +752,18 @@ fn host_twice() {
}

/// Check multi stage sysroot builds with `xargo test`
// We avoid Windows here just because it would be tricky to modify the rust-src
// component (cf. #36501) from within the appveyor environment
#[cfg(feature = "dev")]
#[cfg(not(windows))]
#[ignore]
#[test]
fn test() {
fn stage() {
fn run() -> Result<()> {
let project = HProject::new(true)?;

project.xargo_toml(
"
[dependencies.std]
features = [\"panic_unwind\"]
[dependencies.core]
stage = 0
[dependencies.test]
[dependencies.compiler_builtins]
stage = 1
",
)?;
Expand Down

0 comments on commit 64c7275

Please sign in to comment.