334 Commits

Author SHA1 Message Date
Mike McQuaid
2fa973bb3b
Merge pull request #11259 from bluelabsio/bottle-root-url-specs
dev-cmd/bottle: Support adding root_url specs to bottle spec
2021-04-29 19:54:53 +01:00
Chris Wegrzyn
68852c9162 Style fix 2021-04-29 12:51:15 -04:00
Chris Wegrzyn
ee8dc058d8 Better help text 2021-04-29 12:37:22 -04:00
Chris Wegrzyn
ffbabfd238 Rename download-strategy to root-url-using 2021-04-29 12:37:20 -04:00
Chris Wegrzyn
76607bbb6f Simplify conditional as suggested
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-04-29 12:35:50 -04:00
Chris Wegrzyn
3f60c95425 --download-strategy instead of --root-url-spec 2021-04-29 12:35:48 -04:00
Chris Wegrzyn
4025dce097 Support adding root_url specs in bottle output 2021-04-29 12:34:03 -04:00
Mike McQuaid
dcf03173e9
dev-cmd/bottle: remove double [tag].
Fixes https://github.com/Homebrew/brew/pull/11283#discussion_r623181245
2021-04-29 17:08:23 +01:00
Mike McQuaid
7ba634ccb4
Merge pull request #11283 from MikeMcQuaid/no_bottle_changes_error_handling
dev-cmd/bottle: handle empty collector tags.
2021-04-29 16:32:35 +01:00
Michka Popoff
1a27e4fd4a
Merge pull request #11278 from iMichka/bottle
bottle: do not fail on missing bottle block
2021-04-29 17:22:39 +02:00
Mike McQuaid
f9589429d6
dev-cmd/bottle: handle empty collector tags.
Fixes https://github.com/Homebrew/homebrew-core/runs/2467738434?check_suite_focus=true#step:6:458
2021-04-29 16:00:22 +01:00
Mike McQuaid
d44d686cd5
dev-cmd: avoid uploading identical bottles.
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.
2021-04-29 14:48:45 +01:00
Michka Popoff
697edce654
bottle: do not fail on missing bottle block
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.
2021-04-29 14:45:47 +02:00
Bo Anderson
a038110115
dev-cmd/bottle: fix all JSON filename 2021-04-28 22:38:06 +01:00
Mike McQuaid
40a36e422e
dev-cmd/bottle: output more filenames when verbose.
More debugging for the bottle rebuild workflow.
2021-04-28 20:25:02 +01:00
Mike McQuaid
16d5472e4b
dev-cmd/bottle: improve filename handling.
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.
2021-04-28 17:10:46 +01:00
Mike McQuaid
20eeb5aca0
dev-cmd/bottle: add missing verbose puts.
These were added but didn't actually output anything...
2021-04-28 14:23:09 +01:00
Mike McQuaid
dd201a219c
dev-cmd: add more --verbose bottle, pr-upload output.
This should make it easier to debug `all:` bottle upload failures.

