-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Do not chdir before calling posix_spawn #4606
Conversation
@swift-ci please test |
Woof, compile failures. I'll try to chase this up. |
@swift-ci please test |
Blocked by swiftlang/swift#59643. |
Please test with swiftlang/swift#59643 |
LGTM |
@swift-ci please test |
1 similar comment
@swift-ci please test |
@Lukasa this would be nice to get into 5.6.3: https://forums.swift.org/t/development-open-for-swift-5-6-3-for-linux-and-windows/58859 Can we get CI green so its mergable? |
I'll do my best but I'm running into awkwardness around the headers that I'll need to fix. |
@Lukasa this would be nice to get into 5.7 Can we get CI green so its mergable and brought over the the 5.7 branch? |
We allow users to set the working directory of the child process when they use the Process API. Unfortunately, this was implemented by calling chdir in the parent process, which has nasty global effects on the process and cannot safely be used concurrently. glibc has a non-POSIX extension to posix_spawn that can call chdir in the child process, so we add that call instead where it's available, and add a regression test.
90c21f5
to
4811dbb
Compare
@swift-ci test |
I've brought this up to date with |
@tomerd how would you like to manage backporting this? |
@swift-ci test windows |
@swift-ci test |
i would love to see this in 5.9 and even back ported to 5.8 |
There's a build regression related to this change on Ubuntu: #4762 |
This reverts commit 16c4269.
We allow users to set the working directory of the child process when
they use the Process API. Unfortunately, this was implemented by calling
chdir in the parent process, which has nasty global effects on the
process and cannot safely be used concurrently.
glibc has a non-POSIX extension to posix_spawn that can call chdir in
the child process, so we add that call instead where it's available, and
add a regression test.
Resolves swiftlang/swift#59610