-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
std: restructure child process namespace #20049
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
Conversation
|
Exciting! |
squeek502
left a comment
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.
Added a commit that improves the doc comments of some functions since they are now actually exposed (they were pub before but not exposed from any standard library namespace).
I think this is fine as-is, but want to note that while argvToCommandLineWindows/argvToScriptCommandLineWindows/WindowsCommandLineCache are technically usable outside the context of process.Child, not too much thought went into their API for that purpose. IMO it would be equally valid to stick them in process.Child and make them non-pub, but I don't have strong feelings one way or the other.
76af53b to
1842b6d
Compare
|
Ah, I didn't realize they were not actually exposed. In that case, I would rather move them into Child.zig and make them private. Is that okay with you? |
Yep, definitely. There are quite a few nuances with them vis-a-vis BatBadBut. You can leave |
1842b6d to
f47824f
Compare
|
Crap. I accidentally clobbered your commits @squeek502 - would you mind adding them back? Edit: never mind, I still have them in my other zig checkout :-) |
Upgrade guide:
Some other functions are also moved from
std.ChildProcesstostd.processnamespace.In the future there will be even more breaking changes. For example, instead of creating a Child and then setting fields on it and then calling spawn, there will be
std.process.spawnwhich takes an "options" parameter and then returns the Child, which is an object that lasts only from spawn until termination. This is a practice that we have been moving more towards in Zig, which is to have types designed to have minimal lifetimes and minimal states with undefined fields.