201 Commits

Author SHA1 Message Date
Mike McQuaid
d707c0bbd8
github_packages: remove invalid docker tag characters.
Some versions have `+` in them.
2021-04-07 13:32:31 +01:00
Mike McQuaid
fd251c9109
github_packages: fix versioned bottle names.
`@` cannot be used in Docker image names. Use `/` instead (which we
already use in image names so has some precedent).

Make `mktemp` use `AT` (consistent with `Formula` subclasses), too.
2021-04-06 19:14:08 +01:00
Mike McQuaid
cdaeee03c4
GitHub Packages cleanup
- `download_strategy`: only request image index JSON for downloading
  the manifest for the tab
- use a shared `OS` constant for the version of `glibc` we use in CI
- fix `skoepeo` typo
- ensure that blank hash values are deleted (again) rather than just
  `nil` ones
- use a shared `Hardware::CPU` constant for oldest CPU we're
  supporting/using on Intel 64-bit
- re-add comment to `software_spec`
2021-04-05 14:58:17 +01:00
Shaun Jackman
a28b419d9d CurlGitHubPackagesDownloadStrategy: Fix 3rd party
Fix CurlGitHubPackagesDownloadStrategy for third party taps.
2021-04-04 01:49:36 -07:00
Mike McQuaid
262f964f9e
Fix brew fetch --force for GitHub Packages bottle tab download.
Have to implement some custom logic here as there's two resources rather
than one.
2021-04-02 12:44:07 +01:00
Shaun Jackman
3141d493ca
github_packages: Rename sh.brew.bottle.digest
Rename sh.brew.bottle.checksum to sh.brew.bottle.digest
for consistency with the OCI descriptor spec.
2021-04-02 10:13:27 +01:00
Mike McQuaid
d9032ff01a
Download and use tabs from GitHub Packages 2021-04-01 17:37:16 +01:00
Mike McQuaid
8144fdef78
Simplify CurlGitHubPackagesDownloadStrategy usage 2021-04-01 17:37:16 +01:00
Mike McQuaid
7fc52d2065
github_packages: fix HOMEBREW_BOTTLE_DOMAIN usage.
This still worked but ended up always having a `/bottles-*/` part of the
URL that was unnecessary when using `HOMEBREW_BOTTLE_DOMAIN`.
2021-03-16 15:17:42 +00:00
Mike McQuaid
1d32dc9067
Support downloading bottles from GitHub Packages 2021-03-12 14:11:24 +00:00
Bo Anderson
6cd1e5e384
Avoid passing around a massive $LOAD_PATH.
Portable Ruby crashes if the $LOAD_PATH gets too big.
2021-02-26 18:23:48 +00:00
XuehaiPan
d2533ff2a6
software_spec: Add HOMEBREW_BOTTLE_DEFAULT_DOMAIN as a fallback option
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-02-26 11:23:33 +00:00
Bo Anderson
fb8b247db3
dev-cmd/unbottled: various improvements
* Ignore bottles for older macOS versions
* Ignore disabled formulae
* Ignore formulae which can't build on the chosen macOS
* Improve/fix sort description
2021-02-23 16:27:58 +00:00
Mike McQuaid
c13d7e6723
Fix brew style 2021-02-16 09:25:34 +00:00
Rylan Polster
f68a3961c7
Prepare deprecations for the old bottle syntax 2021-02-06 14:27:03 -05:00
Rylan Polster
3dccea251f
bottle: write bottles in correct order 2021-02-04 16:04:13 -05:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00:00
Michka Popoff
de2e309d50
cellars: write tag specific cellars
With #10186 now merged, the tag specific cellar information is being read by brew.
This PR (once merged) will start adding the cellar information for each tag instead
of having a single cellar line on the top of the bottle block.

Each new CI build in homebrew-core will slowly start migrating the cellar lines to
the right place. If keep-old is used, the old "all tag" cellar line is removed and
added to each tag.
2021-01-28 13:19:40 +00:00
Mike McQuaid
fc1c142ebd
software_spec: reverse tag/digest for new bottles.
This new format was agreed in #10377
2021-01-28 13:15:41 +00:00
EricFromCanada
99ad3350ee use single quotes around stanza and parameter names 2021-01-26 16:19:47 -05:00
hyuraku
e6eeb2cbed delete HOMEBREW_REPOSITORY & some variables 2021-01-27 00:29:43 +09:00
Seeker
8693ca4e4d software_spec: change BottleSpecification#checksums to return array 2021-01-21 22:52:26 -08:00
Michka Popoff
3eea1434cc bottle: tag specific cellars 2021-01-19 10:14:25 +01:00
Seeker
7a5a8baac5 patch: delete legacy code
SoftwareSpec#add_legacy_patches and Patch#normalize_legacy_patches
were added almost 6 years ago; let's delete them

See commit 665b14c4a44c272b46b8559836e9fdbeee5d8a46

```
$ grep -r 'normalize_legacy_patches' Library/Homebrew
./software_spec.rb:    list = Patch.normalize_legacy_patches(list)
./patch.rb:  def self.normalize_legacy_patches(list)
```

```
$ grep -r 'add_legacy_patches' Library/Homebrew
./software_spec.rb:  def add_legacy_patches(list)
```
2021-01-13 18:40:46 -08:00
Michka Popoff
5e91802470 checksum: simplify, use only sha256
We use only one sha type right now.

Needed for https://github.com/Homebrew/brew/pull/10186
2021-01-07 20:46:13 +01:00
Mike McQuaid
0bbf965807
More bottling HOMEBREW_LIBRARY changes
- Refuse to create bottles which have non-relocatable references to
  `HOMEBREW_LIBRARY`. This allows us to make all bottles ignore where
  `HOMEBREW_REPOSITORY` is (even those that aren't `cellar :any`).
  I cannot see any circumstances in which any bottle should link to
  anything within `HOMEBREW_REPOSITORY`.
- Remove audit that becomes unnecessary given the above change.
- Relocate references to `@HOMEBREW_LIBRARY@` but don't actually write
  any references yet. This will allow us to move to using
  `@HOMEBREW_LIBRARY` and remove all relocation of `HOMEBREW_REPOSITORY`
  in a future release (2.7.1, most likely).
2020-12-18 13:50:10 +00:00
Mike McQuaid
4067b4d929
Merge pull request #9482 from MikeMcQuaid/deprecate_bottle_prefix
software_spec: deprecate `prefix` for bottles.
2020-12-18 12:16:05 +00:00
Mike McQuaid
831d034303
software_spec: fix cellar any handling.
`cellar :any` actually requires no references to the cellar, prefix or
repository (not just cellar) so we can pour those bottles anywhere
regardless of the cellar, prefix or repository.
2020-12-15 11:32:10 +00:00
Mike McQuaid
0f9bad0052
Fix bottle prefix and repository handling
We were previously only looking at the `cellar` value when pouring
bottles and ignoring the `prefix` and (implicit) `repository`.

Actually look at these values and set the defaults for each platform.

Also, when we're relocating to create or pour bottles when `prefix`
and `repository` are equal then skip relocating the `repository` and
always use references to the `prefix` instead.

Fixes #9453
2020-12-09 13:53:10 +00:00
Mike McQuaid
0f0aa83fa1
software_spec: deprecate prefix for bottles.
Turns out we weren't actually using/checking this value at all (so I'd
be very surprised if anyone is actually using it).
2020-12-09 12:51:00 +00:00
Seeker
305fbdd15c
Merge pull request #9438 from SeekingMeaning/software-spec-os
software_spec: add on_macos/on_linux to SoftwareSpec
2020-12-08 10:37:47 -08:00
Seeker
16270ba185 software_spec: add on_macos/on_linux to SoftwareSpec 2020-12-08 08:47:08 -08:00
Seeker
509ab86ece software_spec: add on_macos/on_linux to PourBottleCheck 2020-12-08 08:43:11 -08:00
Mike McQuaid
a5bd7cccf1
software_spec: make bottle sorting stable.
As `:arm64_big_sur` and `:big_sur` equated to the same version: their
sorting was not consistent. Instead, suffix the tag and use that for
sorting so `:big_sur` is always before `:arm64_big_sur`.
2020-12-07 15:43:44 +00:00
Markus Reiter
1690f064a2 Add types for Formula. 2020-11-25 17:36:52 +01:00
Markus Reiter
0184e271d8 Fix RuboCop offenses. 2020-11-17 11:09:55 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
EricFromCanada
dddfbf80fc apidoc: add/update yard tags 2020-11-06 00:16:35 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
490e503b1b Replace Homebrew.args with Context. 2020-08-06 16:13:14 +02:00
Markus Reiter
bace9ecc34 Pass verbose? to Formula#verify_download_integrity. 2020-08-06 16:13:14 +02:00
Markus Reiter
24eff8f81a Pass args in SoftwareSpec instead of using global args. 2020-07-30 03:21:12 +02:00
Mike McQuaid
f951ea83d4
Fix brew style. 2020-07-07 12:23:29 +01:00
Michka Popoff
36b62c50e0 software_spec: do not add empty resources
Empty resources are allowed to exist under the following form:

