Skip to content

linkage_checker: allow cyan extras#21740

Merged
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
devnoname120:dev/cyan-extras-linkage-exception
Mar 15, 2026
Merged

linkage_checker: allow cyan extras#21740
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
devnoname120:dev/cyan-extras-linkage-exception

Conversation

@devnoname120
Copy link
Contributor

This is necessary because cyan injects in an IPA some frameworks that link to iOS system frameworks. These system frameworks are not on macOS but they are not needed because the IPA is to be sideloaded on an iPhone, these frameworks will never be used on macOS itself.

This is required to fix Homebrew/homebrew-core#271929 CI.

  • 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 lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Copilot AI review requested due to automatic review settings March 15, 2026 17:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Homebrew’s linkage checker allowlist to accommodate cyan’s bundled IPA “extras” that reference iOS-only system frameworks (not present on macOS), preventing false-positive broken-linkage failures in CI.

Changes:

  • Refactors broken_dylibs_allowed? to gate by formula name via a case.
  • Adds a cyan-specific path matcher to allow broken dylibs under site-packages/cyan/extras/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devnoname120 devnoname120 force-pushed the dev/cyan-extras-linkage-exception branch from fdf5bce to 04ee99f Compare March 15, 2026 17:38
This is necessary because cyan injects in an IPA some frameworks that link to iOS system frameworks. These system frameworks are not on macOS but they are not needed because the IPA is to be sideloaded on an iPhone, these frameworks will never be used on macOS itself.

This is required to fix Homebrew/homebrew-core#271929 CI.
@devnoname120 devnoname120 force-pushed the dev/cyan-extras-linkage-exception branch from 04ee99f to 168e058 Compare March 15, 2026 17:39
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.

Thanks!

Could these dylibs be either 1) stripped or 2) moved to a location that the linkage checker doesn't look (can't remember if this is a thing or not, excuse me if it isn't) instead?

@devnoname120
Copy link
Contributor Author

devnoname120 commented Mar 15, 2026

@MikeMcQuaid Unfortunately no…

  1. The checker reads Mach-O load commands. Stripping the frameworks would just remove symbols/debug info, not linkage entries, so the missing iOS framework refs would still be reported.

Code ref:

lcs = macho.dylib_load_commands

  1. The checker walks through the whole keg so there is no path where I could sneak the frameworks so that it wouldn’t look at them.

The checker logic for ignoring things:

@keg.find do |file|
next if file.symlink? || file.directory?
file = begin
BinaryPathname.wrap(file)
rescue NotImplementedError
next
end
next if !file.dylib? && !file.binary_executable? && !file.mach_o_bundle?
next unless file.arch_compatible?(Hardware::CPU.arch)
# weakly loaded dylibs may not actually exist on disk, so skip them
# when checking for broken linkage
keg_files_dylibs[file] =
file.dynamically_linked_libraries(except: :DYLIB_USE_WEAK_LINK)

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.

Thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Mar 15, 2026
@devnoname120
Copy link
Contributor Author

@MikeMcQuaid Thank you!

Merged via the queue into Homebrew:main with commit 4c56c9a Mar 15, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants