diff options
| author | bors <bors@rust-lang.org> | 2017-07-09 15:42:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-07-09 15:42:47 +0000 |
| commit | 55ad73b0266bef8dfb3ee6f9d7d6b3cf5d119e77 (patch) | |
| tree | 23eb14a4eb47afa5ab1c4f3bcbad7fe2f82ae14e | |
| parent | 12fef71f18df9c688193deecef4b95331c9346a7 (diff) | |
| parent | ce3abc5801f94292be9bc5fbe00b52f1ccb28672 (diff) | |
| download | rust-55ad73b0266bef8dfb3ee6f9d7d6b3cf5d119e77.tar.gz rust-55ad73b0266bef8dfb3ee6f9d7d6b3cf5d119e77.zip | |
Auto merge of #43117 - MJDSys:fix_rustbuild_libdir_2, r=alexcrichton
Fix stage 2 builds with a custom libdir. When copying libstd for the stage 2 compiler, the builder ignores the configured libdir/libdir_relative configuration parameters. This causes the compiler to fail to find libstd, which cause any tools built with the stage 2 compiler to fail. To fix this, make the copy steps of rustbuild aware of the libdir_relative parameter when the stage >= 2. Also update the dist target to be aware of the new location of libstd.
| -rw-r--r-- | src/bootstrap/dist.rs | 5 | ||||
| -rw-r--r-- | src/bootstrap/lib.rs | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 637bdbe9984..8fae1dd99d8 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -405,8 +405,9 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) { let dst = image.join("lib/rustlib").join(target); t!(fs::create_dir_all(&dst)); - let src = build.sysroot(compiler).join("lib/rustlib"); - cp_r(&src.join(target), &dst); + let mut src = build.sysroot_libdir(compiler, target); + src.pop(); // Remove the trailing /lib folder from the sysroot_libdir + cp_r(&src, &dst); let mut cmd = rust_installer(build); cmd.arg("generate") diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 5a3785b1ed6..032231582ef 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -645,8 +645,14 @@ impl Build { /// Returns the libdir where the standard library and other artifacts are /// found for a compiler's sysroot. fn sysroot_libdir(&self, compiler: &Compiler, target: &str) -> PathBuf { - self.sysroot(compiler).join("lib").join("rustlib") - .join(target).join("lib") + if compiler.stage >= 2 { + if let Some(ref libdir_relative) = self.config.libdir_relative { + return self.sysroot(compiler).join(libdir_relative) + .join("rustlib").join(target).join("lib") + } + } + self.sysroot(compiler).join("lib").join("rustlib") + .join(target).join("lib") } /// Returns the root directory for all output generated in a particular |
