-
Notifications
You must be signed in to change notification settings - Fork 10.5k
The stdlib build currently only allows setting a single threading library type, even for multiple stdlibs #59568
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
I was a little surprised that I hadn't dealt with this already because I thought I remembered looking at the CMake code and deciding that we needed to do something about cross compile builds where multiple stdlibs were involved. It turns out that I did intend for this to work, but got a couple of details wrong — #59589 should hopefully fix it. I'd be very grateful if you could try it with your Android armv7 test case and make sure it works for you. If it doesn't, then there's clearly more wrong than I think. |
I don't think that pull is going to fix it, as you're still only applying a single threading package to all stdlibs. I have a couple questions:
I'm unclear on some of this thread library selection logic, please let me know your intent. |
So |
There is another variable I'd added, |
I'll update that PR with some more fixes once I've tested that they don't break everything. |
Right. I've updated my PR if you'd like to take a look (but please review it there, rather than here, otherwise things just get confusing). |
I don't think that's a good idea, would be better to make it a list like
That would work for overriding cross-compilation for now. The biggest issue is that your intended threading library auto-detect mode doesn't work currently, that is the main fix needed: the overrides are just nice to have. |
Confirmed that #59606 fixes this issue by trying it with various overrides, thanks for adding the list of overrides too. |
Describe the bug
Since #59287, it is possible to set a threading library for the Swift stdlib with
SWIFT_THREADING_PACKAGE
, which is set to the host platform by default. However, the current config builds all stdlibs with a single type of threading library, which can be overridden with the flag--swift-threading-package
but still applies to every stdlib. Since it's possible to cross-compile multiple non-host stdlibs, this won't work if any of them need a different threading library, though it's fine if they're all Darwin platforms with the same type of threading library, say macOS and iOS.To Reproduce
Expected behavior
You should be able to build multiple stdlibs against different types of threading libraries.
Environment:
Additional context
I just ran into this because the Android armv7 stdlib built fine on the community Android armv7 CI, but failed on my Android CI. I dug into it and it's because the host SDK on the community CI is
LINUX
so it applies that threading library to Android armv7 too, based on the default logic linked above. My own Android CI doesn't build for the linux host though, only for Android armv7 with the flags--cross-compile-hosts=android-armv7 --skip-local-build
, so the host default logic chooses pthreads for the Android host and fails for armv7 only, as pthreads doesn't support 32-bit here.In this case, it so happens that this issue is getting the Android build to pass, but in general, it's not a good idea to build all stdlibs against only one type of threading library.
The text was updated successfully, but these errors were encountered: