-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for correct env keys in Command
#39338
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
Tests? |
Looks good to me, can you be sure to squash the commits as well? |
bf6ac6b
to
ab677d8
Compare
Squashed and rebased. |
@bors: r+ |
📌 Commit ab677d8 has been approved by |
@bors r- This fails on Windows https://ci.appveyor.com/project/rust-lang/rust/build/1.0.1822/job/47x30lo5vajnd8pf |
ping @tbu-, want to help fix the tests? |
src/libstd/sys/windows/process.rs
Outdated
@@ -35,12 +35,6 @@ use sys_common::{AsInner, FromInner}; | |||
// Command | |||
//////////////////////////////////////////////////////////////////////////////// | |||
|
|||
fn mk_key(s: &OsStr) -> OsString { | |||
FromInner::from_inner(sys::os_str::Buf { | |||
inner: s.as_inner().inner.to_ascii_uppercase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why this is here. It ASCII-uppercases all env keys, for no particular reason as far as I can tell -- It was introduced with the stabilisation of the process module, it wasn't there before (if my git is good enough).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the existing behavior be preserved? We can discuss the specifics in a further issue if you'd like to make a case for removal.
AFAIK Windows has case insensitive keys, so we canonicalize to uppercase.
a88104d
to
edf4e36
Compare
Return an error if the key contains an ASCII equals sign (`=`) at the non-first position.
edf4e36
to
7621677
Compare
Rebased and addressed comment. |
@bors: r+ |
📌 Commit 7621677 has been approved by |
⌛ Testing commit 7621677 with merge a56bac8... |
💔 Test failed - status-appveyor |
7621677
to
082a6d0
Compare
Removed that semicolon. |
@bors: r+ |
📌 Commit 082a6d0 has been approved by |
⌛ Testing commit 082a6d0 with merge b0c79ab... |
💔 Test failed - status-appveyor |
@bors: retry
|
⌛ Testing commit a96956b with merge 8a84892... |
💔 Test failed - status-appveyor |
a96956b
to
4dfc6fd
Compare
Fixed variable name. |
@bors: r+ |
📌 Commit 4dfc6fd has been approved by |
⌛ Testing commit 4dfc6fd with merge 435492e... |
💔 Test failed - status-appveyor |
Why is the Also may make sense to document this restriction on |
4dfc6fd
to
314649d
Compare
Made the borrow checker happy. @jmesmon I don't know, but it is accepted on both Windows and Linux (it's an oddity on both). This is a restriction of the underlying platform, it's the same for |
@bors: r+ |
📌 Commit 314649d has been approved by |
⌛ Testing commit 314649d with merge aa35101... |
💔 Test failed - status-travis |
I don't know how that particular test failed. :) It doesn't do anything with the environment. |
The error message was added in this PR though, so it looks like this PR did indeed cause that error? |
I added some |
If you've got docker locally you can test this out via |
@tbu- any update on this PR to debug android? |
Closing due to inactivity, but feel free to resubmit with android tests fixed! |
Return an error if the key contains an ASCII equals sign (
=
) at thenon-first position.