Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update some minor dependencies #44785

Merged
merged 7 commits into from
Sep 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
441 changes: 231 additions & 210 deletions src/Cargo.lock

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ members = [
"tools/rls/test_data/infer_custom_bin",
"tools/rls/test_data/infer_lib",
"tools/rls/test_data/omit_init_build",
"tools/rls/test_data/unicødë",
"tools/rls/test_data/workspace_symbol",
]

# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit
Expand All @@ -60,10 +62,5 @@ debug-assertions = false
[patch."https://github.com/rust-lang/cargo"]
cargo = { path = "tools/cargo" }

# Override rustfmt dependencies both on the repo and the crate (the RLS
# sometimes uses either).
# FIXME should only need the crates.io patch, long term.
[patch."https://github.com/rust-lang-nursery/rustfmt"]
rustfmt-nightly = { path = "tools/rustfmt" }
[patch.crates-io]
rustfmt-nightly = { path = "tools/rustfmt" }
2 changes: 1 addition & 1 deletion src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cmake = "0.1.23"
filetime = "0.1"
num_cpus = "1.0"
getopts = "0.2"
gcc = "0.3.54"
cc = "1.0"
libc = "0.2"
serde = "1.0.8"
serde_derive = "1.0.8"
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/bin/sccache-plus-cl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

extern crate gcc;
extern crate cc;

