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

Process / NSTask #309

Open
iCharlesHu opened this issue Nov 8, 2023 · 3 comments
Open

Process / NSTask #309

iCharlesHu opened this issue Nov 8, 2023 · 3 comments
Assignees
Milestone

Comments

@iCharlesHu
Copy link
Contributor

iCharlesHu commented Nov 8, 2023

We need to reimagine what Process should look like in Swift. Most likely we will introduce a new type.

rdar://118127512

@iCharlesHu iCharlesHu self-assigned this Nov 8, 2023
@iCharlesHu iCharlesHu added this to the Late 2023 milestone Nov 8, 2023
@Frizlab
Copy link

Frizlab commented Nov 8, 2023

FWIW, I did some work on launching a Process in Swift. It’s probably not what I’d want in Foundation as-is, but it can give some ideas.

https://github.com/xcode-actions/XcodeTools/blob/main/Sources/XcodeTools/Process/ProcessInvocation.swift

On the top of my head, my main pain points were (unordered):

  • No possibilities of sending file descriptors to the child;
  • No easy streaming of process output (bonus, w/ fd differentiation);
  • PGID is different on child process (and there is no option to change that);
  • Process does not search for the executable in PATH for non-absolute paths.

There are other problems with the current API of course, but they are more obvious.

@compnerd
Copy link
Member

I think that one thing that I would like to bring up while this is early in the process - Windows likes to throw a stupid wrench into this :(. The environment control block should be case insensitive. This is particularly important for Path (vs PATH) and any possible case variant which should be treated equivalently.

@iCharlesHu
Copy link
Contributor Author

Pitch is up: #397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants