Skip to content

Commit 030559a

Browse files
authored
fix(macho): Downgrade codesigning failures to a warning (#275)
This turned out to cause problems with certain exotic dylibs. We should allow this to be caught by the consumer for recovery. refs Homebrew/brew#8922
1 parent ad8f8e0 commit 030559a

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

lib/macho.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ def self.codesign!(filename)
5656
"--preserve-metadata=entitlements,requirements,flags,runtime",
5757
filename)
5858

59-
raise ModificationError, "#{filename}: signing failed!" unless $CHILD_STATUS.success?
59+
raise CodeSigningError, "#{filename}: signing failed!" unless $CHILD_STATUS.success?
6060
end
6161
end

lib/macho/exceptions.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ class MachOError < RuntimeError
99
class ModificationError < MachOError
1010
end
1111

12+
# Raised when codesigning fails. Certain environments
13+
# may want to rescue this to treat it as non-fatal.
14+
class CodeSigningError < MachOError
15+
end
16+
1217
# Raised when a Mach-O file modification fails but can be recovered when
1318
# operating on multiple Mach-O slices of a fat binary in non-strict mode.
1419
class RecoverableModificationError < ModificationError

0 commit comments

Comments
 (0)