36 Commits

Author SHA1 Message Date
Alexander Bayandin
f9b4bf9316
CPU: cleanup sysctl_int method
Co-authored-by: Bo Anderson <mail@boanderson.me>
2022-11-16 10:51:59 +00:00
Alexander Bayandin
449b872916
CPU: fix M2 detection 2022-11-15 11:02:56 +00:00
FX Coudert
56bc22c68a
Blizzard and Avalanche appear to be ARMv8.5-A 2021-12-22 16:31:30 +01:00
FX Coudert
405aeac2d8
Add latest CPUs 2021-12-18 22:39:57 +01:00
Mike McQuaid
30a65342e8
Deprecate, disable, delete code for Homebrew 3.2.0
Do the usual deprecation, disable, delete dance for Homebrew 3.2.0.
2021-06-17 11:34:32 +01:00
Claudia
564e21c382
Update CPU families from current machine.h 2020-12-04 16:21:02 +01:00
Claudia
2a197af076
Add CPU family for Apple’s M1 SoC
According to reports, XNU’s CPU family identifier previously used for
the Westmere family (which Homebrew mislabels as the Arrandale family)
is now being reused for one of Apple’s M1 SoC models.

Resolve the conflict by splitting the list of CPU families and adding a
microarchitecture check.

Sources for the values:

- https://github.com/Homebrew/brew/issues/7857#issuecomment-728739049
- https://en.wikipedia.org/wiki/Comparison_of_ARMv8-A_cores
- Direct messages
2020-12-04 16:20:53 +01:00
Markus Reiter
7d9758a05e Fix RuboCop offenses. 2020-11-30 22:50:15 +01:00
Felix Bünemann
f16163c144 Better check for Rosetta 2
This uses the syctl.proc_translated sysctl, which is the Apple
documented way to check for Rosetta 2 environment.
2020-11-22 00:43:03 +01:00
Rylan Polster
dda0dc72a7 format note comments 2020-11-16 02:02:52 +01:00
Mike McQuaid
5afff3f3aa
Handle macOS Homebrew on ARM
- Output `brew doctor` and `brew install` messages noting this configuration is (currently) unsupported and encourage use of Rosetta instead
- Output Rosetta 2 usage in `brew config` on ARM (whether in Rosetta 2 or not)
- Check the architecture of (newly installed) dependencies and ensure they are using the correct architecture.
- Don't allow installing macOS Intel Homebrew in macOS ARM Homebrew default prefix (and vice versa
- Actually write out the architecture of dependencies to the tab rather than generating and throwing them away
- Set and document the expected default prefix for macOS Intel Homebrew, macOS ARM Homebrew (`/opt/homebrew`) and Homebrew on Linux

While we're here:
- Don't say Big Sur is a prerelease version but still make it clear we
  don't support it (yet).
- Don't reference non-existent IRC channel
2020-11-12 17:06:47 +00:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
74d3f0b153 hardware: rename rosetta method. 2020-09-01 14:52:37 +01:00
Misty De Meo
d9135c5a57 CPU: add ability to check for Rosetta
When running within an Intel terminal, `uname -m` and friends return Intel-based
values for compatibility. An Intel shell will also prefer to launch Intel slices of
programs unless the program is ARM-only.

It's an open question how Homebrew should manage running in Intel mode. Should it
continue to behave as though the Mac is Intel-based, like it does now? Should it
recognize it's ARM-based? Either way, it's useful for us to be able to tell whether
the Mac is running under Rosetta or whether it's a real Intel Mac.
2020-09-01 14:52:37 +01:00
Claudia
559d0a91a2
Add CPU family ARMv8.3-A
Darwin 20 adds the CPU family `CPUFAMILY_ARM_VORTEX_TEMPEST`
(aka ARMv8.3-A), which is assigned the identifier of `0x07d34b9f`.

This is relevant for `SystemConfig` in Homebrew.

See also:
https://en.wikipedia.org/wiki/Comparison_of_ARMv8-A_cores
2020-07-06 20:48:46 +02:00
Mike McQuaid
11c875d747
macOS Big Sur tweaks
- output warnings when running on ARM
- require Xcode 12
- use 11.0 as the version number
2020-06-23 14:11:05 +01:00
William Woodruff
acbb213977
mac/hardware: cpu: Use ruby-macho's Intel constant 2020-06-22 21:56:39 -04:00
Misty De Meo
6a3f18b0ae OS::Mac::CPU: add Apple Silicon
Co-authored-by: Shaun Jackman <sjackman@gmail.com>
2020-06-22 12:20:06 -07:00
Jonathan Chang
2dfaebc637 cpu: update for new processor family 2020-04-19 13:26:04 +10:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
1aa8ad09e2
Deprecate macOS versions below Mavericks
And remove all dead/unneeded code.
2019-01-27 12:27:47 +00:00
Mike McQuaid
170c5493a4
Update deprecations
- Add some `odeprecated`
- Make some `odeprecated` now `odisabled`
- Remove `odisabled` code.
- Remove old update migrations
- Remove GCC 4.0 compiler
- Remove Tiger-only code
- Remove 32-bit-only code
- Remove use of LD64
- Remove GCC 4.3 - 4.8 support.
2019-01-08 19:13:46 +00:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Markus Reiter
b91628a614 Refactor Hardware::CPU spec. 2018-04-20 19:11:22 +02:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Shaun Jackman
0ce7a74c58 Hardware::CPU: Implement OS-agnostic methods 2017-12-01 15:18:35 -08:00
Maxim Belkin
de0b93f912
pathname: improvements, cleanups, and new methods
- atomic_write: close file before renaming to prevent error:
  'Device or resource busy'
- ensure_writable: preserve executable bit
- new elf? and dynamic? methods
2017-11-07 14:18:25 -06:00
Dominyk Tiller
9899a5d0a8
mac/hardware/cpu: recognise Kaby Lake
The 2017 MacBook Pro line shipped with Kaby Lake CPUs.
2017-09-05 03:16:18 +01:00
Misty De Meo
944bff4de2 Mac Hardware: provide a more Mac-specific implementation of can_run? 2017-04-15 22:59:55 +08:00
Viktor Szakats
cc8f029f22 secure urls + remove -k from in-doc curl command 2017-03-14 17:27:11 +00:00
Alyssa Ross
9e97eadccb rubocop: trailing comma in multiline method calls
Discussed in
https://github.com/Homebrew/brew/pull/1987/files#r100693581.

This was originally ommitted because it wasn't compatible with Ruby 1.8.
(See https://github.com/Homebrew/legacy-homebrew/pull/48144#r49928971).
2017-02-12 15:11:38 +00:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
11624b9a7d hardware: move generic logic from linux. (#454) 2016-07-06 10:43:54 +01:00
Mike McQuaid
8d995e961f Make hardware code cross-platform. 2016-05-08 16:51:22 +01:00