While we're here, remove the weird `_` that ended up at the end of a
method name.
2021-04-28 12:48:24 +01:00
Bo Anderson
b0cef64c53
dev-cmd/bottle: use gnu-tar universally, sort entries & use PAX 2021-04-27 14:15:17 +01:00
Mike McQuaid
a10f436120
dev-cmd/bottle: tweak tar and tar arguments.
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.
2021-04-26 14:42:09 +01:00
Mike McQuaid
521d6b51a6
dev-cmd/{bottle,pr-upload}: generate, upload all: $SHA256 bottles.
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.
2021-04-21 17:10:05 +01:00
Mike McQuaid
965dbaa172
dev-cmd/bottle: fix libarchive installed check.
Used now-removed old method name.
2021-04-21 11:39:19 +01:00
Mike McQuaid
4a3fc2a8fc
dev-cmd/bottle: set uid/gid, use libarchive on macOS.
Take 2 on #11165 but use newish `libarchive` consistently on macOS.
2021-04-21 10:09:35 +01:00
Mike McQuaid
08b848044e
Revert "dev-cmd/bottle: set uid/gid." 2021-04-16 16:58:21 +01:00
Mike McQuaid
7a23bd3ecd
dev-cmd/bottle: set uid/gid.
This is a more complete version of `--numeric-owner`.
2021-04-16 15:26:24 +01:00
Mike McQuaid
2b34ecfe18
Merge pull request #11163 from Bo98/bottle-filename
dev-cmd/bottle: revert filename in JSON to use single dash always
2021-04-16 14:30:46 +01:00
Mike McQuaid
4a0b860973
dev-cmd/bottle: improve reproducibility, comment.
Setting a consistent owner/group results in more consistent bottles.
2021-04-16 14:05:06 +01:00
Mike McQuaid
96cd1c058e
utils/bottles: tweak/improve some of the API. 2021-04-16 14:05:05 +01:00
Mike McQuaid
a28dda5062
bottle: remove GitHub Packages bulk upload logic. 2021-04-16 14:05:05 +01:00
Bo Anderson
b5ccad093d
dev-cmd/bottle: revert filename in JSON to single dash
Fixes #11136.
2021-04-16 13:04:34 +01:00
Bo Anderson
6c687fd8ba
dev-cmd/bottle: fix INSTALL_RECEIPT appearing in changed_files 2021-04-14 21:43:37 +01:00
Mike McQuaid
bc9b98aa0b
Merge pull request #11131 from MikeMcQuaid/only_json_tab_handling
Better handle `brew bottle --only-json-tab` bottles
2021-04-14 14:27:38 +01:00
Bo Anderson
1feed79e69
Use File.read over IO.read 2021-04-14 12:42:26 +01:00
Mike McQuaid
75592cbebc
Better handle brew bottle --only-json-tab bottles
- 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.
2021-04-13 14:26:31 +01:00
Mike McQuaid
17da648c1b
dev-cmd/bottle: don't assume desc present.
Fixes https://github.com/Homebrew/brew/pull/11057#issuecomment-817846023
2021-04-12 15:54:13 +01:00
Mike McQuaid
1bdb8c7a33
More Bintray cleanup
Cleanup more files and names related to Bintray to ease their future
deletion (when Bintray is shutdown).
2021-04-12 15:07:46 +01:00
Kevin Abel
b8d60c7fd6
bottle: Restore old filename for non-GitHub package URLs
The fix for #11090 in bd3f1d28e78bbc3e632b5439f001c6a2b3032fd9 changed the bottle json content but the downloader still expects bottles at the old location.
2021-04-11 14:24:21 -05:00
Bo Anderson
0f90267bd0
dev-cmd/bottle: fix incorrect Cellar value in JSON 2021-04-11 05:07:42 +01:00
Michka Popoff
850df21216
bottle: no need to set cellar anymore
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.
2021-04-10 09:52:15 +02:00
Mike McQuaid
bd3f1d28e7
Fix GitHub Packages filenames.
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).
2021-04-09 16:31:04 +01:00
Mike McQuaid
1d34f7f2fa
Merge pull request #11077 from MikeMcQuaid/any_bottles
Support `all: SHA256` bottles.
2021-04-09 10:18:19 +01:00
Mike McQuaid
271474820f
Merge pull request #11075 from MikeMcQuaid/deprecate_disable_delete
Deprecate, disable, delete code for next major/minor version.
2021-04-09 10:09:51 +01:00
Mike McQuaid
0cb1645d25
bottles: support :all tag.
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.
2021-04-09 09:50:16 +01:00
Mike McQuaid
6b5213286c
Rename "exact" tag match to "no_older_versions"
This is more specific about the behaviour we want to have in future.
2021-04-09 09:36:18 +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
Mike McQuaid
bed11e5c42
bottle: use newly generated bottle file for mtime. 2021-04-09 09:06:31 +01:00
Shaun Jackman
ec3c9b9d7f
bottle: Set date to the mtime of the bottle file 2021-04-09 09:06:31 +01:00
Bo Anderson
2f041abf2b
dev-cmd/bottle: don't take uniq of arguments 2021-04-08 22:07:47 +01:00
Bo Anderson
093e6e4f79
Merge pull request #11065 from Bo98/cellar-non-host
software_spec: fix handling of default non-host Cellar
2021-04-08 21:44:11 +01:00
Mike McQuaid
1980a6a5a5
dev-cmd/bottle: avoid outputting new default bottle domain. 2021-04-08 17:58:24 +01:00