diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-01-08 13:56:22 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2018-01-17 23:14:23 -0800 |
| commit | 80d6ed2d8b2f76cd526d2449c70a1a6af315c114 (patch) | |
| tree | 9f6bfa410c613d65c9f7e218a91a8a7f32c3dcec /src/bootstrap | |
| parent | 0f9c784751434c70ddd6719ccda6817c819126f9 (diff) | |
| download | rust-80d6ed2d8b2f76cd526d2449c70a1a6af315c114.tar.gz rust-80d6ed2d8b2f76cd526d2449c70a1a6af315c114.zip | |
Update Cargo and its dependencies
This'll probably have a bunch of build errors, so let's try and head those off and find them sooner rather than later!
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 5 | ||||
| -rw-r--r-- | src/bootstrap/builder.rs | 33 | ||||
| -rw-r--r-- | src/bootstrap/dist.rs | 2 | ||||
| -rw-r--r-- | src/bootstrap/doc.rs | 2 |
4 files changed, 36 insertions, 6 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 707aceebb1e..93c3694bc0c 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -351,11 +351,6 @@ class RustBuild(object): with open(self.rustc_stamp(), 'w') as rust_stamp: rust_stamp.write(self.date) - if "pc-windows-gnu" in self.build: - filename = "rust-mingw-{}-{}.tar.gz".format( - rustc_channel, self.build) - self._download_stage0_helper(filename, "rust-mingw") - if self.cargo().startswith(self.bin_root()) and \ (not os.path.exists(self.cargo()) or self.program_out_of_date(self.cargo_stamp())): diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 8e35ecc8090..6e8c6f7f1db 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -620,6 +620,39 @@ impl<'a> Builder<'a> { // Set this for all builds to make sure doc builds also get it. cargo.env("CFG_RELEASE_CHANNEL", &self.build.config.channel); + // This one's a bit tricky. As of the time of this writing the compiler + // links to the `winapi` crate on crates.io. This crate provides raw + // bindings to Windows system functions, sort of like libc does for + // Unix. This crate also, however, provides "import libraries" for the + // MinGW targets. There's an import library per dll in the windows + // distribution which is what's linked to. These custom import libraries + // are used because the winapi crate can reference Windows functions not + // present in the MinGW import libraries. + // + // For example MinGW may ship libdbghelp.a, but it may not have + // references to all the functions in the dbghelp dll. Instead the + // custom import library for dbghelp in the winapi crates has all this + // information. + // + // Unfortunately for us though the import libraries are linked by + // default via `-ldylib=winapi_foo`. That is, they're linked with the + // `dylib` type with a `winapi_` prefix (so the winapi ones don't + // conflict with the system MinGW ones). This consequently means that + // the binaries we ship of things like rustc_trans (aka the rustc_trans + // DLL) when linked against *again*, for example with procedural macros + // or plugins, will trigger the propagation logic of `-ldylib`, passing + // `-lwinapi_foo` to the linker again. This isn't actually available in + // our distribution, however, so the link fails. + // + // To solve this problem we tell winapi to not use its bundled import + // libraries. This means that it will link to the system MinGW import + // libraries by default, and the `-ldylib=foo` directives will still get + // passed to the final linker, but they'll look like `-lfoo` which can + // be resolved because MinGW has the import library. The downside is we + // don't get newer functions from Windows, but we don't use any of them + // anyway. + cargo.env("WINAPI_NO_BUNDLED_LIBRARIES", "1"); + if self.is_very_verbose() { cargo.arg("-v"); } diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 3d2795f04e2..7f0613aabe6 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -224,6 +224,8 @@ fn make_win_dist( "libwinspool.a", "libws2_32.a", "libwsock32.a", + "libdbghelp.a", + "libmsimg32.a", ]; //Find mingw artifacts we want to bundle diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index d66c01eb499..1a185889f43 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -160,7 +160,7 @@ impl Step for CargoBook { let target = self.target; let name = self.name; - let src = build.src.join("src/tools/cargo/src/doc/book"); + let src = build.src.join("src/tools/cargo/src/doc"); let out = build.doc_out(target); t!(fs::create_dir_all(&out)); |
