Skip to content
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

[Explicit Module Builds] Add support for header dependencies of binary Swift module dependencies #1375

Merged
merged 1 commit into from Jun 14, 2023

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jun 12, 2023

When we encounter a pre-built Swift binary module dependency (without an interface file), such module may have been built with a bridging header, which must still be present and is referenced by the binary .swiftmodule as either a .h or, more-likely, a pre-built .pch in a fully-explicit build.

Clients must be able to know about such header dependencies in order to be able to import this binary module, because this binary module may be referencing types brought in via its bridging header. The build-system client (swift-driver) will then ensure these header dependencies are fed as inputs to all requiring compilation tasks.

This adds support to the driver to query such header dependencies and feed them as inputs to all requiring compilation tasks.

Companion change to apple/swift#66556

@artemcm
Copy link
Contributor Author

artemcm commented Jun 12, 2023

@swift-ci test

@artemcm artemcm force-pushed the TransitivePCHDepsOfBinaryModules branch from c772569 to adb2f2c Compare June 13, 2023 13:57
@artemcm
Copy link
Contributor Author

artemcm commented Jun 13, 2023

@swift-ci test

Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a comment.

@@ -228,6 +228,14 @@ private extension SwiftScan {
try getOptionalPathDetail(from: moduleDetailsRef,
using: api.swiftscan_swift_binary_detail_get_module_source_info_path)

let headerDependencies: [TextualVirtualPath]?
if supportsBinaryModuleHeaderDependencies {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to do this check as getOptionalPathArrayDetails will return the same result?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, thanks.

Copy link
Member

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me! Do we have a radar tracking the issue?

@artemcm
Copy link
Contributor Author

artemcm commented Jun 13, 2023

Changes look good to me! Do we have a radar tracking the issue?

rdar://109426410

@artemcm artemcm force-pushed the TransitivePCHDepsOfBinaryModules branch from adb2f2c to f4b528e Compare June 13, 2023 17:32
@artemcm
Copy link
Contributor Author

artemcm commented Jun 13, 2023

@swift-ci test

@artemcm artemcm force-pushed the TransitivePCHDepsOfBinaryModules branch from f4b528e to d2d781a Compare June 13, 2023 19:52
@artemcm
Copy link
Contributor Author

artemcm commented Jun 13, 2023

@swift-ci test

…y Swift module dependencies

When we encounter a pre-built Swift binary module dependency (without an interface file), such module may have been built with a bridging header, which must still be present and is referenced by the binary .swiftmodule as either a .h or, more-likely, a pre-built .pch in a fully-explicit build.

Clients must be able to know about such header dependencies in order to be able to import this binary module, because this binary module may be referencing types brought in via its bridging header. The build-system client (swift-driver) will then ensure these header dependencies are fed as inputs to all requiring compilation tasks.

This adds support to the driver to query such header dependencies and feed them as inputs to all requiring compilation tasks.
@artemcm
Copy link
Contributor Author

artemcm commented Jun 14, 2023

@swift-ci test

@artemcm artemcm force-pushed the TransitivePCHDepsOfBinaryModules branch from d2d781a to 754672e Compare June 14, 2023 17:42
@artemcm
Copy link
Contributor Author

artemcm commented Jun 14, 2023

@swift-ci test

@artemcm artemcm merged commit 9e78be1 into apple:main Jun 14, 2023
3 checks passed
@artemcm artemcm deleted the TransitivePCHDepsOfBinaryModules branch June 14, 2023 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants