Skip to content
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

formula_cellar_checks: detect cpuid in static libs #16380

Merged
merged 1 commit into from Dec 22, 2023

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Dec 21, 2023

  • 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?

Related to Homebrew/homebrew-core#157146 where runtime CPU detection is done inside static library.

Here I am only looking for static libraries directly installed inside lib so will skip any installed into libexec or symlinks whose realpath is outside lib. Also not as accurate as dynamic library detection since only looking for file extension rather than contents.

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.

Makes sense thanks again @cho-m

@MikeMcQuaid MikeMcQuaid merged commit d1625b6 into Homebrew:master Dec 22, 2023
24 checks passed
@@ -324,6 +324,14 @@ def check_cpuid_instruction(formula)
cpuid_instruction?(file, objdump)
end

hardlinks = Set.new
return if formula.lib.directory? && formula.lib.find.any? do |pn|
next false if pn.symlink? || pn.directory? || pn.extname != ".a"
Copy link
Member

Choose a reason for hiding this comment

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

I think we can use ruby-macho to identify static libraries. (Or otherwise parse the header manually...)

@cho-m cho-m deleted the cpuid-in-static-lib branch December 31, 2023 00:41
@github-actions github-actions bot added the outdated PR was locked due to age label Jan 31, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants