Skip to content

Commit

Permalink
Merge pull request #17577 from SMillerDev/feat/audit/check_cask_binar…
Browse files Browse the repository at this point in the history
…y_32_bit
  • Loading branch information
SMillerDev authored Jun 28, 2024
2 parents 9f58612 + 203049b commit a40f327
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Library/Homebrew/cask/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,20 @@ def audit_rosetta
add_error "No binaries in App: #{artifact.source}", location: cask.url.location if files.empty?
system_command("lipo", args: ["-archs", files.first], print_stderr: false)
when Artifact::Binary
system_command("lipo", args: ["-archs", path], print_stderr: false)
binary_path = path.to_s.gsub(cask.appdir, tmpdir)
system_command("lipo", args: ["-archs", binary_path], print_stderr: true)
else
add_error "Unknown artifact type: #{artifact.class}", location: cask.url.location
end

unless result.success?
add_error "Failed to determine artifact architecture!", location: cask.url.location
# binary stanza can contain shell scripts, so we just continue if lipo fails.
next unless result.success?

odebug result.merged_output

unless /arm64|x86_64/.match?(result.merged_output)
add_error "Artifacts architecture is no longer supported by macOS!",
location: cask.url.location
next
end

Expand Down

0 comments on commit a40f327

Please sign in to comment.