Skip to content

Do not install binary swiftmodule for Darwin #72590

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

Merged

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Mar 26, 2024

This is needed to support Apple internal configurations that would fail
consuming such binary swiftmodule (but work as expected when rebuilding
from the swiftinterface).

Take the chance to cleanup the installation code for stdlib modules -- namely remove duplication and align the macCatalyst logic.

Addresses rdar://124390643

Also amend the installation code handling macCatalyst to match the one
for regular swiftmodules.
@edymtt edymtt requested a review from a team as a code owner March 26, 2024 17:34
@edymtt
Copy link
Contributor Author

edymtt commented Mar 26, 2024

@swift-ci please test

@edymtt
Copy link
Contributor Author

edymtt commented Mar 26, 2024

@swift-ci please test WebAssembly

@edymtt
Copy link
Contributor Author

edymtt commented Mar 26, 2024

@swift-ci please build toolchain

@edymtt edymtt requested review from etcwilde, compnerd and ian-twilightcoder and removed request for a team March 26, 2024 17:35
@edymtt
Copy link
Contributor Author

edymtt commented Mar 26, 2024

Discussed this with Evan offline -- the long term solution would be to leverage the -sysroot option that is being proposed in #72352, this PR would serve as a short term solution while the above is being discussed.

@compnerd
Copy link
Member

Does it make sense to invert the flag and add an install Swift module flag instead?

@edymtt edymtt force-pushed the edymtt/no-darwin-binary-swiftmodule-in-toolchain branch from c5ddf9f to cd17f74 Compare March 27, 2024 17:44
@edymtt
Copy link
Contributor Author

edymtt commented Mar 27, 2024

@compnerd: yes, it makes sense -- I was focused on getting something out to gauge my approach, and I was tempted by using the option to get the default value for free.

Reworked this in cd17f74 (with some added logic to make the installation the default action)

This is needed to support Apple internal configurations that would fail
consuming such binary swiftmodule (but work as expected when rebuilding
from the swiftinterface).

Addresses rdar://124390643
@edymtt edymtt force-pushed the edymtt/no-darwin-binary-swiftmodule-in-toolchain branch from cd17f74 to 0cac358 Compare March 27, 2024 17:57
@edymtt
Copy link
Contributor Author

edymtt commented Mar 27, 2024

@swift-ci please test

@edymtt
Copy link
Contributor Author

edymtt commented Mar 27, 2024

@swift-ci please test WebAssembly

@edymtt
Copy link
Contributor Author

edymtt commented Mar 27, 2024

@swift-ci please build toolchain

@edymtt
Copy link
Contributor Author

edymtt commented Mar 27, 2024

@swift-ci Please Test Source Compatibility Release

@edymtt
Copy link
Contributor Author

edymtt commented Mar 27, 2024

@swift-ci please clean test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Mar 27, 2024

The source compatibility suite has the same 9 failures of the main run.

@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2024

Verified this has no changes for the Linux toolchain, and only Darwin binary swiftmodules are dropped in the macOS one:

> diff -u <(pushd swift-DEVELOPMENT-SNAPSHOT-2024-03-27-a-ubuntu18.04 > /dev/null  && find . -name "*.swiftmodule" ) <(pushd PR-ubuntu2004 > /dev/null  && find . -name "*.swiftmodule")
> diff -u <(pushd swift-DEVELOPMENT-SNAPSHOT-2024-03-27-a-osx/swift-DEVELOPMENT-SNAPSHOT-2024-03-27-a-osx-package.pkg/ > /dev/null && find . -name "*.swiftmodule") <(pushd swift-PR-72590-1200-osx/Library/Developer/Toolchains/swift-PR-72590-1200.xctoolchain/ > /dev/null && find . -name "*.swiftmodule")
--- /dev/fd/11	2024-03-28 08:00:38
+++ /dev/fd/12	2024-03-28 08:00:38
@@ -72,8 +72,6 @@
 ./usr/lib/swift/appletvsimulator/_StringProcessing.swiftmodule/arm64-apple-tvos-simulator.swiftmodule
 ./usr/lib/swift/appletvsimulator/_StringProcessing.swiftmodule/x86_64-apple-tvos-simulator.swiftmodule
 ./usr/lib/swift/appletvsimulator/Darwin.swiftmodule
-./usr/lib/swift/appletvsimulator/Darwin.swiftmodule/arm64-apple-tvos-simulator.swiftmodule
-./usr/lib/swift/appletvsimulator/Darwin.swiftmodule/x86_64-apple-tvos-simulator.swiftmodule
 ./usr/lib/swift/appletvsimulator/RegexBuilder.swiftmodule
 ./usr/lib/swift/appletvsimulator/RegexBuilder.swiftmodule/arm64-apple-tvos-simulator.swiftmodule
 ./usr/lib/swift/appletvsimulator/RegexBuilder.swiftmodule/x86_64-apple-tvos-simulator.swiftmodule
@@ -126,8 +124,6 @@
 ./usr/lib/swift/watchos/_StringProcessing.swiftmodule/arm64_32-apple-watchos.swiftmodule
 ./usr/lib/swift/watchos/_StringProcessing.swiftmodule/armv7k-apple-watchos.swiftmodule
 ./usr/lib/swift/watchos/Darwin.swiftmodule
-./usr/lib/swift/watchos/Darwin.swiftmodule/arm64_32-apple-watchos.swiftmodule
-./usr/lib/swift/watchos/Darwin.swiftmodule/armv7k-apple-watchos.swiftmodule
 ./usr/lib/swift/watchos/RegexBuilder.swiftmodule
 ./usr/lib/swift/watchos/RegexBuilder.swiftmodule/arm64_32-apple-watchos.swiftmodule
 ./usr/lib/swift/watchos/RegexBuilder.swiftmodule/armv7k-apple-watchos.swiftmodule
@@ -168,8 +164,6 @@
 ./usr/lib/swift/iphoneos/_StringProcessing.swiftmodule/arm64e-apple-ios.swiftmodule
 ./usr/lib/swift/iphoneos/_StringProcessing.swiftmodule/arm64-apple-ios.swiftmodule
 ./usr/lib/swift/iphoneos/Darwin.swiftmodule
-./usr/lib/swift/iphoneos/Darwin.swiftmodule/arm64e-apple-ios.swiftmodule
-./usr/lib/swift/iphoneos/Darwin.swiftmodule/arm64-apple-ios.swiftmodule
 ./usr/lib/swift/iphoneos/RegexBuilder.swiftmodule
 ./usr/lib/swift/iphoneos/RegexBuilder.swiftmodule/arm64e-apple-ios.swiftmodule
 ./usr/lib/swift/iphoneos/RegexBuilder.swiftmodule/arm64-apple-ios.swiftmodule
@@ -206,7 +200,6 @@
 ./usr/lib/swift/appletvos/_StringProcessing.swiftmodule
 ./usr/lib/swift/appletvos/_StringProcessing.swiftmodule/arm64-apple-tvos.swiftmodule
 ./usr/lib/swift/appletvos/Darwin.swiftmodule
-./usr/lib/swift/appletvos/Darwin.swiftmodule/arm64-apple-tvos.swiftmodule
 ./usr/lib/swift/appletvos/RegexBuilder.swiftmodule
 ./usr/lib/swift/appletvos/RegexBuilder.swiftmodule/arm64-apple-tvos.swiftmodule
 ./usr/lib/swift/appletvos/Observation.swiftmodule
@@ -242,9 +235,6 @@
 ./usr/lib/swift/watchsimulator/_StringProcessing.swiftmodule/i386-apple-watchos-simulator.swiftmodule
 ./usr/lib/swift/watchsimulator/_StringProcessing.swiftmodule/arm64-apple-watchos-simulator.swiftmodule
 ./usr/lib/swift/watchsimulator/Darwin.swiftmodule
-./usr/lib/swift/watchsimulator/Darwin.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule
-./usr/lib/swift/watchsimulator/Darwin.swiftmodule/i386-apple-watchos-simulator.swiftmodule
-./usr/lib/swift/watchsimulator/Darwin.swiftmodule/arm64-apple-watchos-simulator.swiftmodule
 ./usr/lib/swift/watchsimulator/RegexBuilder.swiftmodule
 ./usr/lib/swift/watchsimulator/RegexBuilder.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule
 ./usr/lib/swift/watchsimulator/RegexBuilder.swiftmodule/i386-apple-watchos-simulator.swiftmodule
@@ -294,8 +284,6 @@
 ./usr/lib/swift/macosx/_StringProcessing.swiftmodule/arm64-apple-macos.swiftmodule
 ./usr/lib/swift/macosx/_StringProcessing.swiftmodule/x86_64-apple-macos.swiftmodule
 ./usr/lib/swift/macosx/Darwin.swiftmodule
-./usr/lib/swift/macosx/Darwin.swiftmodule/arm64-apple-macos.swiftmodule
-./usr/lib/swift/macosx/Darwin.swiftmodule/x86_64-apple-macos.swiftmodule
 ./usr/lib/swift/macosx/RegexBuilder.swiftmodule
 ./usr/lib/swift/macosx/RegexBuilder.swiftmodule/arm64-apple-macos.swiftmodule
 ./usr/lib/swift/macosx/RegexBuilder.swiftmodule/x86_64-apple-macos.swiftmodule
@@ -404,8 +392,6 @@
 ./usr/lib/swift/iphonesimulator/_StringProcessing.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
 ./usr/lib/swift/iphonesimulator/_StringProcessing.swiftmodule/arm64-apple-ios-simulator.swiftmodule
 ./usr/lib/swift/iphonesimulator/Darwin.swiftmodule
-./usr/lib/swift/iphonesimulator/Darwin.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
-./usr/lib/swift/iphonesimulator/Darwin.swiftmodule/arm64-apple-ios-simulator.swiftmodule
 ./usr/lib/swift/iphonesimulator/RegexBuilder.swiftmodule
 ./usr/lib/swift/iphonesimulator/RegexBuilder.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
 ./usr/lib/swift/iphonesimulator/RegexBuilder.swiftmodule/arm64-apple-ios-simulator.swiftmodule

@edymtt edymtt merged commit 93d64e9 into swiftlang:main Mar 28, 2024
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.

4 participants