152 Commits

Author SHA1 Message Date
Bo Anderson
dbcc449b14
shims/mac/super/make: use standard exec routines 2023-07-12 23:21:00 +01:00
Carlo Cabrera
9ece93ea49
shims/mac: handle usage of Homebrew make
We have a handful of formulae that use Homebrew `make` to build. Doing
this evades our compiler shims. Let's try to avoid this by allowing our
shims to support usage of Homebrew `make` by calling it as `gmake` in
the formula.
2023-07-12 02:16:32 +08:00
Carlo Cabrera
729c2b331b
shims/linux: add gnumake and gmake symlinks
The `opencv@3` build calls `gmake`, which ends up evading our compiler
shim and results in a build failure because of a `-Werror` flag.

Closes Homebrew/homebrew-core#132966.
2023-06-06 23:49:52 +08:00
Francois-Xavier Coudert
6067acfd7c compilers: add gcc-13 2023-04-19 11:18:18 +02:00
Carlo Cabrera
999582f412
Fix typo 2023-03-07 23:34:57 +08:00
Carlo Cabrera
c4fe6e7617
Incoroporate feedback from code review
- check the version of `/usr/bin/ld` for support of `-no_fixup_chains`
- check for usage of the `-fuse-ld` flag, since this flag is only
  supported by Apple ld64

Also, call `no_fixup_chains` when setting up the build environment.
2023-03-05 16:55:00 +08:00
Carlo Cabrera
1b12d74945
Pass -no_fixup_chains to linker when required
Invoking `ld` with `-undefined dynamic_lookup` emits a warning starting
Xcode 14:

    ld: warning: -undefined dynamic_lookup may not work with chained fixups

Chained fixups is a linker optimisation that results in faster binary
load times, and is enabled by default starting Xcode 13 when the target
is macOS 12 or newer.

However, this interacts poorly with `-undefined dynamic_lookup`, and
Xcode will disable chained fixups when it is invoked with this flag
starting Xcode 14.3. Until then, we may be shipping binaries that are
broken in subtle ways, so let's disable chained fixups when necessary
instead.

I patterned the changes here after the handling of `-no_weak_imports`.
The only difference is that we need to check the flags that were passed
to the linker first to see if we do need to disable chained fixups.

For additional context, see:

https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes
https://www.wwdcnotes.com/notes/wwdc22/110362/
https://www.emergetools.com/blog/posts/iOS15LaunchTime
https://github.com/python/cpython/issues/97524
https://github.com/pybind/pybind11/pull/4301
2023-03-04 00:19:13 +08:00
Bo Anderson
5445bf8f39
shims/super/cc: unset RUBYLIB 2022-11-30 03:50:38 +00:00
Bo Anderson
e21c926f9b
Update Bundler to 2.3.26 2022-11-17 16:35:08 +00:00
Bo Anderson
a776d5f02b
Workaround macOS system Ruby issue picking incorrect native gem archs 2022-10-14 01:30:38 +01:00
Mike McQuaid
5b8bc14afd
shims/gems/rubocop: handle when brew isn't in PATH.
Instead, figure out where `$HOMEBREW_PREFIX/bin` should be and use that.
2022-08-30 12:53:42 +00:00
Lukas Oberhuber
3d60d610dd Merge branch 'master' into debug-symbols 2022-08-10 18:44:09 -10: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
Lukas Oberhuber
e1ea9da507 Conceptual draft of dsym support for macos 2022-07-26 00:00:45 +01:00
danielnachun
7a247fd52d
shims/super/cc: add -nostdinc in cppflags 2022-07-20 11:08:43 -07:00
danielnachun
6ab6382518
shims/super/cc: add nostdinc and rpath-link when using glibc@2.13 2022-07-17 17:15:06 -07:00
EricFromCanada
7c7d7a54c6
superenv: avoid adding blank --isysroot flag 2022-06-01 13:58:14 -04:00
Francois-Xavier Coudert
a30e27b403 compilers: add gcc-12 2022-04-30 22:05:35 +02:00
Bo Anderson
d23de6c54c
shims: enable cc arg refurbishment for ninja 2022-03-14 17:05:22 +00:00
Carlo Cabrera
bfd88b5625
shims/mac/super: add gnumake symlink
Some builds look for a `gnumake` and execute that instead. This avoids
our shims since macOS provides a `/usr/bin/gnumake`.
2022-01-23 17:10:24 +08:00
Bo Anderson
20b4e95c3d
shims/shared/curl: fix regex 2021-10-20 18:12:27 +01:00
Bo Anderson
7f54793c49
shims/shared/curl: pass both --cafile and --capath to override defaults 2021-10-20 16:01:36 +01:00
Bo Anderson
ab79aca64e
shims: provide scm alias for compatibility with old update-reset script
A fix for the script was made in 95b0bd160fdbf00adb457a54d28b9925d2663494 but the user may be updating from an older version of brew, which won't have this fix.
2021-10-05 03:47:00 +01:00
Bo Anderson
30b24cf4ad
Use HOMEBREW_CURL universally, including formulae 2021-10-04 02:03:04 +01:00
Bo Anderson
2068ba7063
shims/mac/super/pkg-config: fix shebang 2021-09-20 01:32:02 +01:00
Dawid Dziurla
701904ad5c
shims/super/cc: run in bash shell 2021-09-17 22:13:43 +02:00
XuehaiPan
43377a3e5e style: fix inconsistent code style for shell scripts by runing brew style --fix 2021-09-16 01:08:02 +08:00
XuehaiPan
c2d5d84b21 Merge remote-tracking branch 'upstream/master' into fix-inconsistent-shell-style 2021-09-16 01:01:49 +08:00
XuehaiPan
3f96d963f7 style: fix inconsistent code style for shell scripts 2021-09-15 14:59:01 +08:00
Bo Anderson
0eba5b29e9
shims/super: shim swiftc 2021-09-15 03:28:31 +01:00
Bo Anderson
414935fb39
shims: enforce usage of Swift-bundled Clang on Linux
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-09-15 03:25:12 +01:00
Bo Anderson
86063bae73
shims: set SDKROOT for Swift 2021-09-04 19:45:57 +01:00
Bo Anderson
a84b13b6e9
bin/brew: actually quiet cd
Fixes #11886.
2021-08-19 13:33:31 +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
Carlo Cabrera
863b412820
shims/super/cc: fix sysroot flag handling
The shim currently does not handle `--sysroot=` and `-isysroot=` flags
correctly. For example, the LLVM build passes `--sysroot=.`, and this is
incorrectly parsed by the shim.
2021-06-08 14:39:37 +01:00
Carlo Cabrera
a288029cc9
compilers: add gcc-11
Needed for https://github.com/Homebrew/homebrew-core/pull/74843.
2021-05-02 00:29:01 +01:00
Mike McQuaid
7af68d0f8e
Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.