resource "filelock" do
  on_linux do
      url "6ee2168387/filelock-3.0.12.tar.gz"
      sha256 "18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"
  end
end

In this case (or for the on_macos only resource case), just ignore the resource block.

Fixes:
/usr/local/Homebrew/Library/Homebrew/dependency_collector.rb:148:in `resource_dep'
/usr/local/Homebrew/Library/Homebrew/dependency_collector.rb:99:in `parse_spec'
/usr/local/Homebrew/Library/Homebrew/dependency_collector.rb:53:in `build'
/usr/local/Homebrew/Library/Homebrew/dependency_collector.rb:40:in `block in fetch'
/usr/local/Homebrew/Library/Homebrew/dependency_collector.rb:40:in `fetch'
/usr/local/Homebrew/Library/Homebrew/dependency_collector.rb:40:in `fetch'
/usr/local/Homebrew/Library/Homebrew/dependency_collector.rb:30:in `add'
/usr/local/Homebrew/Library/Homebrew/software_spec.rb:120:in `resource'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2439:in `block in resource'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2438:in `each'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2438:in `resource'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/aws-google-auth.rb:149:in `<class:AwsGoogleAuth>'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/aws-google-auth.rb:1:in `load_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:38:in `rescue in load_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:35:in `load_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:56:in `load_formula_from_path'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:138:in `load_file'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:128:in `klass'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:124:in `get_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:333:in `factory'
/usr/local/Homebrew/Library/Homebrew/cli/args.rb:87:in `block in formulae'
/usr/local/Homebrew/Library/Homebrew/cli/args.rb:86:in `map'
/usr/local/Homebrew/Library/Homebrew/cli/args.rb:86:in `formulae'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:133:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:111:in `<main>'
2020-06-27 19:25:10 +02:00
Mike McQuaid
b58fa4ebb1
Drop Mavericks support.
Companion to https://github.com/Homebrew/brew/pull/7698.

Provide better, `odeprecated` messaging for
`depends_on :macos => :mavericks` and otherwise just fix up the code
that relied on `:mavericks`.
2020-06-10 10:06:46 +01:00
Mike McQuaid
4f75a77b08
Update deprecations
Add more deprecations, disable deprecations and remove disabled code.
2020-05-18 13:50:46 +01:00
Mike McQuaid
35e487064e
Merge pull request #7537 from MikeMcQuaid/cli_parser_formulae
Replace ARGV#flags_only with Homebrew.args.flags_only
2020-05-11 08:47:12 +01:00
Mike McQuaid
fa0d454817
Replace ARGV#flags_only with Homebrew.args.flags_only
Take two on https://github.com/Homebrew/brew/pull/7490
2020-05-10 15:12:25 +01:00
Bo Anderson
65d7036c19 bintray: url encode where needed 2020-05-10 01:48:29 +01:00