-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Bootstrapping0: copy all the legacy layouts for the host platform #60724
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
Bootstrapping0: copy all the legacy layouts for the host platform #60724
Conversation
@swift-ci please test |
@swift-ci please build toolchain |
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.
When do we use a stage-0 compiler to cross compile? Shouldn't all of the layouts only be needed for the final compiler? Is this related to "Add a flag to infer appropriate cross compile hosts on Darwin"? Even under those circumstances, we should really only be doing the cross-compile with final compiler.
I am assuming this was a real issue uncovered after fixing #60664 (but unrelated to it) My initial explanation is indeed imprecise -- we are using the final compiler but forcibly overriding the resource dir This seems intentional according to
|
PR description has now been updated to reflect the real situation. |
Yes; this line right here would do it https://github.com/apple/swift/blob/67b23d7d45f12aec288ec80a9ddc6a91b68123ac/SwiftCompilerSources/CMakeLists.txt#L107 Okay, I think given that, we only need to copy the stage-0 bootstrap legacy files. |
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.
I wonder if we could get away without the copying by computing additional paths. Copying should be cheap enough, but something to consider as a possible optimization thought for the build.
When cross compiling we are forcing the usage of the resource directory from the bootstrapping0 compiler to ensure we are picking up the stdlib from the SDK. As a result we need to ensure to have legacy layouts for all the architectures in that folder. Addresses rdar://98899578
21699b3
to
daf6858
Compare
I took the feedback from Evan to do this only for bootstrapping0 -- that should also partially address the concern from Saleem in the short term. Not sure how easy would be to skip the copy altogether -- I vaguely remember the compiler assuming some files are in the resource dir and not having much configuration around that, but I would need to research this a bit better. |
@swift-ci please test |
@swift-ci please build toolchain |
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; that is definitely a bit better. I suspect that it would be nice to figure out how to wire up an additional parameter to control -resource-dir
for the compiler invocation. However, that doesn't need to be addressed currently and perhaps can be done as part of a larger effort.
I seem to remember this particular swath of code with regard to the lookup of the legacy layouts; https://github.com/apple/swift/blob/8d03c68a8a61212d7cfed464e397e6379ed65b2f/lib/IRGen/GenType.cpp#L1415-L1469 |
…iftlang#60724) When cross compiling we are forcing the usage of the resource directory from the bootstrapping0 compiler to ensure we are picking up the stdlib from the SDK. As a result we need to ensure to have legacy layouts for all the architectures in that folder. Addresses rdar://98899578
When cross compiling we are forcing the usage of the resource directory from
the bootstrapping0 compiler to ensure we are picking up the stdlib from
the SDK.
As a result we need to ensure to have legacy layouts for all the
architectures in that folder.
Addresses rdar://98899578