Skip to content

[5.8] Do not chdir before calling posix_spawn #4761

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

Closed
wants to merge 9 commits into from

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Jun 13, 2023

Cherry-pick of #4606.

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

Lukasa added 9 commits June 13, 2023 18:01
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.
@MaxDesiatov MaxDesiatov requested review from parkera and tomerd June 13, 2023 17:04
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

MaxDesiatov added a commit to swiftlang/swift-corelibs-xctest that referenced this pull request Jun 14, 2023
We're seeing sporadic CI failures, since apparently some nodes don't have `python` symlinking to a correct Python version. Changing this to `python3` will also make it consistent with the rest of the Python scripts in the Swift project.

Unblocks macOS CI for swiftlang/swift-corelibs-foundation#4761.
@MaxDesiatov MaxDesiatov deleted the maxd/chdir-5.8 branch July 26, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants