Skip to content

Commit 688a858

Browse files
committed
Auto merge of #44785 - alexcrichton:update-cargo, r=nikomatsakis
Update some minor dependencies * run `cargo update` * Update cargo submodule * Update to the `cc` crate from `gcc`
2 parents d887369 + 7694ca4 commit 688a858

File tree

29 files changed

+325
-291
lines changed

29 files changed

+325
-291
lines changed

src/Cargo.lock

+231-210
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cargo.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ members = [
3838
"tools/rls/test_data/infer_custom_bin",
3939
"tools/rls/test_data/infer_lib",
4040
"tools/rls/test_data/omit_init_build",
41+
"tools/rls/test_data/unicødë",
42+
"tools/rls/test_data/workspace_symbol",
4143
]
4244

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

63-
# Override rustfmt dependencies both on the repo and the crate (the RLS
64-
# sometimes uses either).
65-
# FIXME should only need the crates.io patch, long term.
66-
[patch."https://github.com/rust-lang-nursery/rustfmt"]
67-
rustfmt-nightly = { path = "tools/rustfmt" }
6865
[patch.crates-io]
6966
rustfmt-nightly = { path = "tools/rustfmt" }

src/bootstrap/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cmake = "0.1.23"
3434
filetime = "0.1"
3535
num_cpus = "1.0"
3636
getopts = "0.2"
37-
gcc = "0.3.54"
37+
cc = "1.0"
3838
libc = "0.2"
3939
serde = "1.0.8"
4040
serde_derive = "1.0.8"

src/bootstrap/bin/sccache-plus-cl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern crate gcc;
11+
extern crate cc;
1212

1313
use std::env;
1414
use std::process::{self, Command};
@@ -18,7 +18,7 @@ fn main() {
1818
// Locate the actual compiler that we're invoking
1919
env::remove_var("CC");
2020
env::remove_var("CXX");
21-
let mut cfg = gcc::Build::new();
21+
let mut cfg = cc::Build::new();
2222
cfg.cargo_metadata(false)
2323
.out_dir("/")
2424
.target(&target)

src/bootstrap/cc.rs renamed to src/bootstrap/cc_detect.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//! 6. "cc"
2424
//!
2525
//! Some of this logic is implemented here, but much of it is farmed out to the
26-
//! `gcc` crate itself, so we end up having the same fallbacks as there.
26+
//! `cc` crate itself, so we end up having the same fallbacks as there.
2727
//! Similar logic is then used to find a C++ compiler, just some s/cc/c++/ is
2828
//! used.
2929
//!
@@ -35,7 +35,7 @@ use std::process::Command;
3535
use std::iter;
3636

3737
use build_helper::{cc2ar, output};
38-
use gcc;
38+
use cc;
3939

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

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

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

85-
fn set_compiler(cfg: &mut gcc::Build,
85+
fn set_compiler(cfg: &mut cc::Build,
8686
gnu_compiler: &str,
8787
target: Interned<String>,
8888
config: Option<&Target>,

src/bootstrap/check.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ impl Step for Rls {
254254

255255
builder.add_rustc_lib_path(compiler, &mut cargo);
256256

257-
try_run(build, &mut cargo);
257+
try_run_expecting(
258+
build,
259+
&mut cargo,
260+
builder.build.config.toolstate.rls.passes(ToolState::Testing),
261+
);
258262
}
259263
}
260264

@@ -295,7 +299,11 @@ impl Step for Rustfmt {
295299

296300
builder.add_rustc_lib_path(compiler, &mut cargo);
297301

298-
try_run(build, &mut cargo);
302+
try_run_expecting(
303+
build,
304+
&mut cargo,
305+
builder.build.config.toolstate.rustfmt.passes(ToolState::Testing),
306+
);
299307
}
300308
}
301309

src/bootstrap/dist.rs

+4-13
Original file line numberDiff line numberDiff line change
@@ -1098,13 +1098,8 @@ impl Step for Rls {
10981098
.arg("--output-dir").arg(&distdir(build))
10991099
.arg("--non-installed-overlay").arg(&overlay)
11001100
.arg(format!("--package-name={}-{}", name, target))
1101-
.arg("--legacy-manifest-dirs=rustlib,cargo");
1102-
1103-
if build.config.channel == "nightly" {
1104-
cmd.arg("--component-name=rls");
1105-
} else {
1106-
cmd.arg("--component-name=rls-preview");
1107-
}
1101+
.arg("--legacy-manifest-dirs=rustlib,cargo")
1102+
.arg("--component-name=rls-preview");
11081103

11091104
build.run(&mut cmd);
11101105
distdir(build).join(format!("{}-{}.tar.gz", name, target))
@@ -1333,12 +1328,8 @@ impl Step for Extended {
13331328
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target))
13341329
.join(format!("rust-std-{}", target)),
13351330
&exe.join("rust-std"));
1336-
let rls_path = if build.config.channel == "nightly" {
1337-
work.join(&format!("{}-{}", pkgname(build, "rls"), target)).join("rls")
1338-
} else {
1339-
work.join(&format!("{}-{}", pkgname(build, "rls"), target)).join("rls-preview")
1340-
};
1341-
cp_r(&rls_path, &exe.join("rls"));
1331+
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target)).join("rls-preview"),
1332+
&exe.join("rls"));
13421333
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target))
13431334
.join(format!("rust-analysis-{}", target)),
13441335
&exe.join("rust-analysis"));

