Skip to content

Commit 879d0b4

Browse files
authored
Fix module name for Promises and Protobuf (#10073)
1 parent ef9dcd4 commit 879d0b4

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

.github/workflows/zip.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
"${HOME}"/ios_frameworks/Firebase/FirebaseRemoteConfig/* \
124124
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseCore.xcframework \
125125
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseCoreInternal.xcframework \
126-
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/PromisesObjC.xcframework \
126+
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FBLPromises.xcframework \
127127
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseInstallations.xcframework \
128128
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/GoogleUtilities.xcframework
129129
- name: Install Secret GoogleService-Info.plist

FirebaseCore/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Firebase 9.5.0
2+
- [fixed] Zip Distribution Fixed Promises module name issue impacting lld builds. (#10071)
3+
14
# Firebase 9.4.1
25
- [fixed] Swift Package Manager only release to fix a 9.4.0 tagging issue impacting some users. (#10083)
36

ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,12 @@ struct FrameworkBuilder {
277277
}
278278

279279
// TODO: Automatically get the right name.
280-
/// The dynamic framework name is different from the pod name when the module_name
280+
/// The module name is different from the pod name when the module_name
281281
/// specifier is used in the podspec.
282282
///
283-
/// - Parameter framework: The name of the framework to be built.
284-
/// - Returns: The corresponding dynamic framework name.
285-
private func frameworkBuildName(_ framework: String) -> String {
286-
if !dynamicFrameworks {
287-
return framework
288-
}
283+
/// - Parameter framework: The name of the pod to be built.
284+
/// - Returns: The corresponding framework/module name.
285+
private static func frameworkBuildName(_ framework: String) -> String {
289286
switch framework {
290287
case "PromisesObjC":
291288
return "FBLPromises"
@@ -311,10 +308,12 @@ struct FrameworkBuilder {
311308
var thinFrameworks = [URL]()
312309
for targetPlatform in TargetPlatform.allCases {
313310
let buildDir = projectDir.appendingPathComponent(targetPlatform.buildName)
314-
let slicedFramework = buildSlicedFramework(withName: framework,
315-
targetPlatform: targetPlatform,
316-
buildDir: buildDir,
317-
logRoot: logsDir)
311+
let slicedFramework = buildSlicedFramework(
312+
withName: FrameworkBuilder.frameworkBuildName(framework),
313+
targetPlatform: targetPlatform,
314+
buildDir: buildDir,
315+
logRoot: logsDir
316+
)
318317
thinFrameworks.append(slicedFramework)
319318
}
320319
return thinFrameworks
@@ -339,18 +338,19 @@ struct FrameworkBuilder {
339338

340339
// Create the framework directory in the filesystem for the thin archives to go.
341340
let fileManager = FileManager.default
342-
let frameworkDir = outputDir.appendingPathComponent("\(framework).framework")
341+
let frameworkName = FrameworkBuilder.frameworkBuildName(framework)
342+
let frameworkDir = outputDir.appendingPathComponent("\(frameworkName).framework")
343343
do {
344344
try fileManager.createDirectory(at: frameworkDir, withIntermediateDirectories: true)
345345
} catch {
346-
fatalError("Could not create framework directory while building framework \(framework). " +
346+
fatalError("Could not create framework directory while building framework \(frameworkName). " +
347347
"\(error)")
348348
}
349349

350350
// Find the location of the public headers, any platform will do.
351351
guard let anyPlatform = targetPlatforms.first,
352352
let archivePath = slicedFrameworks[anyPlatform] else {
353-
fatalError("Could not get a path to an archive to fetch headers in \(framework).")
353+
fatalError("Could not get a path to an archive to fetch headers in \(frameworkName).")
354354
}
355355

356356
// Get the framework Headers directory. On macOS, it's a symbolic link.
@@ -401,7 +401,7 @@ struct FrameworkBuilder {
401401
"\(headersDestination): \(error)")
402402
}
403403
// Add an Info.plist. Required by Carthage and SPM binary xcframeworks.
404-
CarthageUtils.generatePlistContents(forName: framework,
404+
CarthageUtils.generatePlistContents(forName: frameworkName,
405405
withVersion: podInfo.version,
406406
to: frameworkDir)
407407

@@ -417,10 +417,10 @@ struct FrameworkBuilder {
417417
framework])
418418

419419
guard let moduleMapContentsTemplate = podInfo.moduleMapContents else {
420-
fatalError("Module map contents missing for framework \(framework)")
420+
fatalError("Module map contents missing for framework \(frameworkName)")
421421
}
422422
let moduleMapContents = moduleMapContentsTemplate.get(umbrellaHeader: umbrellaHeader)
423-
let frameworks = groupFrameworks(withName: framework,
423+
let frameworks = groupFrameworks(withName: frameworkName,
424424
isCarthage: setCarthage,
425425
fromFolder: frameworkDir,
426426
slicedFrameworks: slicedFrameworks,
@@ -650,7 +650,8 @@ struct FrameworkBuilder {
650650
frameworks: [URL],
651651
xcframeworksDir: URL,
652652
resourceContents: URL?) -> URL {
653-
let xcframework = xcframeworksDir.appendingPathComponent(name + ".xcframework")
653+
let xcframework = xcframeworksDir
654+
.appendingPathComponent(frameworkBuildName(name) + ".xcframework")
654655

655656
// The arguments for the frameworks need to be separated.
656657
var frameworkArgs: [String] = []

0 commit comments

Comments
 (0)