-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Update ucrt.modulemap for Windows SDK 10.0.26100 #79751
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
Update ucrt.modulemap for Windows SDK 10.0.26100 #79751
Conversation
@swift-ci please smoke test |
@swift-ci please test Windows platform |
1 similar comment
@swift-ci please test Windows platform |
a4293de
to
fbf4b6b
Compare
@swift-ci please smoke test |
fbf4b6b
to
2e24d71
Compare
@swift-ci please test Windows platform |
|
Windows SDK 10.0.26100 added an include to compiler intrinsics headers in `wchar.h`. In turn, these headers include `malloc.h`, `stdlib.h` and `stddef.h` from `ucrt`, this leads to a cyclic dependency between the `ucrt` and compiler intrinsics modules. These changes separate the 3 headers (`malloc.h`, `stdlib.h` and `stddef.h`) into 3 different standalone modules.
Pull in corecrt in the `_complex` module as well. While the simple test case worked for this modularisation, the build of `CRT` on the older WinSDK would fail as: ``` C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\complex.h:12:10: error: 'corecrt.h' file not found 10 | #define _COMPLEX 11 | 12 | #include <corecrt.h> | `- error: 'corecrt.h' file not found 13 | 14 | #if (_CRT_HAS_CXX17 == 1) && !defined(_CRT_USE_C_COMPLEX_H) C:/Users/swift-ci/jenkins/workspace/swift-PR-windows/swift/stdlib/public/Platform/ucrt.swift:15:19: error: could not build C module '_complex' 13 | @_exported import ucrt // Clang module 14 | // Extra clang module that's split out from ucrt: 15 | @_exported import _complex | `- error: could not build C module '_complex' 16 | 17 | @available(swift, deprecated: 3.0, message: "Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting.") ```
These modules needed to be split up to allow for resolving circularity. Add exports for the new standalone modules to repair expectations.
The headers already add `extern "C"` blocks.
2e24d71
to
6920af6
Compare
@swift-ci please test Windows platform |
The header can include `<ccomplex>`.
@swift-ci please test Windows platform |
These are not needed
@swift-ci please test Windows platform |
1 similar comment
@swift-ci please test Windows platform |
@swift-ci please test Windows platform |
@swift-ci please smoke test Linux platform |
@swift-ci please smoke test macOS platform |
We should cherry-pick this into release/6.1. cc: @Steelskin @compnerd |
Cherry-pick from pull request swiftlang#79751
Here is the cherry-pick: #80144 |
This was removed in swiftlang#79751 but is required in some cases.
These were split out in swiftlang#79751. However, this split is not needed for these. Furthermore, modulemaps have bugs when it comes to re-exporting some modules, resulting in missing exports.
There are now fixes to compnerd/swift-build#909 and swiftlang/swift#79751, swiftlang/swift#80144 is merged.
* enable swift build since swiftlang/swift-package-manager#6644 is fixed * update compnerd/gha-setup-swift to v0.3.0 * use latest Windows and Swift 6.1 There are now fixes to compnerd/swift-build#909 and swiftlang/swift#79751, swiftlang/swift#80144 is merged. * enable building WinUIBackend * specify which target to build to avoid missing Gtk
Windows SDK 10.0.26100 added an include to compiler intrinsics headers in
wchar.h
. In turn, these headers includemalloc.h
,stdlib.h
andstddef.h
fromucrt
, this leads to a cyclic dependency between theucrt
and compiler intrinsics modules. Furthermore, Clang 19 (from Swift 6.1) intrinsics headers sometimes clash with the ucrt headers dependencies.These changes separate the problematic headers into different standalone modules.
Fixes: compnerd/swift-build#909
Fixes: #79745