To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
  read sourced files every time
- disable some more warnings/errors we don't care about fixing
2021-04-22 13:18:44 +01:00
Mike McQuaid
0ba5a5dde5
shims/mac/super/pod2man: delete.
Bo98 has confirmed this is not needed on Yosemite (the oldest version of
macOS that we can still be run on).
2021-04-21 14:23:11 +01:00
Mike McQuaid
e59f93cf19
Merge pull request #11212 from MikeMcQuaid/pod2man_tweaks
pod2man: further tweak logic.
2021-04-21 13:03:15 +01:00
Mike McQuaid
d3edf6155c
Merge pull request #11196 from hyuraku/remove_HOMEBREW_MAKE
remove HOMEBREW_MAKE
2021-04-21 13:01:21 +01:00
Mike McQuaid
df9ba9512e
pod2man: further tweak logic.
- prioritise the first `pod2man` in the `PATH` if possible. This shim
  was created to handle the case where there isn't one but, if there is,
  we want to allow e.g. using a `pod2man` dependency to override the use
  of the system version
- make `/usr/bin/pod2man` lower priority but still prioritise it over
  a Homebrew-installed `pod2man` that's not in the `PATH` unless it
  doesn't exist.
2021-04-21 12:32:39 +01:00
Mike McQuaid
443bae5522
pod2man: use newer pod2man.
This shim was originally added in
5c973bad7422cf7f335e952a91ddfa2273aa2e4f to workaround a missing
`/usr/bin/pod2man`. It's now unfortunately resulting in using an older
`pod2man` on newer macOS versions.

Instead, let's use `/usr/bin/pod2man` if it's available and, if not,
work backwards to find the newest available version that is available.
2021-04-21 10:51:18 +01:00
hyuraku
40084fcf7e remove HOMEBREW_MAKE 2021-04-21 09:59:15 +09:00
hyuraku
34919c45f2 add comments about ENV 2021-04-20 22:52:07 +09:00
hyuraku
7463023fc7 shims/mac/super/pkg-config: repair style 2021-04-18 21:21:48 +09:00
hyuraku
90290aa8ef shims/linux/super/make: repair style 2021-04-18 19:54:33 +09:00
hyuraku
4e3003b841 shims/mac/super/pod2man: repair style 2021-04-18 19:43:46 +09:00
hyuraku
7f33314e64 shims/mac/super/xcrun: repair style 2021-04-18 19:43:37 +09:00
hyuraku
c0df2460ef shims/mac/super/apr-1-config: repair style 2021-04-18 18:56:46 +09:00
hyuraku
4f6ecd5bf8 shims/mac/super/bsdmake: repair style 2021-04-18 18:56:36 +09:00