5034 Commits

Author SHA1 Message Date
Patrick Linnane
3fdba532a2
various: fix miscellaneous typos
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-01-12 10:56:49 -08:00
Mike McQuaid
11e4b66dcf
Merge pull request #16456 from Bo98/formulary-platform-cache
Introduce Formulary platform cache
2024-01-09 11:24:22 +00:00
Bo Anderson
310b5ecbe7
Introduce Formulary platform cache 2024-01-09 11:12:49 +00:00
Mike McQuaid
06752f032f
cmd/*env-sync: use *ENV_ROOT
Fixes https://github.com/Homebrew/brew/issues/16428
2024-01-09 10:13:33 +00:00
apainintheneck
b79778229c Resolve Cask::Cask.all todo
Now it takes the :eval_all parameter that means we can remove
ARGV handling inside Cask::Cask.all.
2023-12-21 21:55:16 -08:00
Rylan Polster
641a80475e
Update cask logic to handle deprecations and disables 2023-12-16 20:01:47 -05:00
Bo Anderson
89531e9ff3
Update all dependencies 2023-12-15 16:24:46 +00:00
Mike McQuaid
fbd3d4e48a
cmd/untap: be more careful about formula tap.
`Formula#any_version_installed?` doesn't consider taps so we need to
manually check the tabs from the kegs instead.

See https://github.com/Homebrew/brew/pull/16330#issuecomment-1854007492
onwards for relevant discussion.
2023-12-13 15:24:37 +00:00
Mike McQuaid
beb9799265
cmd/untap: fix untapping syntax failure.
If an installed cask is invalid on attempting an untap: it will
prevent untapping that cask.

Fix this in two ways: one more specific to `untap` and one more
generally to other commands too:
- specific: only read the actual formulae/casks from the tap we're
  untapping instead of all of those that are installed
- general: rescue more exceptions in `Cask::Caskroom.casks` (like we
  already do for `Formula.installed`
2023-12-13 13:54:37 +00:00
Mike McQuaid
cd8a9c02cb
Merge pull request #16301 from apainintheneck/update-pinned-formula-messaging
cmd/pin: Update pinned formula messaging
2023-12-13 12:17:21 +00:00
Mike McQuaid
d0da6bdf7c
cmd/upgrade: deprecate --ignore-pinned. 2023-12-13 12:03:54 +00:00
apainintheneck
9a00f2795d cmd/upgrade: Error when attempting to explicitly upgrade a pinned pkg
The idea here is that it should be expected that `brew upgrade` will
not upgrade pinned packages but will attempt to upgrade everything else.
For that reason, it will only show a warning about pinned packages
in that case.

If, on the other hand, you pass the name of a pinned package explicitly
to the upgrade command, like in `brew upgrade PINNED`, we want to show
an error since we cannot upgrade that package until it gets unpinned.
2023-12-13 00:15:00 -08:00
Bo Anderson
5ee6e967da
Merge pull request #16306 from Bo98/4.2.0-deprecations
Deprecate, disable & delete code for Homebrew 4.2.0
2023-12-11 15:44:00 +00:00
apainintheneck
b3a6e59f96 cmd/pin: Update pinned formula messaging
The hope is that this will be clearer and less annoying for users.

A user came to us a couple weeks ago stating that it was confusing
that the `brew upgrade` command printed an error when a pinned
formula had a new version available and didn't get upgraded.

This PR changes that message to a warning from an error. While looking
into this we found that there is another message that gets printed
when a package dependency doesn't get upgraded because it is pinned
and that got turned into a warning from a normal message. Honestly,
that should be more worrying for the user anyway; it could lead to
a program not working correctly in the worst case.

I also added a message to the `brew pin` command warning about
potential unintended behavior if a dependency gets pinned and another
package requires a newer version of it.

Lastly, I added a commented out deprecation notice for the
`brew upgrade --ignore-pinned` command since it's now the default.
2023-12-07 23:43:02 -08:00
Bo Anderson
7ba5480dff
cmd/vendor-install: don't silence stderr 2023-12-08 00:10:56 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Bo Anderson
2a02038690
cmd/update.sh: don't switch to master when updating to a tag 2023-12-02 03:06:30 +00:00
Bo Anderson
e19c3e1f13
Unset HOMEBREW_RUBY3 after updates 2023-12-01 13:44:33 +00:00
Bo Anderson
489879ff72
Enable Ruby 3 for all users 2023-11-29 15:30:17 +00:00
Rylan Polster
8704e79cc0
Separate MacOS references 2023-11-15 18:19:39 -05:00
Douglas Eichelberger
0191af7899 resolve typecheck errors 2023-11-05 08:55:58 -08:00
Bo Anderson
4ec450823c
Portable Ruby 3.1.4 (opt-in beta) 2023-10-27 15:58:43 +01:00
Mike McQuaid
a2cd92b115
cmd/setup-ruby.sh: add new command.
This command, a bit like `install-bundler-gems`, is intended to be run
to ensure that the next invocation of `brew` will not need to try and
install Ruby or Bundler gems.
2023-10-27 09:27:56 +01:00
Bo Anderson
337a8fc6ea
cmd/fetch: support retrying manifest downloads 2023-10-13 21:14:07 +01:00
Eric Knibbe
8e01227add
cmd/deps: show deps for head spec with --HEAD
Plus a few man page fixes
2023-10-13 00:29:09 -04:00
Eric Knibbe
075ee81ab7
cmd/fetch: restore --HEAD functionality 2023-10-07 10:50:03 -04:00
Xuehai Pan
6f0d87aace docs: prefer placing shellenv command in rcfile rather than shell profile on Linux 2023-10-07 00:14:26 +08:00
Mike McQuaid
affc4c01aa
Merge pull request #16068 from J-M0/fish-shellenv
fix `eval (brew shellenv)` from exiting with status 1 in fish
2023-10-01 18:58:57 +01:00
Mike McQuaid
a0805d8678
Merge pull request #16059 from MikeMcQuaid/whoami
Improve use of `whoami`
2023-10-01 16:04:00 +01:00
James Morris
793831cb93 fix eval (brew shellenv) from exiting with status 1 in fish
fish's `set` doesn't modify the exit status when assigning a variable.
This means that `set -q VAR; or set VAR ...` will return an exit status
of 1 even if the variable is suceessfully set. By switching the commands
to `! set -q VAR; and set VAR ...`, this prevents the 1 from propogating
when running `eval (brew shellenv)`.
2023-09-30 17:39:39 -04:00
Mike McQuaid
39bbc33a27
Improve use of whoami
If you're e.g. running Homebrew over `sudo`: shelling out to `whoami`
is less effective than just telling people which user you're running
as when we run the check.
2023-09-29 12:32:22 +01:00
Bo Anderson
af7d744af0
Fixes for Ruby 3 2023-09-29 05:25:48 +01:00
Mike McQuaid
073a4bb925
Merge pull request #16014 from apainintheneck/scrub-sorbet-runtime-from-backtrace
utils/backtrace: scrub sorbet-runtime from backtrace
2023-09-22 09:53:10 +01:00
apainintheneck
85bd4c7e1f utils/backtrace: scrub sorbet-runtime from backtrace
Ever since we started using this at runtime it's been polluting
the backtrace output. This makes it harder to debug errors and
increases the amount of info users have to paste into the box
when filing an issue.

This is a very direct approach. Essentially, we strip out
everything related to the `sorbet-runtime` gem whenever the top
line in the backtrace is unrelated to sorbet-runtime.

The hope is that this will allow errors related to sorbet to
be diagnosed easily while also reducing the backtrace size
for all other types of errors.

Sometimes it is useful to see the full backtrace though.
For those cases, we include the full backtrace when
`--verbose` is passed in and print a warning that the
Sorbet lines have been removed from the backtrace the
first time they are removed.

Note: This requires gems to be set up so that the call to
`Gem.paths.home` works correctly. For that reason, it must
be included after `utils/gems` which is included in
`standalone/load_path` already.
2023-09-21 21:07:22 -07:00
apainintheneck
5760ae4fb2 cmd/readall: Cleanup todos
- keep running the command against all os/arch combinations
  as the default
- remove todos and deprecations related to changing the behavior
- create constants for os/arch combinations
2023-09-19 21:33:13 -07:00
Eric Knibbe
c493b5e680
cmd+dev-cmd: fixes for output formatting 2023-09-11 02:29:57 -04:00
Eric Knibbe
4662678b3b
cmd+dev-cmd: adjust description line breaks
Use to distinguish additional notes from initial explanation and usage info
2023-09-11 02:29:21 -04:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04:00
Eric Knibbe
beafe82096
cmd/deps: explain runtime dependencies mode 2023-09-09 12:11:12 -04:00
apainintheneck
1dc9274f62 Improve cask audit
- check for cask.url in audit steps
- check for cask.version in audit steps
- check for cask.sha256 in fetch command
- stop omitting casks based on nil url in audit command

It would be nice to be able to omit casks from the audit
if the os is not supported but there is not easy way to
do that without updating the SimulateSystem code or
refactoring how MacOSRequirement's are defined in the DSL.
2023-09-07 20:38:17 -07:00
apainintheneck
f4b15e95ac cmd/fetch & cmd/audit: handle unsupported os/arch combos
It's possible for casks to only run on certain os/arch
combinations but we don't check for them in the fetch and
audit commands.

At first, I tried to check if the macos version was satisfied
in a previous PR but that doesn't work correctly because
MacOSRequirement and ArchRequirement don't respect SimulateSystem.

Instead I'm just checking to see if the url stanza is defined
for each os/arch combination and skipping those casks where
it ends up being nil. This is kind of brute forcing it but
should work.
2023-09-04 15:00:31 -07:00
Mike McQuaid
4ad5321d03
Merge pull request #15937 from MikeMcQuaid/cleanup_todo
Cleanup various TODOs
2023-09-03 09:29:03 -04:00
Mike McQuaid
db1267bdff
Merge pull request #15943 from apainintheneck/handle-nil-urls-in-cask-installer
Handle nil cask urls caused by unsupported macOS version
2023-09-03 09:23:08 -04:00
Mike McQuaid
f73607553c
Cleanup various TODOs
These were also easily fixed, already fixed or incorrect and
non-controversial.

Co-authored-by: Issy Long <issyl0@github.com>
2023-09-03 09:12:41 -04:00
apainintheneck
8c2f101138 cmd/fetch: handle nil cask urls
These urls can be nil if there is an unsatisfied macos version
requirement. We check for false here because either the macos
requirement can be satisfied and return true or can not be
specified and return nil. If it's not specified, it means it
can run on any macos version.

The change in Cask::Download should provide better error messages
in Downloadable but honestly we're better off just checking for
the missing url higher up the call stack which is why I made
the changes in the fetch command. Either way it seemed like
a good idea while I'm here.
2023-09-02 20:56:55 -07:00
hyuraku
adc2a2fea1 remove ARGV from Formula#all 2023-09-02 19:35:22 +09:00
Mike McQuaid
9863d555a8
cmd/deps: fix documentation and handling of formula_options.
https://github.com/Homebrew/brew/pull/15892#issuecomment-1698659908
2023-08-30 08:46:59 +01:00
Mike McQuaid
851df262a0
Merge pull request #15892 from apainintheneck/rework-recursive-dependency-resolution
dependency_helpers: rework recursive dependency resolution
2023-08-30 08:29:24 +01:00
apainintheneck
b2b8f0ea86 cmd/uses & cmd/deps: update help/man pages
- add clarification about precedence of command options
- reword some options for readability
- clarify the defaults in `brew deps`
2023-08-28 22:14:26 -07:00
apainintheneck
72152c09c7 cmd/uses: handle --missing
Ignore all dependencies that are already installed before
checking if they use the dependency in question. Remove
the :satisfied? criteria before checking used dependents.
2023-08-27 13:50:53 -07:00