use std::env;
use std::process::{self, Command};
Expand All @@ -18,7 +18,7 @@ fn main() {
// Locate the actual compiler that we're invoking
env::remove_var("CC");
env::remove_var("CXX");
let mut cfg = gcc::Build::new();
let mut cfg = cc::Build::new();
cfg.cargo_metadata(false)
.out_dir("/")
.target(&target)
Expand Down
10 changes: 5 additions & 5 deletions src/bootstrap/cc.rs → src/bootstrap/cc_detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! 6. "cc"
//!
//! Some of this logic is implemented here, but much of it is farmed out to the
//! `gcc` crate itself, so we end up having the same fallbacks as there.
//! `cc` crate itself, so we end up having the same fallbacks as there.
//! Similar logic is then used to find a C++ compiler, just some s/cc/c++/ is
//! used.
//!
Expand All @@ -35,7 +35,7 @@ use std::process::Command;
use std::iter;

use build_helper::{cc2ar, output};
use gcc;
use cc;

use Build;
use config::Target;
Expand All @@ -45,7 +45,7 @@ pub fn find(build: &mut Build) {
// For all targets we're going to need a C compiler for building some shims
// and such as well as for being a linker for Rust code.
for target in build.targets.iter().chain(&build.hosts).cloned().chain(iter::once(build.build)) {
let mut cfg = gcc::Build::new();
let mut cfg = cc::Build::new();
cfg.cargo_metadata(false).opt_level(0).warnings(false).debug(false)
.target(&target).host(&build.build);

Expand All @@ -67,7 +67,7 @@ pub fn find(build: &mut Build) {

// For all host triples we need to find a C++ compiler as well
for host in build.hosts.iter().cloned().chain(iter::once(build.build)) {
let mut cfg = gcc::Build::new();
let mut cfg = cc::Build::new();
cfg.cargo_metadata(false).opt_level(0).warnings(false).debug(false).cpp(true)
.target(&host).host(&build.build);
let config = build.config.target_config.get(&host);
Expand All @@ -82,7 +82,7 @@ pub fn find(build: &mut Build) {
}
}

fn set_compiler(cfg: &mut gcc::Build,
fn set_compiler(cfg: &mut cc::Build,
gnu_compiler: &str,
target: Interned<String>,
config: Option<&Target>,
Expand Down
12 changes: 10 additions & 2 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ impl Step for Rls {

builder.add_rustc_lib_path(compiler, &mut cargo);

try_run(build, &mut cargo);
try_run_expecting(
build,
&mut cargo,
builder.build.config.toolstate.rls.passes(ToolState::Testing),
);
}
}

Expand Down Expand Up @@ -295,7 +299,11 @@ impl Step for Rustfmt {

builder.add_rustc_lib_path(compiler, &mut cargo);

try_run(build, &mut cargo);
try_run_expecting(
build,
&mut cargo,
builder.build.config.toolstate.rustfmt.passes(ToolState::Testing),
);
}
}

Expand Down
17 changes: 4 additions & 13 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,13 +1098,8 @@ impl Step for Rls {
.arg("--output-dir").arg(&distdir(build))
.arg("--non-installed-overlay").arg(&overlay)
.arg(format!("--package-name={}-{}", name, target))
.arg("--legacy-manifest-dirs=rustlib,cargo");

if build.config.channel == "nightly" {
cmd.arg("--component-name=rls");
} else {
cmd.arg("--component-name=rls-preview");
}
.arg("--legacy-manifest-dirs=rustlib,cargo")
.arg("--component-name=rls-preview");

build.run(&mut cmd);
distdir(build).join(format!("{}-{}.tar.gz", name, target))
Expand Down Expand Up @@ -1333,12 +1328,8 @@ impl Step for Extended {
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target))
.join(format!("rust-std-{}", target)),
&exe.join("rust-std"));
let rls_path = if build.config.channel == "nightly" {
work.join(&format!("{}-{}", pkgname(build, "rls"), target)).join("rls")
} else {
work.join(&format!("{}-{}", pkgname(build, "rls"), target)).join("rls-preview")
};
cp_r(&rls_path, &exe.join("rls"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target)).join("rls-preview"),
&exe.join("rls"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target))
.join(format!("rust-analysis-{}", target)),
&exe.join("rust-analysis"));
Expand Down
12 changes: 6 additions & 6 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ extern crate lazy_static;
extern crate serde_json;
extern crate cmake;
extern crate filetime;
extern crate gcc;
extern crate cc;
extern crate getopts;
extern crate num_cpus;
extern crate toml;
Expand All @@ -148,7 +148,7 @@ use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppresse

use util::{exe, libdir, OutputFolder, CiEnv};

mod cc;
mod cc_detect;
mod channel;
mod check;
mod clean;
Expand Down Expand Up @@ -241,9 +241,9 @@ pub struct Build {

// Runtime state filled in later on
// target -> (cc, ar)
cc: HashMap<Interned<String>, (gcc::Tool, Option<PathBuf>)>,
cc: HashMap<Interned<String>, (cc::Tool, Option<PathBuf>)>,
// host -> (cc, ar)
cxx: HashMap<Interned<String>, gcc::Tool>,
cxx: HashMap<Interned<String>, cc::Tool>,
crates: HashMap<Interned<String>, Crate>,
is_sudo: bool,
ci_env: CiEnv,
Expand Down Expand Up @@ -350,7 +350,7 @@ impl Build {
}

self.verbose("finding compilers");
cc::find(self);
cc_detect::find(self);
self.verbose("running sanity check");
sanity::check(self);
// If local-rust is the same major.minor as the current version, then force a local-rebuild
Expand Down Expand Up @@ -619,7 +619,7 @@ impl Build {
/// specified.
fn cflags(&self, target: Interned<String>) -> Vec<String> {
// Filter out -O and /O (the optimization flags) that we picked up from
// gcc-rs because the build scripts will determine that for themselves.
// cc-rs because the build scripts will determine that for themselves.
let mut base = self.cc[&target].0.args().iter()
.map(|s| s.to_string_lossy().into_owned())
.filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use std::process::Command;

use build_helper::output;
use cmake;
use gcc;
use cc;

use Build;
use util;
Expand Down Expand Up @@ -289,7 +289,7 @@ impl Step for TestHelpers {
let _folder = build.fold_output(|| "build_test_helpers");
println!("Building test helpers");
t!(fs::create_dir_all(&dst));
let mut cfg = gcc::Build::new();
let mut cfg = cc::Build::new();

// We may have found various cross-compilers a little differently due to our
// extra configuration, so inform gcc of these compilers. Note, though, that
Expand Down
8 changes: 6 additions & 2 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ pub fn prepare_tool_cargo(
cargo.env("LIBZ_SYS_STATIC", "1");
}

// if tools are using lzma we want to force the build script to build its
// own copy
cargo.env("LZMA_API_STATIC", "1");

cargo.env("CFG_RELEASE_CHANNEL", &build.config.channel);
cargo.env("CFG_VERSION", build.rust_version());

Expand Down Expand Up @@ -454,7 +458,7 @@ impl Step for Rls {
tool: "rls",
mode: Mode::Librustc,
path: "src/tools/rls",
expectation: BuildExpectation::None,
expectation: builder.build.config.toolstate.rls.passes(ToolState::Compiling),
})
}
}
Expand Down Expand Up @@ -489,7 +493,7 @@ impl Step for Rustfmt {
tool: "rustfmt",
mode: Mode::Librustc,
path: "src/tools/rustfmt",
expectation: BuildExpectation::None,
expectation: builder.build.config.toolstate.rustfmt.passes(ToolState::Compiling),
})
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/toolstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ impl Default for ToolState {
pub struct ToolStates {
pub miri: ToolState,
pub clippy: ToolState,
pub rls: ToolState,
pub rustfmt: ToolState,
}
2 changes: 1 addition & 1 deletion src/liballoc_jemalloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ libc = { path = "../rustc/libc_shim" }

[build-dependencies]
build_helper = { path = "../build_helper" }
gcc = "0.3.50"
cc = "1.0"

[features]
debug = []
6 changes: 3 additions & 3 deletions src/liballoc_jemalloc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#![deny(warnings)]

extern crate build_helper;
extern crate gcc;
extern crate cc;

use std::env;
use std::path::PathBuf;
Expand Down Expand Up @@ -63,7 +63,7 @@ fn main() {
_ => return,
};

let compiler = gcc::Build::new().get_compiler();
let compiler = cc::Build::new().get_compiler();
// only msvc returns None for ar so unwrap is okay
let ar = build_helper::cc2ar(compiler.path(), &target).unwrap();
let cflags = compiler.args()
Expand Down Expand Up @@ -150,7 +150,7 @@ fn main() {
// sure the symbols are available.
if target.contains("androideabi") {
println!("cargo:rerun-if-changed=pthread_atfork_dummy.c");
gcc::Build::new()
cc::Build::new()
.flag("-fvisibility=hidden")
.file("pthread_atfork_dummy.c")
.compile("libpthread_atfork_dummy.a");
Expand Down
2 changes: 1 addition & 1 deletion src/libprofiler_builtins/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ doc = false
core = { path = "../libcore" }

[build-dependencies]
gcc = "0.3.50"
cc = "1.0"
4 changes: 2 additions & 2 deletions src/libprofiler_builtins/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
//!
//! See the build.rs for libcompiler_builtins crate for details.

extern crate gcc;
extern crate cc;

use std::env;
use std::path::Path;

fn main() {
let target = env::var("TARGET").expect("TARGET was not set");
let cfg = &mut gcc::Build::new();
let cfg = &mut cc::Build::new();

let mut profile_sources = vec!["GCDAProfiling.c",
"InstrProfiling.c",
Expand Down
28 changes: 14 additions & 14 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,20 +1373,20 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
always = always colorize output;
never = never colorize output", "auto|always|never"),

opt::flagopt("", "pretty",
"Pretty-print the input instead of compiling;
valid types are: `normal` (un-annotated source),
`expanded` (crates expanded), or
`expanded,identified` (fully parenthesized, AST nodes with IDs).",
"TYPE"),
opt::flagopt("", "unpretty",
"Present the input source, unstable (and less-pretty) variants;
valid types are any of the types for `--pretty`, as well as:
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
`everybody_loops` (all function bodies replaced with `loop {}`),
`hir` (the HIR), `hir,identified`, or
`hir,typed` (HIR with types for each node).",
"TYPE"),
opt::opt("", "pretty",
"Pretty-print the input instead of compiling;
valid types are: `normal` (un-annotated source),
`expanded` (crates expanded), or
`expanded,identified` (fully parenthesized, AST nodes with IDs).",
"TYPE"),
opt::opt("", "unpretty",
"Present the input source, unstable (and less-pretty) variants;
valid types are any of the types for `--pretty`, as well as:
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
`everybody_loops` (all function bodies replaced with `loop {}`),
`hir` (the HIR), `hir,identified`, or
`hir,typed` (HIR with types for each node).",
"TYPE"),
]);
opts
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }

[build-dependencies]
build_helper = { path = "../build_helper" }
gcc = "0.3.50"
cc = "1.0"
4 changes: 2 additions & 2 deletions src/librustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

extern crate gcc;
extern crate cc;
extern crate build_helper;

use std::process::Command;
Expand Down Expand Up @@ -136,7 +136,7 @@ fn main() {
let mut cmd = Command::new(&llvm_config);
cmd.arg("--cxxflags");
let cxxflags = output(&mut cmd);
let mut cfg = gcc::Build::new();
let mut cfg = cc::Build::new();
cfg.warnings(false);
for flag in cxxflags.split_whitespace() {
// Ignore flags like `-m64` when we're doing a cross build
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }

[target."cfg(windows)".dependencies]
gcc = "0.3.50"
cc = "1.0"
2 changes: 1 addition & 1 deletion src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub fn get_linker(sess: &Session) -> (String, Command, Vec<(OsString, OsString)>

#[cfg(windows)]
pub fn msvc_link_exe_cmd(sess: &Session) -> (Command, Vec<(OsString, OsString)>) {
use gcc::windows_registry;
use cc::windows_registry;

let target = &sess.opts.target_triple;
let tool = windows_registry::find_tool(target, "link.exe");
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extern crate syntax_pos;
extern crate rustc_errors as errors;
extern crate serialize;
#[cfg(windows)]
extern crate gcc; // Used to locate MSVC, not gcc :)
extern crate cc; // Used to locate MSVC

pub use base::trans_crate;

Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ html-diff = "0.0.4"

[build-dependencies]
build_helper = { path = "../build_helper" }
gcc = "0.3.50"
cc = "1.0"
Loading