187 Commits

Author SHA1 Message Date
Mike McQuaid
41e94afda5
Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01:00
Mike McQuaid
2b6e580636
ENV/super: add shims_path helper method.
This allows us to stop repeatedly hardcoding this on macOS/Linux in
formulae.
2021-09-08 12:35:36 +01:00
Carlo Cabrera
2599cccc81
Add comment for in-source style exception 2021-07-08 19:16:39 +01:00
Carlo Cabrera
ebeb9e7e90
Define O1 and O0 methods separately 2021-07-08 10:56:36 +01:00
Carlo Cabrera
b37e574ad3
Fix typecheck error 2021-07-08 09:19:11 +01:00
Carlo Cabrera
b0b521001e
extend/ENV/super: allow O{1,0} to accept a block
This makes `ENV.O{1,0}` behave like `ENV.deparallelize`.

This should also allow us to build libgcrypt's jitter entropy collector,
which we currently disable because it interacts poorly with our compiler
shims. See #11201.
2021-07-08 08:59:47 +01:00
Carlo Cabrera
0404da7ba7
superenv: handle formulae with runtime CPU detection
Some formulae are able to detect the features of the runtime CPU, and
execute code accordingly. This typically entails 1) the detection of
features of the build-time CPU in order to determine the targets that
the compiler can generate code for, and 2) generating code for the
targets that the compiler can support.

Our filtering of optimization flags can cause misdetection of compiler
features, leading to failed builds [1], and miscompilation even when the
build does not fail [2].

Let's try to fix this by allowing formulae to declare
`ENV.runtime_cpu_detection` which skips the filtering of `-march` and
related flags.

I've also skipped the filtering of the optimisation
level, since it seems to me that if upstream maintainers have gone to
the lengths of writing code that detects runtime hardware, they probably
also know better about appropriate `-O` flags to use.

This is a partial list of formulae that should make use of this feature:
1. apache-arrow
2. fftw
3. gromacs
4. open-mpi
5. openblas

Partially resolves Homebrew/homebrew-core#76537.

[1] open-mpi/ompi#8306 and linked issues/PRs
[2] Homebrew/homebrew-core#76537
2021-07-01 16:24:38 +01:00
danielnachun
bd88f3d857 super: fix GCC issues 2021-05-31 11:17:00 -07:00
Carlo Cabrera
e893f16727
extend/ENV/super: allow bottles with custom architectures
Currently, Homebrew recognises only the architectures listed in
`hardware.rb`. [1] Attempting to pass an unrecognised architecture to
`--bottle-arch` while building a bottle returns an error.

Let's change that by passing unrecognised bottle arches to the compiler
instead of immediately failing with a `CannotInstallFormulaError`.

Partially resolves #5815.

[1] 64b6846d60/Library/Homebrew/hardware.rb (L28-L42)
2021-05-09 11:01:48 +01:00
Mike McQuaid
d73351251c
Deprecate, disable, delete code for next major/minor version.
Do the usual dance for bumping our major/minor version.
2021-04-09 09:30:36 +01:00
Carlo Cabrera
e8452de418
extend/ENV/super: set M4 for libtool
[g]libtoolize looks for m4 using the environment variable M4. When
that isn't set, it looks for m4 in PATH.

However, when libtool is a build dependency but m4 is not, m4 will
not be found in PATH. Since it is currently not set in the
environment by superenv, this causes some builds to fail.

Closes https://github.com/Homebrew/homebrew-core/pull/73932.
2021-03-26 14:32:09 +00:00
Carlo Cabrera
f6eba3c1ea
extend/ENV/super: remove M4
Building automake fails with autoconf 2.70+, when autoconf is used with
macOS m4. It therefore makes sense for autoconf to depend on brewed m4.

However, without the change proposed here, the setting of the M4
environment variable in superenv breaks the automake build.

Related: https://github.com/Homebrew/homebrew-core/pull/73797
2021-03-24 13:14:58 +00:00
Bo Anderson
65c03573c6
ENV: fix missing arg for generic OS and correct type sigs 2021-02-26 18:23:48 +00:00
Mike McQuaid
39b3bcdce4
Undeprecate ENV.O1/ENV.O0
These are still used in Homebrew/homebrew-core. The others are either
- default (Os on macOS, O2 on Linux)
- less reliable than the default (O3)

