Skip to content

Commit c0304ae

Browse files
committed
[SDK] Fix circularity issues with overlay shim headers.
Loading a Clang module eagerly brings in overlays for anything it re-exports, but this is a problem for these new "shim header" modules, which generally import the underlying module for an overlay and are in turn imported by the overlay. That means that when we try to import an overlay, we'll end up with a circular reference before it's done loading all its dependencies. Break the cycle by not exporting anything from these modules, which are mostly just an implementation detail anyway.
1 parent 1589ca1 commit c0304ae

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

stdlib/public/SwiftShims/module.modulemap

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,29 @@ module SwiftShims {
1717
export *
1818
}
1919

20+
// Various headers used to build overlays on Apple platforms.
21+
// Note: These deliberately do not use "export *" to avoid circularity issues
22+
// (overlay -> shims -> framework -> overlay)
23+
// FIXME: These are only needed when building each overlay; they declare no
24+
// types and therefore would not strictly need to be present in an installed
25+
// Swift.
26+
// FIXME: These are not used at all on non-Apple platforms.
2027
module _SwiftObjectiveCOverlayShims {
2128
header "ObjectiveCOverlayShims.h"
22-
export *
2329
}
2430

2531
module _SwiftOSOverlayShims {
2632
header "OSOverlayShims.h"
27-
export *
2833
}
2934

3035
module _SwiftSafariServicesOverlayShims {
3136
header "SafariServicesOverlayShims.h"
32-
export *
3337
}
3438

3539
module _SwiftXCTestOverlayShims {
3640
header "XCTestOverlayShims.h"
37-
export *
3841
}
3942

4043
module _SwiftXPCOverlayShims {
4144
header "XPCOverlayShims.h"
42-
export *
4345
}

0 commit comments

Comments
 (0)