Skip to content

Commit eabc6df

Browse files
committed
Restore explanatory comments
1 parent 34c9d80 commit eabc6df

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Sources/PackLib/Packer.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,13 @@ public struct Packer: Sendable {
147147
let resolvedName = frameworkName ?? findFrameworkName(for: name, in: binDir) ?? name
148148
let src = URL(fileURLWithPath: "\(resolvedName).framework/\(resolvedName)", relativeTo: binDir)
149149
guard FileManager.default.fileExists(atPath: src.path) else {
150+
// if we can't find the binary, it might be a static framework that SwiftPM
151+
// did not copy into the .build directory. we don't need to pack it anyway.
150152
break
151153
}
154+
// if the binary is a static archive, don't embed it.
155+
// https://github.com/apple/llvm-project/blob/e716ff14c46490d2da6b240806c04e2beef01f40/llvm/include/llvm/Object/Archive.h#L33
156+
// swiftlint:disable:previous line_length
152157
if !isStaticBinary(at: src) {
153158
try await packFile(
154159
srcName: "\(resolvedName).framework",

0 commit comments

Comments
 (0)