From 1b9cfc5cbce168502493cca1cad4e1435e44192a Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Wed, 26 Jul 2023 17:05:01 -0700 Subject: [PATCH 1/4] Don't build Interops in binary distributions --- ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift | 4 +++- ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift index 63610e0420b..2a4a9520e85 100755 --- a/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift @@ -128,7 +128,9 @@ struct ModuleMapBuilder { /// to make sure we install the right version and from the right location. private func generate(framework: FrameworkInfo) { let podName = framework.versionedPod.name - let deps = CocoaPodUtils.transitiveVersionedPodDependencies(for: podName, in: allPods) + let deps = CocoaPodUtils.transitiveVersionedPodDependencies(for: podName, in: allPods).filter { + !$0.name.hasSuffix("Interop") + } CocoaPodUtils.installPods(allSubspecList(framework: framework) + deps, inDir: projectDir, diff --git a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift index 29b1b7ddbc8..2e702d5897e 100644 --- a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift @@ -211,7 +211,10 @@ struct ZipBuilder { // build order bugs. // Also AppCheck must be built after other pods so that its restricted architecture // selection does not restrict any of its dependencies. - var sortedPods = podsToBuild.keys.sorted() + var sortedPods = podsToBuild.keys.sorted().filter { + // Don't build header-only Interop pods for binary distributions. + !$0.hasSuffix("Interop") + } sortedPods.removeAll(where: { value in value == "FirebaseAppCheck" @@ -585,7 +588,9 @@ struct ZipBuilder { // it to the destination directory. for podName in installedPods { // Skip the Firebase pod and specifically ignored frameworks. - guard podName != "Firebase" else { + guard podName != "Firebase", + // Interop pods weren't built, so don't try to copy. + !podName.hasSuffix("Interop") else { continue } From a5f85d770a179baa99a6d31c3dcdc5f33029bc20 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 27 Jul 2023 07:01:34 -0700 Subject: [PATCH 2/4] Interops needed for Swift --- ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift index 2e702d5897e..29b1b7ddbc8 100644 --- a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift @@ -211,10 +211,7 @@ struct ZipBuilder { // build order bugs. // Also AppCheck must be built after other pods so that its restricted architecture // selection does not restrict any of its dependencies. - var sortedPods = podsToBuild.keys.sorted().filter { - // Don't build header-only Interop pods for binary distributions. - !$0.hasSuffix("Interop") - } + var sortedPods = podsToBuild.keys.sorted() sortedPods.removeAll(where: { value in value == "FirebaseAppCheck" @@ -588,9 +585,7 @@ struct ZipBuilder { // it to the destination directory. for podName in installedPods { // Skip the Firebase pod and specifically ignored frameworks. - guard podName != "Firebase", - // Interop pods weren't built, so don't try to copy. - !podName.hasSuffix("Interop") else { + guard podName != "Firebase" else { continue } From 64553c93d860772e198b892a2d55270f83b1e9c5 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 27 Jul 2023 07:07:11 -0700 Subject: [PATCH 3/4] update comment --- ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift index 2a4a9520e85..bdb26af3ae2 100755 --- a/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift @@ -129,6 +129,10 @@ struct ModuleMapBuilder { private func generate(framework: FrameworkInfo) { let podName = framework.versionedPod.name let deps = CocoaPodUtils.transitiveVersionedPodDependencies(for: podName, in: allPods).filter { + // Don't include Interop pods in the module map calculation since they shouldn't add anything + // and it uses the platform-independent version of the dependency list, which causes a crash + // for the iOS-only RecaptchaInterop pod when the subsequent code tries to `pod install` it + // for macOS. All this module code should go away when we switch to building dynamic frameworks. !$0.name.hasSuffix("Interop") } From 40890f3aabab0385a73ae3ff3473b2555c9324c1 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 27 Jul 2023 07:32:10 -0700 Subject: [PATCH 4/4] style --- ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift index bdb26af3ae2..a542f938f8b 100755 --- a/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ModuleMapBuilder.swift @@ -132,7 +132,8 @@ struct ModuleMapBuilder { // Don't include Interop pods in the module map calculation since they shouldn't add anything // and it uses the platform-independent version of the dependency list, which causes a crash // for the iOS-only RecaptchaInterop pod when the subsequent code tries to `pod install` it - // for macOS. All this module code should go away when we switch to building dynamic frameworks. + // for macOS. All this module code should go away when we switch to building dynamic + // frameworks. !$0.name.hasSuffix("Interop") }