Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
16b01d6e
Unverified
Commit
16b01d6e
authored
3 years ago
by
Carlo Cabrera
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #11737 from carlocab/audit-arches
formula_cellar_checks: check keg for mismatched arches
parents
4c3a8c7e
d696250d
No related branches found
Branches containing commit
Tags
3.2.3
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Library/Homebrew/formula_cellar_checks.rb
+19
-0
19 additions, 0 deletions
Library/Homebrew/formula_cellar_checks.rb
Library/Homebrew/os/linux/elf.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/os/linux/elf.rb
Library/Homebrew/os/mac/mach.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/os/mac/mach.rb
with
21 additions
and
2 deletions
Library/Homebrew/formula_cellar_checks.rb
+
19
−
0
View file @
16b01d6e
...
...
@@ -314,6 +314,24 @@ module FormulaCellarChecks
"No `cpuid` instruction detected.
#{
formula
}
should not use `ENV.runtime_cpu_detection`."
end
def
check_binary_arches
(
formula
)
return
unless
formula
.
prefix
.
directory?
# There is no `binary_executable_or_library_files` method for the generic OS
return
if
!
OS
.
mac?
&&
!
OS
.
linux?
keg
=
Keg
.
new
(
formula
.
prefix
)
mismatches
=
keg
.
binary_executable_or_library_files
.
reject
do
|
file
|
file
.
arch
==
Hardware
::
CPU
.
arch
end
return
if
mismatches
.
empty?
<<~
EOS
Binaries built for a non-native architecture were installed into
#{
formula
}
's prefix.
The offending files are:
#{
mismatches
*
"
\n
"
}
EOS
end
def
audit_installed
@new_formula
||=
false
...
...
@@ -334,6 +352,7 @@ module FormulaCellarChecks
problem_if_output
(
check_plist
(
formula
.
prefix
,
formula
.
plist
))
problem_if_output
(
check_python_symlinks
(
formula
.
name
,
formula
.
keg_only?
))
problem_if_output
(
check_cpuid_instruction
(
formula
))
problem_if_output
(
check_binary_arches
(
formula
))
end
alias
generic_audit_installed
audit_installed
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/os/linux/elf.rb
+
1
−
1
View file @
16b01d6e
...
...
@@ -33,7 +33,7 @@ module ELFShim
private_constant
:ARCHITECTURE_POWERPC
ARCHITECTURE_ARM
=
0x28
private_constant
:ARCHITECTURE_ARM
ARCHITECTURE_X86_64
=
0x
62
ARCHITECTURE_X86_64
=
0x
3E
private_constant
:ARCHITECTURE_X86_64
ARCHITECTURE_AARCH64
=
0xB7
private_constant
:ARCHITECTURE_AARCH64
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/os/mac/mach.rb
+
1
−
1
View file @
16b01d6e
...
...
@@ -29,7 +29,7 @@ module MachOShim
machos
.
each
do
|
m
|
arch
=
case
m
.
cputype
when
:x86_64
,
:i386
,
:ppc64
then
m
.
cputype
when
:x86_64
,
:i386
,
:ppc64
,
:arm64
,
:arm
then
m
.
cputype
when
:ppc
then
:ppc7400
else
:dunno
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment