Currently, this says something like
Ruby version 2.6.8 is unsupported on 12.
which is a little cryptic. Let's change that to say
Ruby version 2.6.8 is unsupported on macOS 12.
There are at least five instances where a formula has libraries compiled
with `-flat_namespace` due to a bug in detecting the macOS version (cf.
Homebrew/homebrew-core#87103, Homebrew/homebrew-core#85974,
Homebrew/homebrew-core#85973).
I think it makes sense to check for this more generally. It is
sometimes intentional, so I've added a check for an allowlist for
those instances. Running this on the current `util-linux` bottle
produces
❯ brew audit --strict util-linux
util-linux:
* Libraries were compiled with a flat namespace.
This can cause linker errors due to name collisions, and
is often due to a bug in detecting the macOS version.
/usr/local/Cellar/util-linux/2.37.2/lib/libblkid.1.dylib
/usr/local/Cellar/util-linux/2.37.2/lib/libfdisk.1.dylib
/usr/local/Cellar/util-linux/2.37.2/lib/libsmartcols.1.dylib
/usr/local/Cellar/util-linux/2.37.2/lib/libuuid.1.dylib
Error: 1 problem in 1 formula detected
Some things that still need to be done here:
- fix this check for universal binaries
- check if we want to restrict this audit check to newer versions of macOS
- fix false positives (try `brew audit --strict llvm` and compare the
output of `otool -hV` on the identified files)
While we're here, let's fix the formatting of the output of these other
audits (cf. #12217).
- Only for HOMEBREW_DEVELOPER
- Except for HOMEBREW_CORE_MERGE_MAINTAINER
- Except for GitHub Actions CI
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
If you have Homebrew LLVM installed, `brew config` will show
Clang: 12.0.1 build (parse error)
because Homebrew LLVM does not give a build number. Some installations
from the system package manager do have this information, so let's show
it if it's available but skip complaining if not.
I've kept the original code for macOS because we always expect Apple's
build number to show there.
Bison no longer remembers the path to `m4` as of
Homebrew/homebrew-core#84931. Since superenv does not put runtime
dependencies of build dependences in `PATH`, we now need to help Bison
find `m4` by setting `M4` in the environment.
See also Homebrew/homebrew-core#85260.
Should resolve issues with multi-word arguments, eg:
> Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/nginx/bin/nginx -g daemon off;
fails, but
> Or, if you don't want/need a background service you can just run:
'/opt/homebrew/opt/nginx/bin/nginx' '-g' 'daemon off;'
succeeds