Skip to content

std: sys: pal: uefi: os: Implement split_paths#151991

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
Ayush1325:uefi-split-path
Mar 1, 2026
Merged

std: sys: pal: uefi: os: Implement split_paths#151991
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
Ayush1325:uefi-split-path

Conversation

@Ayush1325
Copy link
Contributor

@Ayush1325 Ayush1325 commented Feb 2, 2026

  • Tested using OVMF on QEMU

@rustbot label +O-UEFI
cc @nicholasbishop

@rustbot rustbot added 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 Feb 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 2, 2026

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
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

@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@nicholasbishop nicholasbishop left a comment

Choose a reason for hiding this comment

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

It would be good to add a split_paths_uefi test in this file:

fn split_paths_windows() {

View changes since this review

pub fn split_paths(_unparsed: &OsStr) -> SplitPaths<'_> {
panic!("unsupported")
pub fn split_paths(unparsed: &OsStr) -> SplitPaths<'_> {
SplitPaths(unparsed.encode_wide())
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the split_paths_unix and split_paths_windows tests for comparison, I noticed an issue with the way the UEFI implementation handles empty paths. The Unix and Windows implementations map "" to [""] and ";;" to ["", "", ""], but the UEFI implementation returns an empty iterator for both. We should probably make the UEFI behavior match Unix/Windows here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Handling things the same way as windows, just without the quote escaping support.

@Ayush1325
Copy link
Contributor Author

It would be good to add a split_paths_uefi test in this file:

fn split_paths_windows() {

View changes since this review

Added.

@rust-bors

This comment has been minimized.

- Based on Windows implementation. Just removed support for quote
  escaping since that is not supported in UEFI.
- Tested using OVMF on QEMU

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
- Add test for split_paths for UEFI target.
- `;` is the path separator. Escaping is not supported.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
@rustbot
Copy link
Collaborator

rustbot commented Feb 26, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@joboet
Copy link
Member

joboet commented Feb 28, 2026

I know this isn't your fault (the Windows implementation has the same issue), but I really don't think roundtripping to UTF-16 is a good idea. Perhaps you could find an algorithm that works on the OsStr directly?

@joboet
Copy link
Member

joboet commented Feb 28, 2026

Though I guess it's easier to do both in another PR. Let's merge this first...
@bors r+
r? joboet

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 28, 2026

📌 Commit c37e448 has been approved by joboet

It is now in the queue for this repository.

@rustbot rustbot assigned joboet and unassigned ChrisDenton Feb 28, 2026
@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 28, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 28, 2026
std: sys: pal: uefi: os: Implement split_paths

- Tested using OVMF on QEMU

@rustbot label +O-UEFI
cc @nicholasbishop
@nicholasbishop
Copy link
Contributor

I know this isn't your fault (the Windows implementation has the same issue), but I really don't think roundtripping to UTF-16 is a good idea.

To clarify, is your concern here about correctness, or performance? (Or both?)

@joboet
Copy link
Member

joboet commented Feb 28, 2026

Oh, just performance – otherwise I wouldn't have r+ed.

rust-bors bot pushed a commit that referenced this pull request Feb 28, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #146989 (Inhibit all-absent-variant optimization for all enum reprs that inhibit layout optimization, not just repr(C).)
 - #151991 (std: sys: pal: uefi: os: Implement split_paths)
 - #152794 (Fix ICE in `try_to_raw_bytes` when array elements have mismatched)
 - #153052 (std random.rs: update link to RTEMS docs)
 - #153054 (docs: note env var influence on `temp_dir` and `env_clear` on Windows)
 - #153061 (cleanup `tests/ui/box`, part 2)
 - #153197 (style: Update doctests for `TryFrom<integer> for bool` and `From<bool> for float`)
 - #153210 (Fix ICE on empty file with -Zquery-dep-graph)
 - #153228 (Remove `TranslationError`)
@rust-bors rust-bors bot merged commit 435be5b into rust-lang:main Mar 1, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 1, 2026
rust-timer added a commit that referenced this pull request Mar 1, 2026
Rollup merge of #151991 - Ayush1325:uefi-split-path, r=joboet

std: sys: pal: uefi: os: Implement split_paths

- Tested using OVMF on QEMU

@rustbot label +O-UEFI
cc @nicholasbishop
@Ayush1325 Ayush1325 deleted the uefi-split-path branch March 1, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-UEFI UEFI S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants