Skip to content
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

Extract WStrUnits to sys_common::wstr #104160

Merged
merged 1 commit into from
Dec 1, 2022
Merged

Conversation

Ayush1325
Copy link
Contributor

@Ayush1325 Ayush1325 commented Nov 8, 2022

This commit extracts WStrUnits from sys::windows::args to sys_common::wstr. This allows using the same structure for other targets which use wtf8 (example UEFI).

This was originally a part of #100316

Signed-off-by: Ayush Singh [email protected]

@rustbot
Copy link
Collaborator

rustbot commented Nov 8, 2022

r? @m-ou-se

(rustbot has picked a reviewer for you, use r? to override)

@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 Nov 8, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 8, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@Ayush1325 Ayush1325 changed the title Extract wtf8 argument parsing to sys_common Extract windows argument parsing to sys_common Nov 15, 2022
@Ayush1325
Copy link
Contributor Author

I'm not sure why it is showing canceled tests as unsuccessful since I only changed the commit message.

@bjorn3
Copy link
Member

bjorn3 commented Nov 15, 2022

GitHub Actions has encountered an internal error when running your job.

I restarted all CI jobs.

@Ayush1325 Ayush1325 requested a review from bjorn3 November 19, 2022 11:47
@Ayush1325
Copy link
Contributor Author

@m-ou-se Just sending a ping since it has been open for a while.

@m-ou-se
Copy link
Member

m-ou-se commented Nov 22, 2022

Can you point to any documentation that shows that on uefi the exact same argument parsing algorithm should be used as on windows, even wrt quotes and spaces etc.? In your commit message you talk about "wtf8 argument parsing", but the way quotes and spaces are handled and arguments are split is entirely unrelated to wtf8.

@m-ou-se m-ou-se 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 22, 2022
@Ayush1325
Copy link
Contributor Author

Can you point to any documentation that shows that on uefi the exact same argument parsing algorithm should be used as on windows, even wrt quotes and spaces etc.? In your commit message you talk about "wtf8 argument parsing", but the way quotes and spaces are handled and arguments are split is entirely unrelated to wtf8.

The UEFI specification itself does not specify anything for arguments. They are just an array of bytes (See OptionalData in Section 3.1.3).

However, UEFI Shell specification does specify some stuff about arguments (See Section 3.4), and that does differ a bit from Windows parsing. So I should probably write a new implementation for UEFI.

I would still like to move the WStrUnits part out from the Windows module, so I will modify this PR accordingly for that.

@Ayush1325 Ayush1325 changed the title Extract windows argument parsing to sys_common Extract WStrUnits to sys_common::wtf8 Nov 22, 2022
@Ayush1325
Copy link
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 22, 2022
@Ayush1325
Copy link
Contributor Author

@m-ou-se Ping

This commit extracts WStrUnits from sys::windows::args to sys_common::wstr. This
allows using the same structure for other targets which use wtf8 (example UEFI).

This was originally a part of rust-lang#100316

Signed-off-by: Ayush Singh <[email protected]>
@m-ou-se m-ou-se changed the title Extract WStrUnits to sys_common::wtf8 Extract WStrUnits to sys_common::wstr Nov 28, 2022
@m-ou-se
Copy link
Member

m-ou-se commented Nov 28, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Nov 28, 2022

📌 Commit 348a058 has been approved by m-ou-se

It is now in the queue for this repository.

@bors bors 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 Nov 28, 2022
@bors
Copy link
Contributor

bors commented Nov 29, 2022

⌛ Testing commit 348a058 with merge 5a64193a8fc0c021b24e31f846e6762ea70fa7ca...

@bors
Copy link
Contributor

bors commented Nov 29, 2022

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 29, 2022
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@Ayush1325
Copy link
Contributor Author

@m-ou-se @bjorn3 I'm not quite sure what happened here. Can someone take a look to see if it is a problem in CI or do I need to do something?

@m-ou-se
Copy link
Member

m-ou-se commented Nov 30, 2022

Looks like a spurious failure.

@bors retry

@bors bors 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 Nov 30, 2022
@bors
Copy link
Contributor

bors commented Dec 1, 2022

⌛ Testing commit 348a058 with merge 1dcf6ad...

@bors
Copy link
Contributor

bors commented Dec 1, 2022

☀️ Test successful - checks-actions
Approved by: m-ou-se
Pushing 1dcf6ad to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 1, 2022
@bors bors merged commit 1dcf6ad into rust-lang:master Dec 1, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 1, 2022
@Ayush1325 Ayush1325 deleted the windows-args branch December 1, 2022 04:37
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1dcf6ad): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-2.3%, -1.2%] 2
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
  Extract WStrUnits to sys_common::wstr

This commit extracts WStrUnits from sys::windows::args to sys_common::wstr. This allows using the same structure for other targets which use wtf8 (example UEFI).

This was originally a part of rust-lang#100316

Signed-off-by: Ayush Singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

7 participants