1676 Commits

Author SHA1 Message Date
Bevan Kay
de8c088d15
fix opening PR from fork 2025-04-22 22:03:49 +10:00
Bevan Kay
c5a3879fdb
bump: bump synced formula together 2025-04-22 22:03:06 +10:00
Mike McQuaid
7873f0200f
Revert "bump: bump synced formula together" 2025-04-22 12:33:59 +01:00
Bevan Kay
7ccdc340a3
bump: bump synced formula together 2025-04-16 22:49:14 +10:00
Patrick Linnane
a272310c37
utils/gems: update Bundler version
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-04-09 11:43:19 -07:00
Mike McQuaid
020a30caa7
utils/ruby: set HOMEBREW_BOOTSNAP_GEM_PATH after Ruby install.
This should ensure it's set to the correct path.
2025-04-07 16:55:20 +01:00
Patrick Linnane
b4d18a8c6d
Merge pull request #19657 from Homebrew/support_tiers_code
Link to Support Tiers in diagnostic/error messages
2025-04-01 16:19:01 +00:00
Patrick Linnane
39afba427e
Merge pull request #19670 from Homebrew/bump_warn_unofficial_taps
dev-cmd/bump-*: only warn on duplicate PRs for official taps.
2025-04-01 16:18:22 +00:00
Mike McQuaid
d899f00c4b
Link to Support Tiers in diagnostic/error messages
Now that we have this nice URL let's reference it to allow our other
messages to be a bit shorter/kinder.
2025-04-01 11:35:27 +01:00
Mike McQuaid
108ecf9aac
dev-cmd/bump-*: only warn on duplicate PRs for official taps.
The default behaviour is too strict for unofficial taps. We can still
warn elsewhere but, given the potential for false positives, let's
loosen things a bit.
2025-04-01 11:01:17 +01:00
Mike McQuaid
9560c01453
Enable Bootsnap by default
- do some optimisation of `require`s before Bootsnap
- remove `HOMEBREW_BOOTSTRAP` environment variable as it's set by
  default
- add fast require in `bootsnap.rb` using logic from `ruby.sh`
- cleanup `bootsnap.rb` a bit
- remove setting `HOMEBREW_BOOTSNAP` in GitHub Actions
2025-03-31 17:55:07 +01:00
Douglas Eichelberger
138eba20f8
Merge pull request #19618 from Homebrew/formula-url-getter
fix: Allow Formula.url with no args to get url
2025-03-28 17:31:45 +00:00
Patrick Linnane
9821a7e896
fix new offenses
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-03-27 03:38:09 +00:00
Bo Anderson
1168ec1feb
Reset Bootsnap after installing gems 2025-03-27 03:37:17 +00:00
Douglas Eichelberger
e58486cd4c
fix: Allow Formula.url with no args to get url 2025-03-26 12:15:25 -07:00
Mike McQuaid
1ce12ae6e5
Merge pull request #19575 from Homebrew/brew_bundle_filtering
Don't filter the environment for `brew bundle (exec|env|sh)`
2025-03-25 09:07:39 +00:00
Adrian Ho
0efa6aab32 popen: get correct cmd name on error
Blindly using args[0] misleads users when an env is passed.

