Skip to content

[6.0] Do not install binary swiftmodule for Darwin #72667

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

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Mar 28, 2024

Explanation: only install swiftinterface for Darwin when building for macOS to support Apple internal configurations
Radar: rdar://124390643
Scope: build logic that installs the swiftmodules in the final location
Risk: low

  • this behaviour is opt in, so all other swiftmodules for all supported platforms are not affected
  • the additional cleanup was needed to make this change more maintanable in the future, and it does not affect functionality

Testing:

  • run compatibility suite to ensure adopters are able to use the swiftinterface
  • spot checked macOS toolchain to ensure only the Darwin binary swiftmodule was removed
  • spot checked Linux toolchain to ensure no binary swiftmodule was removed

Reviewed By: Ian Anderson on #72590

edymtt added 2 commits March 28, 2024 09:32
Also amend the installation code handling macCatalyst to match the one
for regular swiftmodules.

(cherry picked from commit 649618d)
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

(cherry picked from commit 0cac358)
@edymtt edymtt requested a review from a team as a code owner March 28, 2024 17:01
@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2024

@swift-ci please test

@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2024

@swift-ci please test WebAssembly

@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2024

@swift-ci please build toolchain

@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2024

@swift-ci Please Test Source Compatibility Release

@edymtt edymtt added swift 6.0 🍒 release cherry pick Flag: Release branch cherry picks labels Mar 28, 2024
@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2024

The failures in the compatibility suite are the same as the 6.0 job

@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2024

Verified that the Linux toolchain has no swiftmodule changes, and the macOS ones does not have the binary swiftmodules for Darwin:

> diff -u <(pushd swift-6.0-DEVELOPMENT-SNAPSHOT-2024-03-26-a-ubuntu20.04 > /dev/null && find . -name "*.swiftmodule") <(pushd PR-ubuntu2004-6.0 > /dev/null && find . -name "*.swiftmodule")
> diff -u <(pushd swift-6.0-DEVELOPMENT-SNAPSHOT-2024-03-26-a-osx/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-03-26-a-osx-package.pkg > /dev/null && find . -name "*.swiftmodule") <(pushd swift-PR-72667-1203-osx/Library/Developer/Toolchains/swift-PR-72667-1203.xctoolchain/ > /dev/null && find . -name "*.swiftmodule")
--- /dev/fd/11	2024-03-28 15:15:33
+++ /dev/fd/12	2024-03-28 15:15:33
@@ -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
Copy link
Contributor Author

edymtt commented Mar 29, 2024

macOS job has a failure in a sourcekit-lsp test:

/Users/ec2-user/jenkins/workspace/swift-PR-macos/branch-release/6.0/sourcekit-lsp/Tests/SourceKitLSPTests/RenameTests.swift:1146: error: -[SourceKitLSPTests.RenameTests testRenameAfterFileMove] : XCTAssertEqual failed: ("Optional(LanguageServerProtocol.WorkspaceEdit(changes: Optional([file:///private/var/folders/bb/hcrjxg1s0b96pfst0ymhmp240000gn/T/sourcekit-lsp-test-scratch/testRenameAfterFileMove-72C4BAE8/Sources/MyLibrary/caller.swift: [LanguageServerProtocol.TextEdit(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 1, utf16index: 2)..<Position(line: 1, utf16index: 5))), newText: "bar")]]), documentChanges: nil, changeAnnotations: nil))") is not equal to ("Optional(LanguageServerProtocol.WorkspaceEdit(changes: Optional([file:///private/var/folders/bb/hcrjxg1s0b96pfst0ymhmp240000gn/T/sourcekit-lsp-test-scratch/testRenameAfterFileMove-72C4BAE8/Sources/MyLibrary/caller.swift: [LanguageServerProtocol.TextEdit(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 1, utf16index: 2)..<Position(line: 1, utf16index: 5))), newText: "bar")], file:///private/var/folders/bb/hcrjxg1s0b96pfst0ymhmp240000gn/T/sourcekit-lsp-test-scratch/testRenameAfterFileMove-72C4BAE8/Sources/MyLibrary/movedDefinition.swift: [LanguageServerProtocol.TextEdit(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 0, utf16index: 5)..<Position(line: 0, utf16index: 8))), newText: "bar")]]), documentChanges: nil, changeAnnotations: nil))")
Test Case '-[SourceKitLSPTests.RenameTests testRenameAfterFileMove]' failed (9.496 seconds).

Retrying to see if this is transient

@edymtt
Copy link
Contributor Author

edymtt commented Mar 29, 2024

@swift-ci please test macOS

@edymtt edymtt merged commit f7d5395 into swiftlang:release/6.0 Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants