-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Driver: honour -sdk
even on Darwin
#26361
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
base: main
Are you sure you want to change the base?
Conversation
If `-resource-dir` is passed, it takes precedence. If the user specifies `-sdk` that should find content in that SDK. Generalise this to Darwin as well.
@swift-ci please test macOS platform |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct. All builds on Darwin use SDKs, always.
The right answer is to better distinguish compiler resource content from platform content, or to fall back to the SDK if a particular platform isn't in the compiler resource dir. |
@jrose-apple hmm, am I mistaken in that didn't Darwin start pulling the resource content from the SDK? So, that sounds like we would diverge the Darwin and non-Darwin paths. Also, do we want to make |
Darwin started putting some resource dir content in the SDK in addition to what's in the compiler directory, not replacing it. In particular, the compiler directory still has
Basically, it's not that the resource directory is "the directory where the stdlib can be found"; it's that the directory where the stdlib can be found used to just be the resource directory and now it's both the resource directory and the SDK. |
Okay, that sounds reasonable. (Personally, I think that we should be minimising the content of the resource directory - it doesn't scale well especially as you get into the cross-compilation scenarios where platforms other than Darwin do not have fat binaries.) The behaviour of
As to the content, I think what the other platforms currently need is:
The split that makes sense on non-Darwin platforms IMO is something like this:
Does that sound reasonable to you? |
Darwin isn't going to draw a distinction between "SDK" and "sysroot". Do we really need one for other platforms? I do agree about minimizing the content of the resource dir, and I think that's the direction we're going with Darwin too. We just haven't gotten there completely yet. |
Yeah, sadly, I think that the other platforms will need that distinction :-(. I don't think that we want to get into the business of trying to repackage the Windows SDK and shipping it (which may have additional constraints). The Linux side, again, the question is, do we really want to get into repackaging the distributions content? Remember that Ubuntu and Fedora and anything else are technically incompatible, so you need a different SDK per Linux distribution and architecture :/ |
Okay, so next question: without ABI stability, there's no module stability, and without module stability everything in the SDK is tied to the compiler anyway. So why not put it in the compiler resource dir? Even if you have to install it separately. (I think the main answer so far is "one kind of Linux cross-compiling to another Linux" but I wonder if that just means we should organize the resource dir differently.) |
An interesting idea - so you are proposing that on all the non-Darwin platforms we go the exact opposite of what we really want and expand the resource dir to be as large as possible? That still won't work for the Linux cross-compilation scenario. One more thing ... this also doesn't work on the same Linux distro even! With distributions now providing an alternative of glibc with musl, we need multiple resource directory even for every linux distribution. Honestly, at that point the difference between resource dir and SDK really becomes nomenclature and flags. I personally would prefer that we don't diverge on this point and that we continue to minimise the compiler resource dir for all targets. If you don't like SDK, that is something we can work around by having another flag. We could restore I really want to start investigating the possibility of getting ABI stability on other targets, we are pretty close to having Foundation be at parity on Windows, Linux, and android. The work that @millenomi is doing to enable the parity with macOS is getting us much closer to having functional equivalence across the platforms. |
Okay, I want to finish up the discussion here about the way forward, but, in the mean time, I'm going to merge #26388 which effectively reverts #25990 and will perform the cascading search. But, the proper approach for the longer term thing is something to actually pin down so that we can address that. |
Yeah, maybe we should bring this to the forums. You've made the case (effectively, again) for three relevant directories, but we need to decide what they are and how they work in all the various scenarios. |
UPDATE: Usage of the flags Can you please also have a look on comment to already merged PR: #25990 (comment) It is about compile error when using Swift compiler (made during cross-compilation on macOS host). Thank you! |
If
-resource-dir
is passed, it takes precedence. If the user specifies-sdk
that should find content in that SDK. Generalise this to Darwin as well.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.