diff options
| author | bors <bors@rust-lang.org> | 2018-04-09 06:05:49 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-04-09 06:05:49 +0000 | 
| commit | 561fb395599c63d1368bfc2693b1075a75a604cc (patch) | |
| tree | 8a36c702c9f31bc214e65bffb15c9247c048135b | |
| parent | 8ae79efce3e43eadecd032cf38b2372b4cba7b62 (diff) | |
| parent | 94879023ad6965ed6a2a3f0d50a961ef31e47c9a (diff) | |
| download | rust-561fb395599c63d1368bfc2693b1075a75a604cc.tar.gz rust-561fb395599c63d1368bfc2693b1075a75a604cc.zip | |
Auto merge of #49778 - tamird:install-relative-prefix, r=Mark-Simulacrum
rustbuild: canonicalize prefix `install_sh` Testing: ``` $ git diff diff --git a/config.toml.example b/config.toml.example index 9dd3002506..b47bc490cd 100644 --- a/config.toml.example +++ b/config.toml.example @@ -196,7 +196,7 @@ [install] # Instead of installing to /usr/local, install to this path instead. -#prefix = "/usr/local" +prefix = "install-prefix" # Where to install system configuration files # If this is a relative path, it will get installed in `prefix` above $ mkdir install-prefix $ ./x.py install -i --stage 0 --config config.toml.example ... $ ls install-prefix/ bin lib share ``` Closes #36989. r? @Mark-Simulacrum
| -rw-r--r-- | src/bootstrap/install.rs | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs index 4b05cac1ce6..d71fdb8a30c 100644 --- a/src/bootstrap/install.rs +++ b/src/bootstrap/install.rs @@ -72,7 +72,9 @@ fn install_sh( let bindir_default = PathBuf::from("bin"); let libdir_default = PathBuf::from("lib"); let mandir_default = datadir_default.join("man"); - let prefix = build.config.prefix.as_ref().unwrap_or(&prefix_default); + let prefix = build.config.prefix.as_ref().map_or(prefix_default, |p| { + fs::canonicalize(p).expect(&format!("could not canonicalize {}", p.display())) + }); let sysconfdir = build.config.sysconfdir.as_ref().unwrap_or(&sysconfdir_default); let datadir = build.config.datadir.as_ref().unwrap_or(&datadir_default); let docdir = build.config.docdir.as_ref().unwrap_or(&docdir_default); | 
