File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,11 @@ public struct Packer: Sendable {
147147 let src = URL ( fileURLWithPath: " \( name) .framework/ \( name) " , relativeTo: binDir)
148148 let magic = Data ( " !<arch> \n " . utf8)
149149 let thinMagic = Data ( " !<thin> \n " . utf8)
150- let bytes = try FileHandle ( forReadingFrom: src) . read ( upToCount: magic. count)
150+ guard let bytes = try ? FileHandle ( forReadingFrom: src) . read ( upToCount: magic. count) else {
151+ // if we can't find the binary, it might be a static framework that SwiftPM
152+ // did not copy into the .build directory. we don't need to pack it anyway.
153+ break
154+ }
151155 // if the magic matches one of these it's a static archive; don't embed it.
152156 // https://github.com/apple/llvm-project/blob/e716ff14c46490d2da6b240806c04e2beef01f40/llvm/include/llvm/Object/Archive.h#L33
153157 // swiftlint:disable:previous line_length
Original file line number Diff line number Diff line change @@ -66,6 +66,10 @@ extension ParsableCommand where Self: SendableMetatype {
6666 print ( " Cancelled. " )
6767 self . exit ( )
6868 } catch {
69+ if ProcessInfo . processInfo. environment [ " XTL_DEBUG_ERRORS " ] != nil {
70+ print ( " ERROR DETAILS: " )
71+ print ( String ( reflecting: error) )
72+ }
6973 self . exit ( withError: error)
7074 }
7175 }
You can’t perform that action at this time.
0 commit comments