While we're here, also remove an outdated `ncurses_define` comment.
2021-02-08 11:11:21 +00:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00:00
Seeker
fbafaff4fe rubocop: require braces for Sorbet sig 2021-01-18 16:52:45 -08:00
Mike McQuaid
74fb058c7e
More deprecations
More deprecations, disabling and removal for Homebrew 2.7.0.
2020-12-18 14:17:37 +00:00
Mike McQuaid
87dd13aea6
Deprecate cask requirements.
This probably has to wait until 2.7.0 now and will require a bunch of
formula changes/deprecations but we should probably start moving in this
direction given we're not installing any of these on our CI any more.
2020-12-15 14:19:45 +00:00
Markus Reiter
0424940496 Add types for ENV extensions. 2020-11-23 02:06:37 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Mike McQuaid
3bea3a6953
Merge pull request #9055 from EricFromCanada/apidoc-improvements
Launder comments for improved rubydoc output
2020-11-06 09:45:42 +00:00
Jonathan Chang
65ae58282f Fix type inference error
Tapioca doesn't like identical argument names.
2020-11-06 17:54:34 +11: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
Markus Reiter
e3646c9b4e Remove unneeded back-references. 2020-09-19 02:03:56 +02:00
Markus Reiter
276c570c16 Pass individual args explicitly to ENV extensions. 2020-07-28 02:52:45 +02:00
Markus Reiter
25b3632c4c Pass args to ENV instead of using global args. 2020-07-25 03:57:43 +02:00
Mike McQuaid
f951ea83d4
Fix brew style. 2020-07-07 12:23:29 +01:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00: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
7e13b37495
ENV: default CFLAGS to bottle values.
This reduces the deviation in compilation flags on a given OS between
users and between bottling/not bottling to provide a consistent
behaviour for debugging and support.
2019-01-06 21:27:15 +00:00
Mike McQuaid
e6e534157c
ENV/super: copy Hackintosh comment from ENV/std. 2018-12-20 20:09:45 +00:00
Shaun Jackman
4addff3b2b determine_optflags: Default is -march=native 2018-10-03 11:41:39 -07:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Maxim Belkin
67ea581e4a
extend/ENV/shared.rb: [new method] append_to_cccfg
append_to_cccfg properly appends values to HOMEBREW_CCCFG variable
2018-07-12 12:20:38 -05:00
Maxim Belkin
bb82f05952
Properly append values to HOMEBREW_CCCFG 2018-07-12 12:19:04 -05:00
Mike McQuaid
14364bbaee extend/ENV: support CX11 for LLVM Clang.
Fix some checks for `:clang` which should match for either `:clang` or
`:llvm_clang`. Note that's not every check.
2018-07-05 20:15:57 +01:00
Shaun Jackman
9f8f8ffb89 superenv: Move Linux-specific bits to extend/os/ 2018-05-30 14:00:26 -07:00
Shaun Jackman
76bfd0cecb Add superenv for Linux 2018-05-18 16:58:21 -07:00
Mike McQuaid
9b1bd5f45a system_config: don’t output std/superenv vars. 2018-04-02 09:40:39 +01:00
Mike McQuaid
740e89d2f3
super: tweak LLVM refactoring. 2018-03-07 15:00:08 +00:00
Mike McQuaid
7cb6ebf3fb
super: refactor LLVM path addition. 2018-03-06 08:44:47 +00:00
Alex Wang
7b94842610 Split ternary for PATH building into if/else cases 2018-02-28 09:26:15 -05:00
Alex Wang
bfa474857a Add macOS libs ahead of brewed llvm libs in lib search path
This ensures that libraries that are built with brewed LLVM but not
included in the Command Line Tools/Xcode (e.g. libomp) can be found
during a build, while still using system libraries for the essential
stuff (e.g. libc++)
2018-02-26 18:35:34 -05:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Andrew Yates
980db9d3fb Remove errant pkg-config libdir
We found an issue in Linuxbrew/homebrew-core#3366 where the addition of "/usr/lib/pkg-config" causes compilation issues if system pkg-config files are in that directory on Linux. Removing the line from here and adding it into the mac superenv.
2017-08-03 10:44:56 +01:00
Mike McQuaid
7a0aff1080 Autocorrect Rubocop Style/PerlBackrefs. 2017-06-10 20:23:20 +03:00