Skip to content

Commit

Permalink
Fix how paths are printed by error messages during bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleywiser authored and Mark-Simulacrum committed Feb 24, 2018
1 parent 6070d3e commit 63843d8
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 44 deletions.
File renamed without changes.
78 changes: 39 additions & 39 deletions src/Cargo.toml → Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
[workspace]
members = [
"bootstrap",
"rustc",
"libstd",
"libtest",
"librustc_trans",
"tools/cargotest",
"tools/clippy",
"tools/compiletest",
"tools/error_index_generator",
"tools/linkchecker",
"tools/rustbook",
"tools/unstable-book-gen",
"tools/tidy",
"tools/build-manifest",
"tools/remote-test-client",
"tools/remote-test-server",
"tools/rust-installer",
"tools/cargo",
"tools/rustdoc",
"tools/rls",
"tools/rustfmt",
"tools/miri",
"tools/rustdoc-themes",
"src/bootstrap",
"src/rustc",
"src/libstd",
"src/libtest",
"src/librustc_trans",
"src/tools/cargotest",
"src/tools/clippy",
"src/tools/compiletest",
"src/tools/error_index_generator",
"src/tools/linkchecker",
"src/tools/rustbook",
"src/tools/unstable-book-gen",
"src/tools/tidy",
"src/tools/build-manifest",
"src/tools/remote-test-client",
"src/tools/remote-test-server",
"src/tools/rust-installer",
"src/tools/cargo",
"src/tools/rustdoc",
"src/tools/rls",
"src/tools/rustfmt",
"src/tools/miri",
"src/tools/rustdoc-themes",
# FIXME(https://github.com/rust-lang/cargo/issues/4089): move these to exclude
"tools/rls/test_data/bin_lib",
"tools/rls/test_data/borrow_error",
"tools/rls/test_data/common",
"tools/rls/test_data/deglob",
"tools/rls/test_data/features",
"tools/rls/test_data/find_all_refs_no_cfg_test",
"tools/rls/test_data/find_impls",
"tools/rls/test_data/infer_bin",
"tools/rls/test_data/infer_custom_bin",
"tools/rls/test_data/infer_lib",
"tools/rls/test_data/multiple_bins",
"tools/rls/test_data/reformat",
"tools/rls/test_data/reformat_with_range",
"tools/rls/test_data/workspace_symbol",
"src/tools/rls/test_data/bin_lib",
"src/tools/rls/test_data/borrow_error",
"src/tools/rls/test_data/common",
"src/tools/rls/test_data/deglob",
"src/tools/rls/test_data/features",
"src/tools/rls/test_data/find_all_refs_no_cfg_test",
"src/tools/rls/test_data/find_impls",
"src/tools/rls/test_data/infer_bin",
"src/tools/rls/test_data/infer_custom_bin",
"src/tools/rls/test_data/infer_lib",
"src/tools/rls/test_data/multiple_bins",
"src/tools/rls/test_data/reformat",
"src/tools/rls/test_data/reformat_with_range",
"src/tools/rls/test_data/workspace_symbol",
]

# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit
Expand All @@ -63,12 +63,12 @@ debug-assertions = false
# so we use a `[patch]` here to override the github repository with our local
# vendored copy.
[patch."https://github.com/rust-lang/cargo"]
cargo = { path = "tools/cargo" }
cargo = { path = "src/tools/cargo" }

[patch.crates-io]
# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt`
# that we're shipping as well (to ensure that the rustfmt in RLS and the
# `rustfmt` executable are the same exact vesion). Unlike Cargo, however, the
# RLS depends on `rustfmt` from crates.io, so we put this in a `[patch]` section
# for crates.io
rustfmt-nightly = { path = "tools/rustfmt" }
rustfmt-nightly = { path = "src/tools/rustfmt" }
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def bootstrap():
registry = 'https://example.com'
[source.vendored-sources]
directory = '{}/src/vendor'
directory = '{}/vendor'
""".format(build.rust_root))
else:
if os.path.exists('.cargo'):
Expand Down
6 changes: 4 additions & 2 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ impl Step for Src {
t!(fs::create_dir_all(&dst_src));

let src_files = [
"src/Cargo.lock",
"Cargo.lock",
];
// This is the reduced set of paths which will become the rust-src component
// (essentially libstd and all of its path dependencies)
Expand Down Expand Up @@ -865,6 +865,8 @@ impl Step for PlainSourceTarball {
"configure",
"x.py",
"config.toml.example",
"Cargo.toml",
"Cargo.lock",
];
let src_dirs = [
"src",
Expand Down Expand Up @@ -911,7 +913,7 @@ impl Step for PlainSourceTarball {
// Vendor all Cargo dependencies
let mut cmd = Command::new(&build.initial_cargo);
cmd.arg("vendor")
.current_dir(&plain_dst_src.join("src"));
.current_dir(&plain_dst_src);
build.run(&mut cmd);
}

Expand Down
5 changes: 3 additions & 2 deletions src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ static EXCEPTIONS: &'static [&'static str] = &[
];

pub fn check(path: &Path, bad: &mut bool) {
let path = path.join("vendor");
// the vendor directly will be in project root whereas we're passed the src directory
let path = path.parent().expect("parent exist").join("vendor");
assert!(path.exists(), "vendor directory missing");
let mut saw_dir = false;
'next_path: for dir in t!(path.read_dir()) {
Expand All @@ -57,7 +58,7 @@ pub fn check(path: &Path, bad: &mut bool) {
if dir.path()
.to_str()
.unwrap()
.contains(&format!("src/vendor/{}", exception)) {
.contains(&format!("vendor/{}", exception)) {
continue 'next_path;
}
}
Expand Down

0 comments on commit 63843d8

Please sign in to comment.