Open carlocab opened 1 month ago
Alternative take: inreplace
feels like a massive hack and we should perhaps have a DSL that excludes certain files from prefix-scanning.
Alternative take:
inreplace
feels like a massive hack and we should perhaps have a DSL that excludes certain files from prefix-scanning.
This seems like a per-formula/file decision
inreplace
may improve formula if loading/reading stuff we install inside HOMEBREW_PREFIX
, e.g. installed by other formulae, plugins, etc./usr/local
should be kept, e.g. when a program needs strict compliance with XDG specification.Yeah it will totally depend on the formula. There's definitely a fair number though that already read HOMEBREW_PREFIX
and use /usr/local
as a fallback or are checking specifically for non-Homebrew installs.
Other situations I recall for missing :all
bottles:
pod2man --release
) and tool versionswheel
or setuptools
), e.g. pycparser
.pth
file we auto-create. Sometimes this is unnecessarily encompassing, e.g. formulae that use uses_from_macos "libxml2"
usually aren't using the Python binding as macOS doesn't provide it. An alternative could be handling some of this during bottle pour depending on how speed of file generation.There are also formulae that are only :all
per-OS/platform. These may have been :all
before Linuxbrew merge. If there are enough of these, it may be worth exploring a :macos
bottle.
Alternative take:
inreplace
feels like a massive hack and we should perhaps have a DSL that excludes certain files from prefix-scanning.
I guess these are hacks to the extent that parts of our existing prefix-relocation scheme is a hack. I actually wouldn't mind relocating automatically a /usr/local
reference to HOMEBREW_PREFIX
if that's what we would already have done on Intel macOS.
There are also formulae that are only
:all
per-OS/platform. These may have been:all
before Linuxbrew merge. If there are enough of these, it may be worth exploring a:macos
bottle.
I've noticed this too. Some Go formulae might even work as :arm64_macos
and :x86_64_macos
-- e.g. the go
formula itself. Would not be surprised if our existing Intel bottles for go
work as far back as :catalina
.
I actually wouldn't mind relocating automatically a
/usr/local
reference toHOMEBREW_PREFIX
if that's what we would already have done on Intel macOS.
Having brew
automatically pick one and perhaps having an easy override for other may be best way to reduce the manual diff-ing and fix ups which add maintenance overhead. Maybe using a DSL similar to skip_clean
for overriding.
We currently have a few hundred
:all
bottles in this repository. I count another 200 or so more (see candidate formulae below) that could have an:all
bottle but don't currently have one.These are typically due to
/usr/local
references inside that bottles that are relocated on x86_64 macOS but not on arm64 macOS or Linux. To fix these, we typically only need a fewinreplace
lines. See below for example PRs.Example PRs
- https://github.com/Homebrew/homebrew-core/pull/191327 - https://github.com/Homebrew/homebrew-core/pull/191316 - https://github.com/Homebrew/homebrew-core/pull/191252 - https://github.com/Homebrew/homebrew-core/pull/191251 - https://github.com/Homebrew/homebrew-core/pull/191250 - https://github.com/Homebrew/homebrew-core/pull/191249Candidate Formulae
- [ ] abi3audit - [ ] alluxio - [ ] angular-cli - [ ] apify-cli - [ ] appium - [ ] appwrite - [ ] arttime - [ ] asciidoc - [ ] asyncapi - [ ] autoconf - [ ] automake - [ ] autopsy - [ ] autorest - [ ] aws-amplify - [ ] aws-auth - [ ] awscli-local - [ ] b2-tools - [ ] bandcamp-dl - [ ] basedpyright - [ ] basti - [ ] bork - [ ] bower - [ ] braid - [ ] bundletool - [ ] cdk8s - [ ] censys - [ ] certbot - [ ] certifi - [ ] chruby - [ ] cimg - [ ] cloudflare-wrangler2 - [ ] cmake-docs - [ ] cocoapods - [ ] commitlint - [ ] composer - [ ] contentful-cli - [ ] cpanminus - [ ] cpm - [ ] cppman - [ ] credstash - [ ] cubejs-cli - [ ] dbml-cli - [ ] ddclient - [ ] devcontainer - [ ] dicebear - [ ] diceware - [ ] diffoscope - [ ] dita-ot - [ ] doc8 - [ ] dockerfile-language-server - [ ] druid - [ ] duply - [ ] easyengine - [ ] eleventy - [ ] eslint - [ ] extra-cmake-modules - [ ] fades - [ ] fail2ban - [ ] fanyi - [ ] fauna-shell - [ ] firebase-cli - [ ] flake8 - [ ] flamebearer - [ ] flawfinder - [ ] flit - [ ] fnt - [ ] fonts-encodings - [ ] foreman - [ ] fred - [ ] geoip2fast - [ ] getmail6 - [ ] git-big-picture - [ ] git-cola - [ ] git-number - [ ] git-remote-codecommit - [ ] git-review - [ ] git-subrepo - [ ] gitlab-ci-local - [ ] gitmoji - [ ] gitter-cli - [ ] go - [ ] goenv - [ ] goolabs - [ ] gorilla-cli - [ ] gost - [ ] gprof2dot - [ ] grails - [ ] graphql-cli - [ ] graphqurl - [ ] grokmirror - [ ] groovysdk - [ ] grunt-cli - [ ] gsettings-desktop-schemas - [ ] gtop - [ ] gulp-cli - [ ] hadoop - [ ] haste-client - [ ] hexo - [ ] http-server - [ ] httpyac - [ ] hyfetch - [ ] insect - [ ] instalooter - [ ] intltool - [ ] inxi - [ ] ios-sim - [ ] ipython - [ ] itstool - [ ] jruby - [ ] js-beautify - [ ] jscpd - [ ] json2ts - [ ] jtbl - [ ] kafka - [ ] keyring - [ ] kubevious - [ ] lando-cli - [ ] latexdiff - [ ] lerna - [ ] liquibase - [ ] luarocks - [ ] lynis - [ ] libclc - [ ] libunwind-headers - [ ] mailsy - [ ] markdownlint-cli - [ ] marp-cli - [ ] maven - [ ] maxwell - [ ] mjml - [ ] mysqltuner - [ ] n - [ ] nativefier - [ ] naturaldocs - [ ] nave - [ ] nb - [ ] nbdime - [ ] neonctl - [ ] netsurf-buildsystem - [ ] newman - [ ] nicotine-plus - [ ] nikto - [ ] nox - [ ] npm-check-updates - [ ] osc-cli - [ ] osc - [ ] pandemics - [ ] pass-git-helper - [ ] pass - [ ] patch-package - [ ] pedump - [ ] phoronix-test-suite - [ ] phpbrew - [ ] phpstan - [ ] pip-tools - [ ] pipdeptree - [ ] pipenv - [ ] pipgrip - [ ] pipx - [ ] platformio - [ ] pnpm - [ ] pnpm@8 - [ ] postgraphile - [ ] powerlevel10k - [ ] principalmapper - [ ] psalm - [ ] psysh - [ ] ptpython - [ ] px - [ ] pycparser - [ ] pyenv-virtualenv - [ ] pylint - [ ] pyqt-builder - [ ] pyright - [ ] python-argcomplete - [ ] pythran - [ ] quicktype - [ ] rbtools - [x] redo - #191545 - [ ] release-it - [ ] rich-cli - [ ] rollup - [ ] saf-cli - [ ] scons - [ ] seam - [ ] search-that-hash - [ ] serveit - [ ] serverless - [ ] shallow-backup - [ ] shodan - [ ] sip - [ ] slimerjs - [ ] snyk-cli - [ ] solhint - [ ] sonarqube-lts - [ ] sonarqube - [ ] spack - [ ] spectral-cli - [ ] speedtest-cli - [ ] spotbugs - [ ] sql-lint - [ ] sqlite-utils - [ ] sqlmap - [ ] sslmate - [ ] standard - [ ] stepci - [ ] stylelint - [ ] subliminal - [ ] sugarjar - [ ] supervisor - [ ] tailwindcss-language-server - [ ] tartufo - [ ] teku - [ ] terrahub - [ ] tmuxinator-completion - [ ] tmuxinator - [ ] tox - [ ] twarc - [ ] ungit - [ ] unoconv - [ ] unum - [ ] urlscan - [ ] util-macros - [ ] vcs - [ ] vercel-cli - [ ] virtualenv - [ ] vite - [ ] vue-cli - [ ] waybackpy - [ ] web-ext - [ ] webpack - [ ] wikibase-cli - [ ] wildfly-as - [ ] wiremock-standalone - [ ] wp-cli - [ ] xmltoman - [ ] xorgproto - [ ] yaml-language-server - [ ] yapf - [ ] yo - [ ] yuicompressor - [ ] z - [ ] zim - [ ] zinitHow do I identify the files to `inreplace`?
`diffoscope` is your best friend here (install it with `brew intall diffoscope`). If you're trying to fix formula `foo`, you'll want to first check `foo` for which bottles have different checksums, e.g., with `brew cat foo` (if you have `homebrew/core` tapped), or with ``` brew info --json=v2 foo | jq '.formulae[].bottle.stable.files' ``` Typically, the Intel macOS bottles will all have the same checksums, but these will be different from the arm64 macOS bottles and Linux bottles (which often all have the same checksums as well). Pull down the relevant bottles with: ``` brew fetch --bottle-tag arm64_sonoma foo brew fetch --bottle-tag sonoma foo ``` and then examine them using `diffoscope`: ``` diffoscope "$(brew --cache --bottle-tag arm64_sonoma foo)" "$(brew --cache --bottle-tag sonoma foo)" ``` `diffoscope` will tell you which files differ, and these are the ones you'll want to `inreplace`.Why do we care about `:all` bottles?
An `:all` bottle can be installed by any Homebrew user, regardless of their `HOMEBREW_PREFIX` or OS version, so having more `:all` bottles mean that more users can benefit from bottle usage. Moreover, `:all` bottles are a signal that our builds are (somewhat) reproducible, which is important when providing pre-built packages. See https://reproducible-builds.org for more on this.