-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Dependency Scanning] By-default do not specify '-fmodule-map-file' inputs on Swift interface dependency compilation jobs #72599
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
[Dependency Scanning] By-default do not specify '-fmodule-map-file' inputs on Swift interface dependency compilation jobs #72599
Conversation
…ift interface dependency compilation jobs Swift interfaces will only ever query module inputs by-name, so parsing modulemap files to resolve their headers is not necessary.
This only remove the option from building interface. Do you need to drop the option from |
Unfortunately, not yet. Furthermore, in its current state this change is not safe. There are two possible cases of this:
(2) I will implement shortly in this PR. |
…encies of bridging headers, direct or transitive On all '.swiftinterface' command-line recipes, ensure we specify '-fmodule-map-file=' argument for each module which is a dependency of a header input of all swift binary module dependnecies, direct and transitive
@swift-ci test |
I am not sure about why bridging header needs a module map? Should the importer already sets up all the explicit modules including the ones needed by bridging header? |
Bridging headers require a module map because that's what aids header include resolution. Once we are able to switch to eager module loading, this will no longer be necessary because we will instead be relying on module maps serialized into PCMs. |
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.
Thank you!
Swift interfaces will only ever query module inputs by-name, so parsing modulemap files to resolve their headers is not necessary. The exception to this is textual header ingestion directly into the Swift compiler (
ClangImporter
). Because then the compiler may need to resolve header includes to the corresponding module (.pcm
) inputs. This requires explicitly-specified module maps, until we switch to eager module loading.This occurs when there is a a dependency on a binary Swift module, which was built with a bridging header, and this bridging header was serialized into the
.swiftmodule
and must be ingested by all clients. In this case, we must ensure that all clients of said binary module, direct and transitive, are passed-fmodule-map-file=
flags corresponding to dependencies of said header.