-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
std: move process implementations to sys
#136929
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
This comment has been minimized.
This comment has been minimized.
a3a3339
to
484706e
Compare
This comment has been minimized.
This comment has been minimized.
484706e
to
5ce9e2c
Compare
☔ The latest upstream changes (presumably #137046) made this pull request unmergeable. Please resolve the merge conflicts. |
5ce9e2c
to
fb1751f
Compare
☔ The latest upstream changes (presumably #137163) made this pull request unmergeable. Please resolve the merge conflicts. |
fb1751f
to
26fd9bf
Compare
☔ The latest upstream changes (presumably #137446) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
non-blocking question
@@ -289,6 +288,14 @@ pub fn truncate_utf16_at_nul(v: &[u16]) -> &[u16] { | |||
} | |||
} | |||
|
|||
pub fn ensure_no_nuls<T: AsRef<OsStr>>(s: T) -> crate::io::Result<T> { | |||
if s.as_ref().encode_wide().any(|b| b == 0) { |
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.
Hm, are we using this for soundness anywhere? The AsRef<OsStr>
conversion could e.g. return different results spuriously which would be a problem if we are.
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.
Luckily that's not the case, we only use this with trusted types. But I agree that this isn't great, I'll try to find a better solution in another PR.
r=me with a rebase |
26fd9bf
to
57462c0
Compare
☔ The latest upstream changes (presumably #138366) made this pull request unmergeable. Please resolve the merge conflicts. |
@rustbot author (Feel free to self-approve, I believe you have permissions, as you rebase) |
57462c0
to
af6d150
Compare
Will do! Most of the time, I just want to wait until the CI shows green, but then forget to approve the PR until it's too late again... 😄 |
…lacrum std: move process implementations to `sys` As per rust-lang#117276, this moves the implementations of `Process` and friends out of the `pal` module and into the `sys` module, removing quite a lot of error-prone `#[path]` imports in the process (hah, get it ;-)). I've also made the `zircon` module a dedicated submodule of `pal::unix`, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications in `sys`). Also, the `ensure_no_nuls` function on Windows now lives in `sys::pal::windows` – it's not specific to processes and shared by the argument implementation.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
That failure seems spurious... |
As per rust-lang#117276, this moves the implementations of `Process` and friends out of the `pal` module and into the `sys` module, removing quite a lot of error-prone `#[path]` imports in the process (hah, get it ;-)). I've also made the `zircon` module a dedicated submodule of `pal::unix`, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications in `sys`). Also, the `ensure_no_nuls` function on Windows now lives in `sys::pal::windows` – it's not specific to processes and shared by the argument implementation.
af6d150
to
89f85cb
Compare
@bors r- |
Rebased. |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 97fc1f6 (parent) -> aa8f0fd (this PR) Test differencesShow 48 test diffs
Job group index
|
Finished benchmarking commit (aa8f0fd): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (secondary 0.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -2.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 775.27s -> 775.713s (0.06%) |
PRs rust-lang#136842 (Add libstd support for Trusty targets), rust-lang#137793 (Stablize anonymous pipe), and rust-lang#136929 (std: move process implementations to `sys`) merged around the same time, so update Trusty to take them into account.
…Poison,saethlin Trusty: Fix build for anonymous pipes and std::sys::process PRs rust-lang#136842 (Add libstd support for Trusty targets), rust-lang#137793 (Stablize anonymous pipe), and rust-lang#136929 (std: move process implementations to `sys`) merged around the same time, so update Trusty to take them into account. cc `@randomPoison`
Rollup merge of rust-lang#138875 - thaliaarchi:trusty-build, r=randomPoison,saethlin Trusty: Fix build for anonymous pipes and std::sys::process PRs rust-lang#136842 (Add libstd support for Trusty targets), rust-lang#137793 (Stablize anonymous pipe), and rust-lang#136929 (std: move process implementations to `sys`) merged around the same time, so update Trusty to take them into account. cc `@randomPoison`
As per #117276, this moves the implementations of
Process
and friends out of thepal
module and into thesys
module, removing quite a lot of error-prone#[path]
imports in the process (hah, get it ;-)). I've also made thezircon
module a dedicated submodule ofpal::unix
, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications insys
). Also, theensure_no_nuls
function on Windows now lives insys::pal::windows
– it's not specific to processes and shared by the argument implementation.