Skip to content

library: std: process: Make Command::status platform specific - #165637

Open
Ayush1325 wants to merge 2 commits into
rust-lang:mainfrom
Ayush1325:uefi-tests
Open

Ayush1325 wants to merge 2 commits into
rust-lang:mainfrom
Ayush1325:uefi-tests

Conversation

@Ayush1325

@Ayush1325 Ayush1325 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Some platforms like UEFI do not support real sub-processes. Hoever, it
is possible to launch a program from another. Thus, while
Command::spawn is not possible on UEFI, APIs which wait for the
result, (such as Command::output) are fine.

Similar to what was done for Command::output in past (#105458), make
Command::status impl platform specific, i.e. move it into
sys/process/mod.rs.

Some platforms like UEFI do not support real sub-processes. Hoever, it
is possible to launch a program from another. Thus, while
Command::spawn is not possible on UEFI, APIs which wait for the
result, (such as Command::output) are fine.

Similar to what was done for Command::output in past, make
Command::status impl platform specific, i.e. move it into
sys/process/mod.rs.

Signed-off-by: Ayush Singh <[email protected]>
@rustbot rustbot added A-process Area: `std::process` (note: `std::env` is A-env) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 8, 2026
@rustbot

rustbot commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 38 candidates
  • Random selection from JohnTitor, LawnGnome, Mark-Simulacrum, hanna-kruppe

Comment thread library/std/src/sys/process/uefi.rs Outdated
@@ -145,7 +145,12 @@ impl Command {
}
}

pub fn output(command: &mut Command) -> io::Result<(ExitStatus, Vec<u8>, Vec<u8>)> {
pub fn cmd_exec(

@joboet joboet Nov 8, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be public? I'd have thought this to be a private helper.

View changes since the review

@Ayush1325 Ayush1325 Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it does not. Fixed. Thanks

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2026
@rustbot

rustbot commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Use a custom implementation for Command::status for UEFI, that does
not rely on Command::spawn. While I am only writing one for UEFI,
judging by the implementation of output just above this, other
platforms might also add their own in the future.

Signed-off-by: Ayush Singh <[email protected]>
@Ayush1325

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-process Area: `std::process` (note: `std::env` is A-env) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants