2866 Commits

Author SHA1 Message Date
Bo Anderson
fe8f6dfc8d
dev-cmd/prof: bleed less of the environment from gem installs 2023-08-21 14:22:47 +01:00
Mike McQuaid
e7dc14c015
dev-cmd/bottle: install gnu-tar before keg lock.
This allows the correct bottling of `gnu-tar` dependencies (and
`gnu-tar` itself). It also installs `gnu-tar` at a more appropriate
time in the `brew bottle` command.
2023-08-18 11:03:22 +01:00
Mike McQuaid
597f0840a3
dev-cmd/tests: add --fail-fast.
This is useful when testing very slow test files with many tests.
2023-08-10 16:27:37 +01:00
apainintheneck
0979f7c35f cmd/bump: add --installed flag
This allows users to only try to bump formulae and casks they
currently have installed. It copies this behavior from the
livecheck command.
2023-08-05 10:01:11 -07:00
apainintheneck
474656ffaa dev-cmd/bump : stop using API to load formulae/casks
Even though the command already sets without_api that only
affects how named args are loaded. In this command, we used to load
many formulae and casks all at once using the API according to
user settings. Now we just mandate that all loading must skip the API.
2023-08-04 19:08:22 -07:00
Mike McQuaid
b3c33d34ab
Various sharding fixes
- Load paths with no API when needed (e.g. for `brew edit`)
- Use no API mode for `brew log` as it's needed there
- Define sharding format for homebrew-cask and homebrew-core inside
  `Tap` methods
- Create new formulae/casks in location defined by these `Tap` methods
- Fix a bug in Formulary that made sharded formulae lookup less
  efficient (and possibly broke it for core and some API usage)
- Fix various other hardcoded Formula/Cask directory assumptions

Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-08-04 16:43:13 +01:00
Mike McQuaid
71888db8ba
bottle: reproducibility fixes.
I noticed from
https://github.com/Homebrew/homebrew-core/actions/runs/5751070010 that
we're no longer creating reproducible bottles between macOS and Linux.

All macOS checksums have changed but Linux ones have not. The main
difference between the two platforms is the `gtar` version used so let's
always just use the formula on both platforms.

While we're here, clear up the ordering and comments a little on the
reproducible `tar` arguments so that it's easier to compare with the
reproducible builds archives documentation.
2023-08-04 10:02:44 +01:00
Razvan Azamfirei
3949138d5b
format bump block 2023-08-03 09:58:59 -04:00
Razvan Azamfirei
2d330bcd32
bump: add arch-specific support 2023-08-03 09:41:01 -04:00
Eric Knibbe
b3ecd91f97
dev-cmd/edit: suggest tapping core repositories 2023-08-01 13:39:28 -04:00
Mike McQuaid
375a7ee8dc
Allow configuring Homebrew with .env files
For a long time people have requested some sort of configuration files
for Homebrew. Now: here's the first version of that.

Similarly to how you can configure Git for a system, a repository or
a user: you can configure Homebrew for a system, a prefix or a user.

The system-wide configuration file is `/etc/homebrew/brew.env`, the
prefix-specific configuration file is
`$HOMEBREW_PREFIX/etc/homebrew/brew.env`
and the user-specific configuration file is `~/.homebrew/brew.env`.

As we need to read these files from Bash in `bin/brew` (so they can)
influence functionality ASAP: they are in a simple format that Bash
can read. It may be that we have more complex array or hash data in
future that's configured through JSON or YAML (most likely JSON as we
use it more) and stored in a `brew.json`/`brew.yaml` file in the same
directory.

As this is relying on `eval` in Bash which is fairly dangerous: we
filter the lines with a regex to ensure we're only permitting setting
`HOMEBREW_*` variables and nothing more.

To give a bit of power to system administrators, the
`HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` variable can be set in
`/etc/homebrew/brew.env` to ensure that the system-wide configuration
file is loaded last and overrides any prefix or user settings.

Now that we have an actual location for configuration files, let's also
change the `brew livecheck` watchlist configuration file to be in this
directory and deprecate the existing location. As this is a developer
command and the mitigation is to just move the file: we don't need to
follow the normal deprecation process here.
2023-07-28 17:17:14 +01:00
Mike McQuaid
4b9c031e1b
Merge pull request #15725 from razvanazamfirei/bump-cask-pr-arch
`bump-cask-pr`: add arch-specific version support
2023-07-25 15:52:36 +01:00
Razvan Azamfirei
33375ae938
rename class and reorganize files 2023-07-25 06:41:38 -04:00
Douglas Eichelberger
08e46c18cd Add type to Formula attrs 2023-07-24 14:12:36 -07:00
Bo Anderson
9235024131
dev-cmd/pr-pull: fix branch warning conditions 2023-07-22 22:41:51 +01:00
Razvan Azamfirei
c64c834d05
bump-cask-pr: add arch-specific version support 2023-07-21 11:45:34 -04:00
Carlo Cabrera
45171dde8d
dev-cmd/pr-pull: fix typechecking error
Fixes

    Error: uninitialized constant Formulary::Formula

