36194 Commits

Author SHA1 Message Date
Issy Long
704482d815
wip a test for ordering of both on_* blocks and their contents
- This is very broken, "detected clobbering" errors.
2023-05-07 08:29:31 +02:00
Issy Long
40bc235cb6
Simplify offending_stanzas method - pass sorted_stanzas in directly
- Otherwise we're doing the same "if inner" check twice, for no gain.
2023-05-07 08:29:30 +02:00
Issy Long
9457a23430
Extract methods for checking for on_* blocks and their contents
- The same code to do the same thing was getting a bit repetitive in
  `Cask/StanzaOrder`, `Cask/StanzaGrouping` and `Cask/NoOverrides`
  cops.
2023-05-07 08:29:30 +02:00
Issy Long
bd6e9e72a1
rubocops/cask: Check for correct stanza ordering within on_* blocks
- Now that we detect correct stanza _grouping_ within `on_*` blocks in
  Casks (PR 15211), correct stanza _ordering_ in `on_*` blocks was the
  next logical step. For example, `url` has to come after `version` and
  `sha256` in an `on_macos` or `on_intel` block for consistency with the
  top-level stanza order we enforce elsewhere.
- Still not doing the nested `on_os` inside `on_arch`, that felt
  excessive for an edge case that isn't present in any actual real
  Casks we have. I removed the test with that specific TODO.
2023-05-07 08:27:43 +02:00
Markus Reiter
1120812378
Merge pull request #15374 from carlocab/longer-arm-timeout
github_runner_matrix: align Intel and ARM timeouts
2023-05-06 23:21:01 +02:00
Markus Reiter
477a26c1be
Merge pull request #15279 from reitermarkus/livecheck-throttle
Type `livecheck.rb`.
2023-05-06 23:20:47 +02:00
Carlo Cabrera
0b33a09090
github_runner_matrix: align Intel and ARM timeouts
This prevents situations where the Intel runners have a 360 minute
timeout but the ARM runners only have 45 minutes.

See Homebrew/homebrew-core#130284.
2023-05-07 00:14:54 +08:00
Markus Reiter
353818f508
Rename curl_head to curl_headers. 2023-05-06 03:41:35 +02:00
Markus Reiter
545a332fef
Use curl_head and curl_output for Livecheck strategies. 2023-05-06 03:40:09 +02:00
Markus Reiter
dfc9d94c5b
Type livecheck.rb. 2023-05-06 03:27:42 +02:00
Issy Long
c1fdb59081
Merge pull request #15370 from p-linnane/sorbet-breakage
Revert "Merge pull request #15369 from carlocab/sorbet-runtime"
2023-05-05 18:28:57 +01:00
Patrick Linnane
bcf94f6e27
Revert "Merge pull request #15369 from carlocab/sorbet-runtime"
This reverts commit 8c059bba279f4b72b783fca91746d14b6286e6fc, reversing
changes made to f71b3d37abcc9cd12b0c8a621bc3712c00db8ec1.
2023-05-05 09:38:02 -07:00
Austin Ziegler
8719946036
Allow brew shellenv to accept a shell name param
Resolves #15358