Before:
```
==> go build -ldflags=-s -w -X main.version=1.64.8 -X main.commit=8b37f14 -X main.date=2025-03-17T16:54:02Z ./cmd/golangci-lint
brew: command not found: {"SHELL"=>"bash"}
Error: Failure while executing; `\{\"SHELL\"=\>\"bash\"\} /opt/homebrew/Cellar/golangci-lint@1/1.64.8/bin/golangci-lint completion bash` exited with 127. Here's the output:
```
After:
```
==> go build -ldflags=-s -w -X main.version=1.64.8 -X main.commit=8b37f14 -X main.date=2025-03-17T16:54:02Z ./cmd/golangci-lint
brew: command not found: /opt/homebrew/Cellar/golangci-lint@1/1.64.8/bin/golangci-lint
Error: Failure while executing; `\{\"SHELL\"=\>\"bash\"\} /opt/homebrew/Cellar/golangci-lint@1/1.64.8/bin/golangci-lint completion bash` exited with 127. Here's the output:
```
2025-03-25 11:36:23 +08:00
Mike McQuaid
6e20cedb67
Don't filter the environment for brew bundle (exec|env|sh)
It's both unexpected and undesirable for `brew bundle (exec|env|sh)` to
filter the environment and makes these tools less useful.

Not filtering the environment, though, causes issues with the
`brew bundle sh` shell. Fix this up and, while we're here, also improve
the formatting for both `zsh` and `bash` (the default) to use nicer and
more consistent prompts and colours.

To simplify this, consolidate some logic in a new
`Utils::Shell.shell_with_prompt` method and add tests for it and a
similar notice for `brew bundle sh`.

Finally, avoid printing out the notice when `HOMEBREW_NO_ENV_HINTS` is
set.
2025-03-24 13:37:25 +00:00
Douglas Eichelberger
c48870080e
Incorporate feedback 2025-03-13 11:59:31 -07:00
Douglas Eichelberger
e49a69679d
Enable strict typing in TopologicalHash 2025-03-12 19:09:52 -07:00
Douglas Eichelberger
1ca5299f40
refactor: Enable strict typing in download_strategy 2025-03-12 15:15:20 -07:00
Sam Ford
9096a111d7
curl_headers: Handle POST requests
`Livecheck::Strategy.page_headers` uses `Utils::Curl.curl_headers` but
the method only handles `HEAD` and `GET` requests. I recently added
`POST` support to livecheck but forgot to update `curl_headers` in the
process, so `livecheck` blocks using the `HeaderMatch` strategy along
with `post_form` or `post_json` will fail because curl doesn't allow
both `--head` and `--data`/`--json` arguments.

This addresses the issue by updating `curl_headers` to handle `POST`
requests and skip the `GET` retry logic.
2025-03-07 20:28:03 -05:00
Heath Stewart
42caf20fa4
Add PowerShell (pwsh) completion support
Resolves #19403
2025-03-02 18:17:38 -08:00
Mike McQuaid
7a5d4256e5
Fix Rubocop warnings (without brew style --fix) 2025-02-28 09:59:32 +00:00
Douglas Eichelberger
afbc1dab54 Clean up OnSystem rbis 2025-02-13 16:33:59 -08:00
Branch Vincent
3d7c6fa10f
utils/pypi: remove extra newline when updating resources 2025-02-08 09:43:47 -08:00
Adrian Ho
956b71eeed update-python-resources: add option to ignore errors
This is particularly useful for third-party Python formulae that have a ton of resources, not all of which may adhere to homebrew/core's strict policies. See #19240 for context.

I've also added logic that ignores `--ignore-errors` on `homebrew/core`, although I personally think this new behavior is also useful for mainline formula creation.

Before: error out on a single non-conforming resource, zero resource blocks added to formula, scary stacktrace.

After: all conforming resources added, all non-conforming resources identified in comments, error message at end, `brew` exits non-zero without scary stacktrace:-
```
% brew update-python-resources --ignore-errors gromgit/test/auto-coder || echo OOPS
==> Retrieving PyPI dependencies for "auto-coder==0.1.243"...
==> Retrieving PyPI dependencies for excluded ""...
==> Getting PyPI info for "aiohappyeyeballs==2.4.4"
[200+ resource lines elided]
==> Getting PyPI info for "zhipuai==2.1.5.20250106"
==> Updating resource blocks
Error: Unable to resolve some dependencies. Please check /opt/homebrew/Library/Taps/gromgit/homebrew-test/Formula/auto-coder.rb for RESOURCE-ERROR comments.
OOPS

% brew cat gromgit/test/auto-coder | ggrep -C10 RESOURCE-ERROR
  license "Apache-2.0"

  depends_on "python@3.11"

  # Additional dependency
  # resource "" do
  #   url ""
  #   sha256 ""
  # end

  # RESOURCE-ERROR: Unable to resolve "azure-cognitiveservices-speech==1.42.0" (no suitable source distribution on PyPI)
  # RESOURCE-ERROR: Unable to resolve "ray==2.42.0" (no suitable source distribution on PyPI)

  resource "aiohappyeyeballs" do
    url "e4373e888f/aiohappyeyeballs-2.4.4.tar.gz"
    sha256 "5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745"
  end

  resource "aiohttp" do
    url "952d49c730/aiohttp-3.11.12.tar.gz"
    sha256 "7603ca26d75b1b86160ce1bbe2787a0b706e592af5b2504e12caa88a217767b0"
  end
```
2025-02-06 21:20:55 +08:00
William Woodruff
46d67ba560
utils/pypi: warn when pypi_info fails due to missing sources
Signed-off-by: William Woodruff <william@yossarian.net>
2025-02-05 15:25:38 -05:00
Mike McQuaid
791194865f
Merge pull request #19188 from Homebrew/arm64_linux-tag
Rename aarch64_linux tag to arm64_linux
2025-02-03 13:21:59 +00:00
Markus Reiter
3e8709e4da
Use full terminal height for concurrent output. 2025-02-01 17:58:54 +01:00
Bo Anderson
fed5321969
Rename aarch64_linux tag to arm64_linux 2025-02-01 13:03:58 +01:00
zyoshoka
8aa22ea939
utils/github: fix GraphQL error log
The key `type` is not included in the response, making the log look weird.
2025-02-01 00:39:58 +09:00
zyoshoka
9e93b52371
utils/curl: fix user_agent types
`user_agent` should also allow strings and nil.
2025-01-30 19:20:58 +09:00
Michka Popoff
d436eb2e51
analytics: fix type error
Fixes:
Error: Parameter 'days': Expected type String, got type Integer with value 30
Caller: /opt/homebrew/Library/Homebrew/utils/analytics.rb:273
Definition: /opt/homebrew/Library/Homebrew/utils/analytics.rb:412 (Utils::Analytics.table_output)
2025-01-26 16:30:30 +01:00
Caleb Xu
2373b6d586
utils: add check_binary_linkage function 2025-01-23 11:26:38 -05:00
Issy Long
66e50846e2
Only need a single, more readable, print_stderr 2025-01-22 22:03:28 +00:00
Issy Long
34b4cc796f
Early return if Shell#profile's preferred is nil 2025-01-22 22:01:34 +00:00
Issy Long
f3a68b616c
Early return in Tty#color? for nil @stream 2025-01-22 22:01:34 +00:00
Issy Long
599616e8e0
Apply easy to understand Sorbet typing corrections
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-01-22 22:01:34 +00:00
Issy Long
7a88125df0
The Style/AvoidDoubleNegation RuboCop is insistent 2025-01-22 22:01:34 +00:00
Issy Long
975a707b3c
Bump some utils/ files to Sorbet typed: strict 2025-01-22 22:01:34 +00:00
Sam Ford
d8125322e1
Curl: expand test coverage
This adds more tests to `curl_spec.rb` to increase test coverage.
This brings almost all of the methods that don't make network
requests up to 100% line and branch coverage (the exception being
some guards in `parse_curl_output` that shouldn't happen under
normal circumstances).

In the process of writing more tests for `parse_curl_response`, I
made some tweaks to remove checks for conditions that shouldn't ever
be true (e.g., `match["code"]` isn't optional, so it will be present
if `HTTP_STATUS_LINE_REGEX` matches) and to refactor some others. I
contributed this method a while back (9171eb2), so this is me coming
back to clarify some behavior.
2025-01-14 08:14:39 -05:00
Sam Ford
cf22382921
Curl: use typed: strict
This upgrades `utils/curl.rb` to `typed: strict`, which requires
a number of changes to pass `brew typecheck`. The most
straightforward are adding type signatures to methods, adding type
annotations (e.g., `T.let`) to variables that need them, and ensuring
that methods always use the expected return type.

I had to refactor areas where we call a `Utils::Curl` method and use
array destructuring on a `SystemCommand::Result` return value
(e.g., `output, errors, status = curl_output(...)`), as Sorbet
doesn't understand implicit array conversion. As suggested by Markus,
I've switched these areas to use `#stdout`, `#stderr`, and `#status`.
This requires the use of an intermediate variable (`result`) in some
cases but this was a fairly straightforward substitution.

I also had to refactor how `Cask::URL::BlockDSL::PageWithURL` works.
It currently uses `page.extend PageWithURL` to add a `url` attribute
but this reworks it to subclass `SimpleDelegator` and use an
`initialize` method instead. This achieves the same goal but in a way
that Sorbet can understand.
2025-01-14 08:14:39 -05:00
Issy Long
6ada9a9665
Add clarifying comments to rubocop:disables
- Needed for PR 18842 that adds a `DisableComment` RuboCop to ensure that all RuboCop disables have comments.
2025-01-12 16:59:07 +00:00
Issy Long
268f801038
Bump more files to Sorbet typed: strict 2025-01-11 00:11:27 +00:00
Daeho Ro
05b97cdc48
fix prerelease check to allow standard release 2024-12-27 19:22:04 +09:00
Daeho Ro
d50e872fd8
update prerelease check to allow standard release 2024-12-25 20:52:38 +09:00
Daeho Ro
ce25ac7be6
update prerelease check to allow standard release 2024-12-25 16:57:07 +09:00
Michael Cho
e9671db2d3
utils/github: handle over 30 changed files 2024-12-13 22:41:21 -05:00
Douglas Eichelberger
9e3e1e1847 Namespace some top-level constants 2024-12-11 11:04:55 -08:00