Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upFix for building on Redox #162
Conversation
This comment has been minimized.
This comment has been minimized.
|
@brson posted more on internals but the tl;dr; is that this patch is a little worrying. Why doesn't std have a path module? |
This comment has been minimized.
This comment has been minimized.
|
It absolutely does have a std::path module. What the issue is with this code is that it assumes that either cfg(unix) or cfg(windows) are set, when a non-unix non-windows OS might not set these config values (such as Redox). A quick fix is to correctly annotate the impl's. A more complete fix would be to have a third function, #[cfg(redox)], that correctly decodes and encodes on Redox |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton would you prefer a fix that adds #[cfg(redox)] and correctly decodes and encodes paths? If so, I can make a PR pretty quickly |
This comment has been minimized.
This comment has been minimized.
|
Yes if |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton In my newest commit, I implemented the #[cfg(redox)] functions. b99dac2 In Redox, OsStr and OsString are guaranteed to be UTF-8 slices. As such, to_str().unwrap() is guaranteed to succeed and OsString::from(String) is valid. |
alexcrichton
merged commit 6488e2b
into
rust-lang-deprecated:master
Sep 28, 2016
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton Can you update the crate version so I can use 0.3 in manifests on Redox? |
jackpot51 commentedSep 25, 2016
On a platform that does not set cfg(unix) or cfg(windows), the impl blocks modified in this PR are left empty, causing compilation to fail
This fixes compilation by not attempting to implement Encodable or Decodable on Path or PathBuf on platforms without the OsStr and OsString conversion functions.