Skip to content

cask/audit: also check binary for minimum OS #20119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025

Conversation

EricFromCanada
Copy link
Member

@EricFromCanada EricFromCanada commented Jun 16, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Adds logic to audit_min_os for checking the load commands in an application's binary for its minimum macOS requirement if not specified by LSMinimumSystemVersion of its Info.plist. It does this by fetching from Info.plist the binary path, ensuring it exists and is not a shell script (e.g. wings3d), then looks in each slice for LC_VERSION_MIN_MACOSX (older SDKs) or LC_BUILD_VERSION (newer SDKs) for their minimum macOS version value, and returns the lowest value found. This will surface a few more minimum OS suggestions for casks that don't define any, e.g. alacritty (multi-arch download) and contour (arch-specific downloads).

Since this audit checks more than Info.plist, changed plist_ references to bundle_.

Expect this audit to warn about:

But as this is a strict audit, these won't trip up CI.

@EricFromCanada EricFromCanada added the cask Homebrew Cask label Jun 16, 2025
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart! Love the idea.

@EricFromCanada EricFromCanada marked this pull request as ready for review June 17, 2025 03:58
@EricFromCanada EricFromCanada added this pull request to the merge queue Jun 17, 2025
Merged via the queue into master with commit 09eaf14 Jun 17, 2025
33 checks passed
@EricFromCanada EricFromCanada deleted the audit-bundle-version branch June 17, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cask Homebrew Cask
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants