Skip to content

Conversation

@edymtt
Copy link
Contributor

@edymtt edymtt commented Jun 27, 2025

This is needed in order to build target variants properly with a SwiftDriver that has swiftlang/swift-driver#1856 enabled.

Addresses rdar://154410676

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-emit-variant-module-path ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${SwiftCore_VARIANT_MODULE_TRIPLE}.swiftmodule>")
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-emit-variant-module-path ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${SwiftCore_VARIANT_MODULE_TRIPLE}.swiftmodule>")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
to ensure if behaves as expected
to ensure it behaves as expected
@edymtt edymtt force-pushed the edymtt/nested-swiftmodule-structure-before-cmake-4.1 branch from aad3856 to 33f228a Compare June 27, 2025 20:40
@edymtt edymtt changed the title [Runtimes][SwiftCore] lay down nested swift modules ahead of CMake 4.1 [Runtimes] lay down nested swift modules ahead of CMake 4.1 Jun 27, 2025
@edymtt
Copy link
Contributor Author

edymtt commented Jun 27, 2025

@swift-ci please test

@edymtt edymtt marked this pull request as ready for review June 27, 2025 20:42
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took all the feedback that @compnerd left in #80881, except for the one asking to remove the check for SwiftCore_ENABLE_LIBRARY_EVOLUTION -- both because I don't fully appreciate the background about it, and because this PR has already a lot of refactoring.

This is needed in order to build target variants properly with a SwiftDriver that has swiftlang/swift-driver#1856 Addresses rdar://154410676
@edymtt edymtt force-pushed the edymtt/nested-swiftmodule-structure-before-cmake-4.1 branch from 33f228a to 07f9a31 Compare June 27, 2025 23:12
@edymtt
Copy link
Contributor Author

edymtt commented Jun 27, 2025

@swift-ci please test

Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

LGTM as far as I can tell. Should check with @compnerd as there may be associated changes needed in the swift-installer-scripts repo.

@edymtt
Copy link
Contributor Author

edymtt commented Jun 27, 2025

@swift-ci please smoke test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Jun 27, 2025

@swift-ci please test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Jun 27, 2025

@swift-ci please build toolchain Windows

edymtt added 2 commits June 30, 2025 06:52
This is needed in order to build target variants properly with a SwiftDriver that has swiftlang/swift-driver#1856 Addresses rdar://154410676
… 4.1 This is needed in order to build target variants properly with a SwiftDriver that has swiftlang/swift-driver#1856 Addresses rdar://154410676
@edymtt edymtt force-pushed the edymtt/nested-swiftmodule-structure-before-cmake-4.1 branch from 07f9a31 to 111cfe2 Compare June 30, 2025 13:55
@edymtt
Copy link
Contributor Author

edymtt commented Jun 30, 2025

@swift-ci please smoke test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Jun 30, 2025

@swift-ci please test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Jun 30, 2025

@swift-ci please test Linux

@edymtt
Copy link
Contributor Author

edymtt commented Jun 30, 2025

@swift-ci please build toolchain Windows

@edymtt
Copy link
Contributor Author

edymtt commented Jun 30, 2025

@swift-ci please test Windows

@edymtt
Copy link
Contributor Author

edymtt commented Jun 30, 2025

Still need to cross reference with the installer scripts, but looking at the logs for the build of the Windows toolchain and perusing some local build results, it seems that the installation of experimental products is generating the existing files at the same location, and adding swiftsourceinfo files, e.g.

@@ -1,11 +1,17 @@ -- Install configuration: "Release" -- Installing: T:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/WindowsExperimental.sdk/usr/lib/swift_static/windows/x86_64/libswift_RegexParser.lib +-- Installing: T:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/WindowsExperimental.sdk/usr/lib/swift_static/windows/_RegexParser.swiftmodule -- Installing: T:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/WindowsExperimental.sdk/usr/lib/swift_static/windows/_RegexParser.swiftmodule/x86_64-unknown-windows-msvc.swiftdoc -- Installing: T:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/WindowsExperimental.sdk/usr/lib/swift_static/windows/_RegexParser.swiftmodule/x86_64-unknown-windows-msvc.swiftmodule +-- Installing: T:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/WindowsExperimental.sdk/usr/lib/swift_static/windows/_RegexParser.swiftmodule/x86_64-unknown-windows-msvc.swiftsourceinfo -- Installing: T:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/WindowsExperimental.sdk/usr/lib/swift_static/windows/x86_64/libswift_StringProcessing.lib
@edymtt
Copy link
Contributor Author

edymtt commented Jun 30, 2025

All the phases that target for WindowsExperimental.sdk and AndroidExperimental.sdk seem to build static content under usr/lib/swift_static (except the shims), and I don't see any mention of that path in either android.wxs or windows.wxs

@edymtt edymtt merged commit 5246be5 into swiftlang:main Jul 1, 2025
5 of 6 checks passed
edymtt added a commit to edymtt/swift that referenced this pull request Jul 9, 2025
Before swiftlang#82571, we would generate a binary swiftmodule file at `<build folder>/<module>.swiftmodule`, while now in the same location we generate a directory. Trying an incremental run on top of a build folder generated with the old logic will fail during configuration with an error similar to ``` CMake Error at .../Supplemental/cmake/modules/EmitSwiftInterface.cmake:21 (file): file failed to create directory: .../StringProcessing-build/_RegexParser/_RegexParser.swiftmodule because: File exists ``` To reduce churn in CI and at desk, delete such remnant from the previous logic. Addresses rdar://155466197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants