Skip to content

Commit

Permalink
Use path.join("foo").join("bar") instead of path.join("foo/bar")
Browse files Browse the repository at this point in the history
The latter does not work together with \\?\ prefixed paths on Windows.
  • Loading branch information
phil-opp committed Jun 13, 2019
1 parent 3ebb68e commit a1ff033
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Fix incorrect joining of paths that caused some problems on Windows (de3091d4857b28670c5b5ddd323e70944e3a8d75).

## [0.5.11] - 2019-05-31

- Fix an issue with new `XBUILD_SYSROOT_PATH` environment variable ([#34](https://github.com/rust-osdev/cargo-xbuild/pull/34))
Expand Down
2 changes: 1 addition & 1 deletion src/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Sysroot {
/// Returns the path to Rust source, `$SRC`, where `$SRC/libstd/Carg.toml`
/// exists
pub fn src(&self) -> Result<Src> {
let src = self.path().join("lib/rustlib/src");
let src = self.path().join("lib").join("rustlib").join("src");

if src.join("rust/src/libstd/Cargo.toml").is_file() {
return Ok(Src {
Expand Down
6 changes: 4 additions & 2 deletions src/sysroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ pub fn update(
match util::cp_r(
&sysroot
.path()
.join("lib/rustlib")
.join("lib")
.join("rustlib")
.join(&meta.host)
.join("lib"),
&dst,
Expand All @@ -290,7 +291,8 @@ pub fn update(
match util::cp_r(
&sysroot
.path()
.join("lib/rustlib")
.join("lib")
.join("rustlib")
.join(&meta.host)
.join("bin"),
&bin_dst,
Expand Down
2 changes: 1 addition & 1 deletion src/xargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Home {
}

fn path(&self, triple: &str) -> Filesystem {
self.path.join("lib/rustlib").join(triple)
self.path.join("lib").join("rustlib").join(triple)
}

pub fn lock_ro(&self, triple: &str) -> Result<FileLock> {
Expand Down

0 comments on commit a1ff033

Please sign in to comment.