https://github.com/Homebrew/homebrew-core/actions/runs/5622415532/job/15237499429#step:8:132
2023-07-21 22:18:00 +08:00
Douglas Eichelberger
33d9dc63b0 Fix type errors when HOMEBREW_SORBET_RUNTIME=1 2023-07-18 10:22:51 -07:00
Mike McQuaid
4017034c0a
Merge pull request #15704 from MikeMcQuaid/generate_api_safer
dev-cmd/generate-*-api: be a bit safer.
2023-07-18 13:12:31 +01:00
Mike McQuaid
e1a7afb3cf
dev-cmd/generate-*-api: be a bit safer.
- also try generating formula API on macOS
- pull more logic out of `unless args.dry_run?` in case it fails
2023-07-18 12:57:09 +01:00
Mike McQuaid
1db83cd4a9
dev-cmd/bump-cask-pr: fix install_bundler_gems! logic. 2023-07-18 12:18:19 +01:00
Mike McQuaid
3247b2ecfa
dev-cmd/bump-*-pr: avoid installing gems when unneeded.
Fixes #15686
2023-07-18 10:48:11 +01:00
Mike McQuaid
fb35578c54
Merge pull request #15676 from Bo98/tap-fixes
Introduce CoreCaskTap class and fix cases of core taps were being unnecessarily installed
2023-07-17 19:22:22 +01:00
Bo Anderson
5aad83ce1b
generate-*-api: fix on-disk tap migrations not being used 2023-07-14 02:04:14 +01:00
Bo Anderson
beaa6c32a0
Fix cases of core taps being unnecessarily installed 2023-07-13 20:33:31 +01:00
Bo Anderson
ba02c669e1
Introduce CoreCaskTap class 2023-07-13 20:33:26 +01:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Mike McQuaid
9241db1f78
Merge pull request #15628 from MikeMcQuaid/generate_tap_migrations
dev-cmd/generate-*-api: generate tap migrations JSON.
2023-07-05 14:44:43 +01:00
Mike McQuaid
3f3d587665
dev-cmd/generate-*-api: generate tap migrations JSON.
These will be consumed later.

Part of https://github.com/Homebrew/brew/issues/14897
2023-07-05 14:01:09 +01:00
Bo Anderson
367f716a08
dev-cmd/audit: don't audit every tap with given named packages 2023-07-04 16:08:04 +01:00
Carlo Cabrera
bc6e88d45c
pr-publish: request a large runner for appropriately labelled PRs
This will make it easier to merge PRs that require the large runner to
upload the built bottles.
2023-06-27 20:06:35 +08:00
Alexander Bayandin
baf099f804
Use taps names for error messages for consistency
Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-06-23 12:58:53 +01:00
Alexander Bayandin
8d18680cba
cmd/create: fix tap name for TapUnavailableError 2023-06-23 11:12:02 +00:00
Alexander Bayandin
e36790ab5c
cmd/edit: fix error message for formula 2023-06-23 11:11:31 +00:00
Bo Anderson
bb7aef85db
Migrate remaining no-api commands to new scoped system 2023-06-22 17:11:20 +01:00
Bo Anderson
e2e80d77a3
dev-cmd/test: use localised no-api scoping 2023-06-22 01:57:35 +01:00
Bo Anderson
68289f1165
Add without_api specifier for CLI named args 2023-06-22 01:57:28 +01:00
Carlo Cabrera
c5fe2a3559
formula_auditor: adjust deps audit for a staging branch
1. Adjust audit so that it ignore conflicts only for `brew audit --tap`.
   This is useful because it prevents us from trying to migrate a formula
   to `openssl@3` before all its dependencies have also been migrated.
2. Exempt only PRs that target a branch called
   `openssl-migration-staging`.
2023-06-20 22:37:06 +08:00
Carlo Cabrera
909b8d078e
dev-cmd/update-maintainers: write JSON of maintainers
This will be needed for Homebrew/homebrew-test-bot#933.
2023-05-29 21:30:47 +08:00
Markus Reiter
7cc1b6191e
Clean up brew audit output. 2023-05-19 19:40:37 +02:00
Markus Reiter
e9bfcb9296
Merge pull request #15225 from reitermarkus/audit-os-arch
Add `--os=all` and `--arch=all` options for `brew audit`.
2023-05-19 15:03:32 +02:00
Carlo Cabrera
d7870bb24d
Move artifact download code to separate file
This will help avoid mutually-recursive `require`s.
2023-05-17 23:48:58 +08:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Carlo Cabrera
d372eb86ca
utils/github: remove unnecessary chdir call
The only existing caller already has the requested directory as the
workign directory, so this is currently not needed.
2023-05-17 21:11:15 +08:00
Carlo Cabrera
05337cbb79
Refactor GitHub artifact downloads out of dev-cmd/pr-pull
I plan to use these in `test-bot` to download built bottles from
previous CI runs.
2023-05-17 21:11:15 +08:00
apainintheneck
358a2ce788 dev-cmd/generate-*-api: add dry run option
There are two reasons for this:
- Makes it easier to run this command as a sanity check without
  having to create a temporary directory
- Is somewhat faster since you don't have to write thousands of files
2023-05-15 18:29:49 -07:00
Markus Reiter
0d56b97b07
Add SimulateSystem::with. 2023-05-14 01:45:04 +02:00
Markus Reiter
c5926241a8
Don't fail auditing empty tap. 2023-05-11 21:52:36 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Dawid Dziurla
a341f4346c
bump-formula-pr: fix method argument type 2023-05-05 13:51:14 +02:00