src/bootstrap/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ extern crate lazy_static;
126126
extern crate serde_json;
127127
extern crate cmake;
128128
extern crate filetime;
129-
extern crate gcc;
129+
extern crate cc;
130130
extern crate getopts;
131131
extern crate num_cpus;
132132
extern crate toml;
@@ -148,7 +148,7 @@ use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppresse
148148

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

151-
mod cc;
151+
mod cc_detect;
152152
mod channel;
153153
mod check;
154154
mod clean;
@@ -241,9 +241,9 @@ pub struct Build {
241241

242242
// Runtime state filled in later on
243243
// target -> (cc, ar)
244-
cc: HashMap<Interned<String>, (gcc::Tool, Option<PathBuf>)>,
244+
cc: HashMap<Interned<String>, (cc::Tool, Option<PathBuf>)>,
245245
// host -> (cc, ar)
246-
cxx: HashMap<Interned<String>, gcc::Tool>,
246+
cxx: HashMap<Interned<String>, cc::Tool>,
247247
crates: HashMap<Interned<String>, Crate>,
248248
is_sudo: bool,
249249
ci_env: CiEnv,
@@ -350,7 +350,7 @@ impl Build {
350350
}
351351

352352
self.verbose("finding compilers");
353-
cc::find(self);
353+
cc_detect::find(self);
354354
self.verbose("running sanity check");
355355
sanity::check(self);
356356
// If local-rust is the same major.minor as the current version, then force a local-rebuild
@@ -619,7 +619,7 @@ impl Build {
619619
/// specified.
620620
fn cflags(&self, target: Interned<String>) -> Vec<String> {
621621
// Filter out -O and /O (the optimization flags) that we picked up from
622-
// gcc-rs because the build scripts will determine that for themselves.
622+
// cc-rs because the build scripts will determine that for themselves.
623623
let mut base = self.cc[&target].0.args().iter()
624624
.map(|s| s.to_string_lossy().into_owned())
625625
.filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))

src/bootstrap/native.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use std::process::Command;
2727

2828
use build_helper::output;
2929
use cmake;
30-
use gcc;
30+
use cc;
3131

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

294294
// We may have found various cross-compilers a little differently due to our
295295
// extra configuration, so inform gcc of these compilers. Note, though, that

src/bootstrap/tool.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ pub fn prepare_tool_cargo(
126126
cargo.env("LIBZ_SYS_STATIC", "1");
127127
}
128128

129+
// if tools are using lzma we want to force the build script to build its
130+
// own copy
131+
cargo.env("LZMA_API_STATIC", "1");
132+
129133
cargo.env("CFG_RELEASE_CHANNEL", &build.config.channel);
130134
cargo.env("CFG_VERSION", build.rust_version());
131135

@@ -454,7 +458,7 @@ impl Step for Rls {
454458
tool: "rls",
455459
mode: Mode::Librustc,
456460
path: "src/tools/rls",
457-
expectation: BuildExpectation::None,
461+
expectation: builder.build.config.toolstate.rls.passes(ToolState::Compiling),
458462
})
459463
}
460464
}
@@ -489,7 +493,7 @@ impl Step for Rustfmt {
489493
tool: "rustfmt",
490494
mode: Mode::Librustc,
491495
path: "src/tools/rustfmt",
492-
expectation: BuildExpectation::None,
496+
expectation: builder.build.config.toolstate.rustfmt.passes(ToolState::Compiling),
493497
})
494498
}
495499
}

src/bootstrap/toolstate.rs

+2
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ impl Default for ToolState {
4646
pub struct ToolStates {
4747
pub miri: ToolState,
4848
pub clippy: ToolState,
49+
pub rls: ToolState,
50+
pub rustfmt: ToolState,
4951
}

src/liballoc_jemalloc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ libc = { path = "../rustc/libc_shim" }
1919

2020
[build-dependencies]
2121
build_helper = { path = "../build_helper" }
22-
gcc = "0.3.50"
22+
cc = "1.0"
2323

2424
[features]
2525
debug = []

src/liballoc_jemalloc/build.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![deny(warnings)]
1212

1313
extern crate build_helper;
14-
extern crate gcc;
14+
extern crate cc;
1515

1616
use std::env;
1717
use std::path::PathBuf;
@@ -63,7 +63,7 @@ fn main() {
6363
_ => return,
6464
};
6565

66-
let compiler = gcc::Build::new().get_compiler();
66+
let compiler = cc::Build::new().get_compiler();
6767
// only msvc returns None for ar so unwrap is okay
6868
let ar = build_helper::cc2ar(compiler.path(), &target).unwrap();
6969
let cflags = compiler.args()
@@ -150,7 +150,7 @@ fn main() {
150150
// sure the symbols are available.
151151
if target.contains("androideabi") {
152152
println!("cargo:rerun-if-changed=pthread_atfork_dummy.c");
153-
gcc::Build::new()
153+
cc::Build::new()
154154
.flag("-fvisibility=hidden")
155155
.file("pthread_atfork_dummy.c")
156156
.compile("libpthread_atfork_dummy.a");

src/libprofiler_builtins/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ doc = false
1515
core = { path = "../libcore" }
1616

1717
[build-dependencies]
18-
gcc = "0.3.50"
18+
cc = "1.0"

src/libprofiler_builtins/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
//!
1313
//! See the build.rs for libcompiler_builtins crate for details.
1414
15-
extern crate gcc;
15+
extern crate cc;
1616

1717
use std::env;
1818
use std::path::Path;
1919

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

2424
let mut profile_sources = vec!["GCDAProfiling.c",
2525
"InstrProfiling.c",

src/librustc/session/config.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -1373,20 +1373,20 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
13731373
always = always colorize output;
13741374
never = never colorize output", "auto|always|never"),
13751375

1376-
opt::flagopt("", "pretty",
1377-
"Pretty-print the input instead of compiling;
1378-
valid types are: `normal` (un-annotated source),
1379-
`expanded` (crates expanded), or
1380-
`expanded,identified` (fully parenthesized, AST nodes with IDs).",
1381-
"TYPE"),
1382-
opt::flagopt("", "unpretty",
1383-
"Present the input source, unstable (and less-pretty) variants;
1384-
valid types are any of the types for `--pretty`, as well as:
1385-
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1386-
`everybody_loops` (all function bodies replaced with `loop {}`),
1387-
`hir` (the HIR), `hir,identified`, or
1388-
`hir,typed` (HIR with types for each node).",
1389-
"TYPE"),
1376+
opt::opt("", "pretty",
1377+
"Pretty-print the input instead of compiling;
1378+
valid types are: `normal` (un-annotated source),
1379+
`expanded` (crates expanded), or
1380+
`expanded,identified` (fully parenthesized, AST nodes with IDs).",
1381+
"TYPE"),
1382+
opt::opt("", "unpretty",
1383+
"Present the input source, unstable (and less-pretty) variants;
1384+
valid types are any of the types for `--pretty`, as well as:
1385+
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1386+
`everybody_loops` (all function bodies replaced with `loop {}`),
1387+
`hir` (the HIR), `hir,identified`, or
1388+
`hir,typed` (HIR with types for each node).",
1389+
"TYPE"),
13901390
]);
13911391
opts
13921392
}

src/librustc_llvm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
1818

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

src/librustc_llvm/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern crate gcc;
11+
extern crate cc;
1212
extern crate build_helper;
1313

1414
use std::process::Command;
@@ -136,7 +136,7 @@ fn main() {
136136
let mut cmd = Command::new(&llvm_config);
137137
cmd.arg("--cxxflags");
138138
let cxxflags = output(&mut cmd);
139-
let mut cfg = gcc::Build::new();
139+
let mut cfg = cc::Build::new();
140140
cfg.warnings(false);
141141
for flag in cxxflags.split_whitespace() {
142142
// Ignore flags like `-m64` when we're doing a cross build

src/librustc_trans/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ syntax = { path = "../libsyntax" }
3232
syntax_pos = { path = "../libsyntax_pos" }
3333

3434
[target."cfg(windows)".dependencies]
35-
gcc = "0.3.50"
35+
cc = "1.0"

src/librustc_trans/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn get_linker(sess: &Session) -> (String, Command, Vec<(OsString, OsString)>
125125

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

130130
let target = &sess.opts.target_triple;
131131
let tool = windows_registry::find_tool(target, "link.exe");

src/librustc_trans/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extern crate syntax_pos;
6161
extern crate rustc_errors as errors;
6262
extern crate serialize;
6363
#[cfg(windows)]
64-
extern crate gcc; // Used to locate MSVC, not gcc :)
64+
extern crate cc; // Used to locate MSVC
6565

6666
pub use base::trans_crate;
6767

src/librustdoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ html-diff = "0.0.4"
1818

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

0 commit comments

Comments
 (0)