With this change, `brew shellenv` will accept a shell name parameter to
override its default output (based on `/bin/ps`) for advanced use cases
such as with dotfile templating and caching with
[twpayne/chezmoi](https://github.com/twpayne/chezmoi/discussions/2971).
When running under `fish`, this is the output:

```console
$ brew shellenv pwsh
[System.Environment]::SetEnvironmentVariable('HOMEBREW_PREFIX','/opt/homebrew',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('HOMEBREW_CELLAR','/opt/homebrew/Cellar',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('HOMEBREW_REPOSITORY','/opt/homebrew',[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('PATH',$('/opt/homebrew/bin:/opt/homebrew/sbin:'+$ENV:PATH),[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('MANPATH',$('/opt/homebrew/share/man'+$(if(${ENV:MANPATH}){':'+${ENV:MANPATH}})+':'),[System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable('INFOPATH',$('/opt/homebrew/share/info'+$(if(${ENV:INFOPATH}){':'+${ENV:INFOPATH}})),[System.EnvironmentVariableTarget]::Process)
$ brew shellenv
set -gx HOMEBREW_PREFIX "/opt/homebrew";
set -gx HOMEBREW_CELLAR "/opt/homebrew/Cellar";
set -gx HOMEBREW_REPOSITORY "/opt/homebrew";
set -q PATH; or set PATH ''; set -gx PATH "/opt/homebrew/bin" "/opt/homebrew/sbin" $PATH;
set -q MANPATH; or set MANPATH ''; set -gx MANPATH "/opt/homebrew/share/man" $MANPATH;
set -q INFOPATH; or set INFOPATH ''; set -gx INFOPATH "/opt/homebrew/share/info" $INFOPATH;
```

The specific case presented in the mentioned discussion could be
mitigated by an additional level of indirection (`{{ output "fish" "-c"
"'brew shellenv'" | trim }}`), that requires that the running system
have the target shells installed, when they are not strictly necessary
with `brew shellenv`.
2023-05-05 11:50:48 -04:00
Mike McQuaid
8c059bba27
Merge pull request #15369 from carlocab/sorbet-runtime
Revert "Revert "Enable Sorbet by default for Homebrew developers and developer commands.""
2023-05-05 15:37:09 +01:00
Carlo Cabrera
f68b635513
Revert "Revert "Enable Sorbet by default for Homebrew developers and developer commands.""
Along with some fixes for failures in Homebrew/core. See discussion at #15368.

This reverts commit e49cd331dba71b1ced341f1838c7651ecff46a38.
2023-05-05 21:40:51 +08:00
Mike McQuaid
f71b3d37ab
Merge pull request #15367 from dawidd6/pypi-version-to-s
bump-formula-pr: fix method argument type
2023-05-05 13:34:12 +01:00
Dawid Dziurla
d2ea65a12b
Merge pull request #15368 from Homebrew/revert-15326-more_sorbet_runtime
Revert "Enable Sorbet by default for Homebrew developers and developer commands."
2023-05-05 14:16:26 +02:00
Dawid Dziurla
e49cd331db
Revert "Enable Sorbet by default for Homebrew developers and developer commands." 2023-05-05 13:58:58 +02:00
Dawid Dziurla
a341f4346c
bump-formula-pr: fix method argument type 2023-05-05 13:51:14 +02:00
Mike McQuaid
448bf8ba9f
Merge pull request #15326 from MikeMcQuaid/more_sorbet_runtime
Enable Sorbet by default for Homebrew developers and developer commands.
2023-05-05 09:09:34 +01:00
Mike McQuaid
6918fb94ce
Enable Sorbet by default for Homebrew developers and developer commands.
I've been doing this personally for a few months and not hit any bugs.
We already do this for `brew tests`.

It will allow us to:

- remove manual type checks from all developer commands (Sorbet does a
  better job with these)
- better surface bugs
- better surface type signatures
- get closer to being able to enable this by default for everyone
2023-05-05 08:56:53 +01:00
Carlo Cabrera
54adebb1de
Merge pull request #15356 from carlocab/macos-timeout
github_runner_matrix: improve macOS timeout handling
2023-05-04 21:22:29 +08:00
Bo Anderson
7d8815cc9d
Merge pull request #15359 from samuello1228/samuello1228
bottle: some tar flags are not supported on Mojave
2023-05-04 12:49:00 +01:00
Mike McQuaid
0e387fee8c
Merge pull request #15138 from JBYoshi/cask-move-contents
Don't remove cask directories when upgrading.
2023-05-04 11:43:44 +01:00
Samuel Lo
41aab1490a bottle: some tar flags is not supported on Mojave 2023-05-04 04:01:51 +08:00
JBYoshi
3e249a9428
Improve styling. 2023-05-03 11:29:01 -05:00
Mike McQuaid
fec24f5c08
Merge pull request #15352 from woodruffw-forks/ww/step-summary-var
brew: add `GITHUB_STEP_SUMMARY` to allowlist
2023-05-03 11:55:53 +01:00
Mike McQuaid
17911130b3
Merge pull request #15349 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-ast-1.28.1
build(deps): bump rubocop-ast from 1.28.0 to 1.28.1 in /Library/Homebrew
2023-05-03 11:52:45 +01:00
Mike McQuaid
529de96b61
Merge pull request #15355 from carlocab/check-before-upload
github_packages: improve upload error handling
2023-05-03 11:52:27 +01:00
Carlo Cabrera
27eed480ee
github_runner_matrix: improve macOS timeout handling
1. Use the maximum timeout possible for GitHub-hosted macOS runners
2. When using a short timeout, use an even shorter timeout on ARM
   runners.

Our ARM runners are typically at least twice as fast as our Intel
runners on any given job. So, if it takes an ARM runner over half the
timeout to complete a job, it's almost certain that the Intel runner
will not complete the job within the timeout.

Setting an even shorter timeout on the ARM runners will help us abandon
jobs that are unlikely to be completed within the timeout well before we
hit the requested timeout.
2023-05-03 17:55:57 +08:00
Carlo Cabrera
9744b69071
github_packages: use exponential backoff when retrying
The retry behaviour in `publish_commit_bottles.yml` [1] is often
successful after the second try, so it's likely that we're not waiting
long enough in between retries here.

Let's fix that by retrying with exponential backoff instead of adding a
fixed interval of five seconds after each failure.

[1] 3241035b2a/.github/workflows/publish-commit-bottles.yml (L431-L443)
2023-05-03 16:58:16 +08:00
Carlo Cabrera
31a152208b
github_packages: improve upload error handling
Erroring out in the middle of uploading multiple bottles results in a
state that is tedious to recover from.

Let's try to avoid these situations by performing checks for all the
bottles first before trying to upload any.
2023-05-03 16:40:42 +08:00
William Woodruff
ce7283ac32
brew: add GITHUB_STEP_SUMMARY to allowlist
Signed-off-by: William Woodruff <william@yossarian.net>
2023-05-02 19:24:14 -04:00
BrewTestBot
360a43ea7d
Update RBI files for rubocop-ast.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow.
2023-05-02 19:05:31 +00:00
BrewTestBot
001f5dad12
brew vendor-gems: commit updates. 2023-05-02 19:00:54 +00:00
dependabot[bot]
6557dfc5f2
build(deps): bump rubocop-ast from 1.28.0 to 1.28.1 in /Library/Homebrew
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.28.0 to 1.28.1.
- [Release notes](https://github.com/rubocop/rubocop-ast/releases)
- [Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-ast/compare/v1.28.0...v1.28.1)

---
updated-dependencies:
- dependency-name: rubocop-ast
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-02 18:58:35 +00:00
Mike McQuaid
e62a839001
Merge pull request #15345 from ZhongRuoyu/update-report-no-origin
cmd/update-report: do not fail when tap has no origin
2023-05-02 12:20:10 +01:00
Mike McQuaid
1715b6a4f2
Merge pull request #15348 from Bo98/download-error-fix
Fix DownloadError erroring itself
2023-05-02 08:38:37 +01:00
Bo Anderson
5921aef55c
Fix DownloadError erroring itself 2023-05-02 02:09:53 +01:00
Mike McQuaid
cdc54636ee
Merge pull request #15344 from samford/download-strategy-replace-in-place-sub
BazaarDownloadStrategy: Replace in-place sub
2023-05-01 18:05:54 +01:00
Ruoyu Zhong
5d9c3d0432
cmd/update-report: do not fail when tap has no origin
This fixes the following error:

    $ brew update
    Warning: No remote 'origin' in /usr/local/Homebrew/Library/Taps/foo/homebrew-bar, skipping update!
    Error: HOMEBREW_UPDATE_BEFORE_FOO_HOMEBREW_BAR is unset!
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:361:in `initialize'
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:187:in `new'
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:187:in `block in output_update_report'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:748:in `block (2 levels) in each'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:747:in `each'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:747:in `block in each'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:746:in `each'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:746:in `each'
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:160:in `output_update_report'
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:40:in `update_report'
    /usr/local/Homebrew/Library/Homebrew/brew.rb:94:in `<main>'
    Already up-to-date.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-05-01 23:37:01 +08:00
Sam Ford
ec2a7121ab
BazaarDownloadStrategy: Replace in-place sub
livecheck's `Git` strategy uses `DownloadStrategyDetector#detect`
in its `#match?` method to check if a URL is a Git repository. This
has historically worked fine but I've recently seen a `can't modify
frozen String` error for a few formulae (percona-toolkit,
schroedinger, squid) in relation to the in-place `sub` call in
`BazaarDownloadStrategy`'s initializer.

Other download strategies use a `@url = @url.sub(...)` pattern to
avoid this issue, so this commit resolves the issue by using the same
approach in `BazaarDownloadStrategy`.
2023-05-01 10:45:13 -04:00
Issy Long
01e0c20d01
Merge pull request #15341 from issyl0/brew-doctor-unnecessary-core-taps
diagnostic: Check for unnecessary Core and Cask taps
4.0.16
2023-04-30 19:25:00 +01:00
Issy Long
a1da2bde3d
Appease brew style 2023-04-30 19:09:41 +01:00
Issy Long
e739a5c076
"A few small nits" from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-04-30 19:06:07 +01:00
JBYoshi
4935a8fbb2
Remove unreachable warning. 2023-04-30 12:29:40 -05:00
Issy Long
40f697e96e
diagnostic: Check for unnecessary Core and Cask taps
- If the user doesn't have `HOMEBREW_DEVELOPER` or
  `HOMEBREW_NO_INSTALL_FROM_API` set but does have `homebrew/core` or
  `homebrew/cask` taps installed this can cause problems with installing
  outdated software.
- Hence, warn them in `brew doctor` if they have either of these taps
  installed, with instructions on how to remove them.
2023-04-30 15:25:56 +01:00
Mike McQuaid
e6d84f43d2
Merge pull request #15337 from ZhongRuoyu/service-block-opt-paths
rubocops/service: check for more cellar paths
2023-04-30 09:58:50 +01:00
Ruoyu Zhong
254941c6f7
rubocops/service: check for more cellar paths
This is a follow-up to #15154. In addition to `bin`, the `service` block
can also reference other cellar paths like `libexec`. They don't work
with the API either, as reported in
https://github.com/orgs/Homebrew/discussions/4459.

Violations are already corrected in Homebrew/homebrew-core#129736
and Homebrew/homebrew-core#129737.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-04-30 07:39:25 +08:00
Mike McQuaid
0c478b36df
Merge pull request #15334 from samford/livecheck/sorbet-runtime-fixes
Livecheck: Fixes for Sorbet runtime
2023-04-29 15:55:06 +01:00