-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Frontend: correct -sdk
search paths for !Darwin
#25902
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
Conversation
@swift-ci please test |
Shouldn't this just be the architecture and not the platform? The latter should already be part of the SDK, no? |
Yes, it really should be. However, unfortunately, the current CMake installation image doesn't construct that properly. I want to get that moved over, but couldn't figure out how to make that work. I really want to move the other targets over to the module as a directory approach so that we have the multiple architectures supported. |
I think we currently treat SDKs on non-Darwin platform as sysroots. Is this going to be compatible with that interpretation? Do we want to install our runtime libraries to platform- and architecture-specific directories on non-Darwin platforms? |
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 definitely needs tests before we can merge it.
@compnerd and I have talked a little about the sysroot aspect before, and one of the conclusions was that this is more useful for cross compilation than having to ship an SDK and a resource directory…especially when most of the normal resource directory can be shared. |
@brentdax - a sysroot doesn't work on all targets. Particularly Windows, the sysroot wont work since there is no concept of sysroot. Android also does not have a sysroot but a set of paths that need to be configured. It seems better to just standardise on this. The SDK here comprises of all the swift pieces that are needed and lets you be agnostic to the root of the system. |
@brentdax, @jrose-apple Im happy to add a test case for this but I don't see a good way to add a test case for this. Particularly for the case where we are doing cross-compilation. |
Maybe you can set up a dummy resource dir and a dummy SDK and then try to get as far as |
Hmm, wont that try to load the swift module? If so, it would fail, since we cannot have a valid swift module for a foreign target. |
|
But if you use |
Right, but you can import other things from the same path using normal |
77b0219
to
725cb48
Compare
@brentdax @jrose-apple okay, I managed to come up with a tricky test case |
@swift-ci please test |
Build failed |
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.
Thanks!
725cb48
to
d758a9a
Compare
@swift-ci please test |
Build failed |
Build failed |
d758a9a
to
c2d7918
Compare
@swift-ci please test and merge |
This adjusts the runtime library import paths to add the OS/architecture subdirectory to the path. This allows the use of `-sdk` with the compiler to target Android and Windows as well (and Linux). The SDK image is identical to that generated by the current CMake setup without the host tools. Ideally, we would change the layout for the modules on other targets to be identical to the Darwin layout which converts to OS/<module>/architecture.<extension> rather than OS/architecture/<module>.<extension>.
c2d7918
to
f3655ed
Compare
@swift-ci please test and merge |
This adjusts the runtime library import paths to add the OS/architecture
subdirectory to the path. This allows the use of
-sdk
with thecompiler to target Android and Windows as well (and Linux). The SDK
image is identical to that generated by the current CMake setup without
the host tools. Ideally, we would change the layout for the modules on
other targets to be identical to the Darwin layout which converts to
OS//architecture. rather than
OS/architecture/..
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.