372 Commits

Author SHA1 Message Date
Carlo Cabrera
1d9ee93e6e
Apply suggestions from code review
Co-authored-by: Bo Anderson <mail@boanderson.me>
2022-09-21 23:05:00 +08:00
Carlo Cabrera
e9bcab6986
extend/ENV/std: ignore fails_with during brew test.
The compiler used to a build a formula is typically not needed during
the test.

This will allow us to get rid of some `:test` dependencies, which were
added to prevent `brew` from throwing a `CompilerSelectionError` because
the formula declares `fails_with` the default compiler.

This also helps us get more accurate results from `brew linkage` in
cases of unintended linkage with the compiler used to build.

Fixes #11795.
2022-09-21 22:55:42 +08:00
Carlo Cabrera
fb4c6d92bc
Merge pull request #13677 from carlocab/python-libexec
ENV/super: add Python's `libexec/"bin"` directory when applicable
2022-08-15 18:47:02 +08:00
Carlo Cabrera
8064a39c18
Prefer newer versions of Python
Some formulae declare multiple Python dependencies, and they can appear
in any order in the `deps` array. Let's make sure to prefer the newest
one when adding their `libexec/"bin"` directory to `PATH`.
2022-08-15 18:18:21 +08:00
Carlo Cabrera
999623b45d
ENV/super: add Python's libexec/"bin" directory when applicable
When Homebrew/homebrew-core#107517 is merged, builds will no longer be
able to find `python@3.9` as `python3`. This is also what is likely to
happen to `python@3.10` when we add a `python@3.11`.

This is likely to break many builds, so let's make sure they can keep
finding a `python3` for formulae that don't have a dependency on the
latest Python3.

This is arguably something we should've done earlier: it also means that
builds that go looking for an unversioned `python` end up finding our
Python3 (whenever present in the build environment) instead of, say,
`/usr/bin/python` which is typically Python2.
2022-08-10 22:51:44 +08:00
Lukas Oberhuber
cd9fe97c55 Improve style 2022-07-30 11:10:26 +01:00
Lukas Oberhuber
22b1b61b73 Fix brew typecheck 2022-07-26 19:36:43 +01:00
Lukas Oberhuber
6551b25b07 Compile with symbols when requested on all plats 2022-07-26 17:56:11 +01:00
Lukas Oberhuber
c2a95f077f Compiler -g flag set based on --debug-symbols 2022-07-26 17:18:01 +01:00
Lukas Oberhuber
d195f22522 Connecting up --debug-symbols flag
This connects the calling of dsymutil and the retention of temporary
files. Still need to connect compilation to flag.
2022-07-26 12:15:53 +01:00
Lukas Oberhuber
74dd365a56 Hardcoded symbol production
Needs to be toggled by the `--debug-symbols` flag instead of hard coded
2022-07-26 12:13:38 +01:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Rylan Polster
2e6b6ab3a2
Fix style 2021-12-24 21:15:21 -05:00
Douglas Eichelberger
65f1766497 Remove unknown YARD tags 2021-11-30 08:01:20 -08:00
Evan Phoenix
b5ccf8aac2 Do not pass -Wl,-headerpad_max_install_names to b-linux-path
One of the more curious bugs, if you use
-Wl,-headerpad_max_install_names on linux, it tries to link a library
named "eaderpath_max_install_names" in, which causes all kinds of weird
havoc.

Most notably, gtester inside glib fails to run for bizarre reasons.
-Wl,-headerpad_max_install_names is not an option anywhere outside macos
anyway, so move it to macos only and avoid the heartache of extremely
weild bugs.
2021-11-09 20:38:26 -08:00
Bo Anderson
4836ea0ba2
Remove XQuartz handling 2021-11-05 12:40:22 +00:00
Bo Anderson
30b24cf4ad
Use HOMEBREW_CURL universally, including formulae 2021-10-04 02:03:04 +01:00
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
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
danielnachun
bd88f3d857 super: fix GCC issues 2021-05-31 11:17:00 -07:00
Carlo Cabrera
734defb1a9
Merge pull request #11352 from carlocab/custom-arch
extend/ENV/super: allow bottles with custom architectures
2021-05-10 14:30:41 +01:00
Bo Anderson
1e567161d1
ENV/shared: specify which Perl version we want to use 2021-05-10 05:50:02 +01: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
Mike McQuaid
6c68e4bcb9
Merge pull request #10432 from iMichka/shared2
ENV.shared: deprecate ncurses_define
2021-01-27 08:55:10 +00:00
Michka Popoff
acb77e71f9 ENV.shared: deprecate ncurses_define
This was only used by 2 formuale in homebrew-core.
One formula did not need the flag anymore and the flag was removed
The other formula (rogue) still needs it, the flag was directly
added to the formula.

There is no reason for us to keep this method.
2021-01-26 23:09:57 +01:00
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
EricFromCanada
571179ff0e pass second argument to ohai when applicable 2021-01-26 15:36:43 -05:00
Seeker
fbafaff4fe rubocop: require braces for Sorbet sig 2021-01-18 16:52:45 -08:00
Jonathan Chang
9f9903f80d Publish API for Stdenv.
`@private` hides classes from documentation altogether, while `@api
private` merely marks it as a private API.
2021-01-11 10:40:59 +11: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
Jonathan Chang
1b6fb8f460 ENV/shared: widen type 2020-12-08 20:54:10 +11:00
Mike McQuaid
9216d8abe6
rubocop-rails: make fixes. 2020-12-02 10:43:04 +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