Skip to content

Amazon Linux 2 Support for Swift Build #441

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

Open
cmcgee1024 opened this issue Apr 25, 2025 · 2 comments
Open

Amazon Linux 2 Support for Swift Build #441

cmcgee1024 opened this issue Apr 25, 2025 · 2 comments

Comments

@cmcgee1024
Copy link
Member

Amazon Linux 2 is a little more challenging to support than other Linux distributions. In particular, there is a missing implementation of posix_spawn_file_actions_addchdir for the version of glibc available there. There could be other issues with Swift Build support for that platform too, but this is the most immediate problem.

@jakepetroules
Copy link
Collaborator

The main thing in Swift Build is our use of Foundation Process (NSTask), which has an implementation of setting the working directory which is NOT thread safe on platforms lacking posix_spawn_file_actions_addchdir (Amazon Linux 2, OpenBSD, QNX, and older Android versions). To solve this we can adopt swift-subprocess, which has a fork/exec fallback path for environments where posix_spawn_file_actions_addchdir is unavailable.

The other one is llbuild's process spawning code, which has a hard dependency on posix_spawn_file_actions_addchdir, and needs to be tracked separately on the llbuild project.

@cmcgee1024
Copy link
Member Author

See swiftlang/swift-llbuild#980 for the llbuild portion.

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

No branches or pull requests

2 participants