If the `rebuild`, `root_url`, `cellar` and checksums are all identical
between an old and new bottle block: we don't need a new bottle at
all. Handle this by deleting the relevant files with
`brew bottle --merge --write` and gracefully notifying the caller of
`brew pr-upload`.
This should avoid e.g.
39340a11ea
occurring in future.
For :all bottle blocks in linuxbrew-core, we are going to remove the bottle
block completely before rebottling.
In linuxbrew-core, we use --keep-old to keep the macOS sha lines.
I am not sure why this exception was written initially, but it
now prevents bottling these formulae, because we have no bottle block
and use --keep-old.
I think it's safe to just skip this check, when there is no bottle block
the old_checksum can just directly return nil.
Rely more heavily on the `Bottle::Filename` class rather than hacking
around things manually.
Without this the rebuilding bottles workflow is broken for `all:`
bottles.
Instead of using `libarchive` on macOS (which has a non-zero dependency
tree) let's instead use `gnu-tar` because:
- it has no dependencies
- we're already using it on Linux
I tested this locally with `ack` (which was getting reproducible bottles
with system and Homebrew `libarchive`) and saw a different checksum. A
quick read of the `gtar` manpage indicated that it uses a GNU tar format
by default which can be made consistent with BSD and GNU tar by using
`--format=ustar` with both. Once this is done, the checksums are the
same. This will hopefully ease the transition to having `all:` bottles
be consistent on Linux, too, which will be useful when homebrew-core is
fully merged/supporting Linux.
Generate `all: $SHA256` bottles if:
- all generated bottles have the same cellar
- all generated bottles have the same checksum
In this case, on `brew bottle --merge --write`: delete all the non-`all`
bottles (and their JSON) and upload only the single one that's
necessary.
- test them in `brew test-bot` (before we do so in homebrew/core)
- don't fail if we cannot find the tab/install receipt in a bottle
- cache listing the files in a bottle so we don't do it more times than
necessary
- fix resolution of version and formula names from a bottle if we're
getting them from a bottle without a tab/install receipt
This will need to be in a tagged release before we can ship tab-less
bottles to users.
The fix for #11090 in bd3f1d28e78bbc3e632b5439f001c6a2b3032fd9 changed the bottle json content but the downloader still expects bottles at the old location.
Fixes:
Calling `cellar` in a bottle block is deprecated! Use `brew style --fix` on the formula to update the style or use `sha256` with a `cellar:` argument instead.
They don't need escaped like the Bintray ones did.
Fixes https://github.com/Homebrew/brew/issues/11090 (but note this may
require the cache entry to be cleared and the package to be
redownloaded).
This allows the creation of bottles which will be used by any macOS
version, architecture or OS (i.e. macOS or Linux).
Add `TODO` stubs for where the bottle generation logic should be
implemented.