-
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
Mutate command args #87420
Mutate command args #87420
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
r? @joshtriplett - I feel like I saw some T-libs discussion of these APIs recently. FWIW it'd be ideal to integrate more context into the PR description (presuming I'm recalling correctly that this context exists). |
I didn't know under what circumstances github makes automatic links/references. Usually I made this explicit, but just forgotten to do on the PR request itself. First discussion is on: https://internals.rust-lang.org/t/lack-of-api-mutating-args-at-std-command/14908 |
☔ The latest upstream changes (presumably #89414) made this pull request unmergeable. Please resolve the merge conflicts. |
f42c400
to
54ca0e2
Compare
I think I remember this being discussed elsewhere, but I don't remember the outcome:
|
Ping from triage: |
As discussed in https://internals.rust-lang.org/t/lack-of-api-mutating-args-at-std-command/14908/6
I could imagine a .set_program_name() member function. This would be made more portable to OS'es which support this in other ways. Question is if it should go into this PR or being another ticket/PR since that would some more investigation/work how to make it portable and I haven't thought about what to do if such is not supported (rust emulation, conditional API, some Ext trait, runtime error result, ...).
Ok I'll remove that later today. I wasn't sure if its a nice to have or unnecessary. |
54ca0e2
to
f71c15b
Compare
how do i set S-waiting-on-review ? |
Like this: |
☔ The latest upstream changes (presumably #90042) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
These errors exist in upstream I merged, not being introduced by this PR. Will try to merge or rebase again when that becomes fixed. |
2178fa4
to
a25c983
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #90784) made this pull request unmergeable. Please resolve the merge conflicts. |
see rust-lang#87379 Only unix implementation yet.
Only unix implementation yet.
We do not want to set argv[0] here. This needs to be asserted at any time. Assertion for the index within range is only a debug_assert becasue its a mere helpful error message, indexing later would assert on out of range access anyway.
This reverts commit 626d0e71b1e82c4804cec1a2bd03c3c53e4368ad. * removes 'args_new()' as requested in rust-lang#87420 (comment) * still disallow argv0 mutation as I explained in rust-lang#87420 (comment)
a25c983
to
45d1780
Compare
Had some f*ckup with submodule hashes slipped into the commit. Fixed now, ready to merge. |
@joshtriplett this is ready for review |
r? @rust-lang/libs-api |
I'm not convinced we should have this at all. Even the existing @rust-lang/libs-api - Does anyone else think we should have this? |
closing this based on the last comment |
Finished implementation, the 'windows' bits are untested by me, i hope they pass the CI. Otherwise, awaiting comments.