-
Notifications
You must be signed in to change notification settings - Fork 96
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
Comments
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. |
See swiftlang/swift-llbuild#980 for the llbuild portion. |
The underlying llbuild issue was resolved, and #545 (#551 for 6.2) unskipped all of the relevant tests. There are a 4 tests which are still skipped because they use Foundation.Process instead of llbuild, but those are test-only issues and don't impact build operations. There is also a workaround in place for parts of task construction which also go through Foundation.Process rather than llbuild:
I think I'll leave this open until those pieces are fully resolved too. |
This fully resolves working directory thread safety issues with subprocess spawning across all platforms. For now, subprocess is adopted conditionally in order to continue building in certain environments where the Subprocess module may not be available, in which case we fall back to Foundation Process. Closes #441
This fully resolves working directory thread safety issues with subprocess spawning across all platforms. For now, subprocess is adopted conditionally in order to continue building in certain environments where the Subprocess module may not be available, in which case we fall back to Foundation Process. Closes #441
This fully resolves working directory thread safety issues with subprocess spawning across all platforms. For now, subprocess is adopted conditionally in order to continue building in certain environments where the Subprocess module may not be available, in which case we fall back to Foundation Process. Closes #441
This fully resolves working directory thread safety issues with subprocess spawning across all platforms. For now, subprocess is adopted conditionally in order to continue building in certain environments where the Subprocess module may not be available, in which case we fall back to Foundation Process. Closes #441
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.
The text was updated successfully, but these errors were encountered: