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

Lines changed: 231 additions & 210 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Cargo.toml

Lines changed: 2 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 10 additions & 2 deletions
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

Lines changed: 4 additions & 13 deletions
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

Lines changed: 6 additions & 6 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 6 additions & 2 deletions
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
}

0 commit comments

Comments
 (0)