348 Commits

Author SHA1 Message Date
Mike McQuaid
f404aafe56
brew: clarify which user needs to be able to read the working directory.
Otherwise, in multi-user environments, it can be ambiguous.
2024-01-11 12:24:04 +00:00
Mike McQuaid
abc1d14807
Improve working directory error messages
- Check for directory existing and directory being readable separately
  and print appropriate messages for each
- Make error messages more consistent
2024-01-10 17:21:57 +00:00
Bo Anderson
89531e9ff3
Update all dependencies 2023-12-15 16:24:46 +00:00
Bo Anderson
688d87e839
Remove Ruby 2.6 & macOS system Ruby support code 2023-12-12 03:44:31 +00:00
Bo Anderson
987ebe3d6d
Require Ruby 3.1 2023-12-05 02:31:08 +00:00
Bo Anderson
e19c3e1f13
Unset HOMEBREW_RUBY3 after updates 2023-12-01 13:44:33 +00:00
Bo Anderson
d68e3e563e
Merge pull request #16268 from Bo98/ruby3-for-all
Enable Ruby 3 for all users
2023-11-30 14:27:59 +00:00
Mike McQuaid
e3d1996a43
brew.sh: bump unknown HOMEBREW_VERSION. 2023-11-30 11:44:10 +00:00
Bo Anderson
489879ff72
Enable Ruby 3 for all users 2023-11-29 15:30:17 +00:00
Bo Anderson
2658f4467f
brew.sh: always run test-bot under Ruby 3 2023-11-24 14:19:32 +00:00
Bo Anderson
6502524456
brew.sh: set HOMEBREW_RUBY3 earlier 2023-11-22 00:51:43 +00:00
Bo Anderson
559336c771
Enable Ruby 3 for HOMEBREW_DEVELOPER 2023-11-20 20:04:18 +00:00
Bo Anderson
386fd0548a
Support system Ruby 3 on Linux 2023-11-07 19:27:30 +00:00
apainintheneck
e1dda872c3 use XDG_CACHE_HOME on Linux
This variable was getting filtered out before so it wasn't possible
for us to use it as the default for HOMEBREW_DEFAULT_CACHE
and HOMEBREW_DEFAULT_LOGS.
2023-10-28 19:10:20 -07:00
Mike McQuaid
9ee15e02a3
workflows/pkg-installer: fix filename.
This intermediate state got missed during a previous refactoring PR.
2023-10-04 15:34:04 +01:00
Mike McQuaid
c95a26b917
Improve building Homebrew*.pkg
- split jobs into build/test/deploy
- test package on both macOS Intel and Apple Silicon
- cleanup some argument handling
- use `HOMEBREW_MACOS_OLDEST_SUPPORTED` naming to be consistent with
  `brew.sh`
- note in `brew.sh` that `Distribution.xml` also needs updated (and do
  so)
- various other little bits of style cleanup
2023-10-04 10:18:27 +01:00
Mike McQuaid
def7ab4103
brew.sh: improve/add comment for supported macOSs. 2023-10-02 16:41:51 +01:00
Francois-Xavier Coudert
c3a2c40aa8 Make Sonoma supported 2023-09-24 11:12:05 +02:00
Mike McQuaid
8775465872
Enable Sorbet after running a developer command
We have no commands with Sorbet disabled and have had Sorbet enabled
for developers for a decent amount of time. As a result, we can enable
it for everyone who has run a developer command.

This also allows a bunch of `raise TypeError`s to be removed in favour
of relying on Sorbet here instead.
2023-09-02 08:39:28 -04:00
Branch Vincent
a75568147e
brew.sh: disable shellcheck warning 2023-08-26 12:48:30 +01:00
Mike McQuaid
6335728b61
brew.sh: fix shellcheck warning.
Fixes #15876.
2023-08-16 12:01:25 +01:00
Mike McQuaid
1481eac57c
brew.sh: don't set HOMEBREW_NO_INSTALL_FROM_API automatically.
My understanding is that now https://github.com/Homebrew/brew/pull/15778
has been merged this should now work fine on both older macOS versions
and non-default prefixes so let's try this again.
2023-08-15 11:42:02 +01:00
Mike McQuaid
389bcf4eb4
Merge pull request #15781 from MikeMcQuaid/post_install_improvements_fixes
post_install: improvements and fixes.
2023-07-28 12:06:05 +01:00
Mike McQuaid
7801878c74
post_install: improvements and fixes.
- warn if running `brew postinstall` explicitly and there's no
  `post_install` defined in the formula
- add a `post_install` alias for `brew postinstall` to make life
  easier for those jumping between `postinstall` and `post_install` in
  e.g. Homebrew development
- refactor `post_install` formula path logic into a new method for
  improved readability
- handle the JSON API `post_install` formula path case
2023-07-28 11:26:09 +01:00
Mike McQuaid
2c300cfbe9
brew update core/homebrew-cask taps properly
The existing logic in `update.sh` was both a bit hard to follow and
had some edge cases. Fix this up for improving #15775.
2023-07-28 10:13:57 +01:00
Mike McQuaid
21d8f82056
Add/use HOMEBREW_INSTALL_FROM_API_UNSUPPORTED
When we're automatically setting `HOMEBREW_NO_INSTALL_FROM_API`
when on an old macOS version or with a non-default prefix (e.g. cases
where you're going to be mostly building from source).

My initial plan was to set
`HOMEBREW_AUTOMATICALLY_SET_NO_INSTALL_FROM_API` in these cases but
it's used differently enough it made sense to add another internal
variable instead: `HOMEBREW_INSTALL_FROM_API_UNSUPPORTED`.

At the moment this is only used to avoid printing the "You have set
`HOMEBREW_NO_INSTALL_FROM_API`" message inside `brew update` but may
make sense to use in other places over time.

Ideally, we'll get rid of these automatic sets of
`HOMEBREW_NO_INSTALL_FROM_API` and perhaps even the variable entirely.
2023-07-27 12:36:54 +01:00
Carlo Cabrera
e576fe0062
Revert "brew.sh: don't set HOMEBREW_NO_INSTALL_FROM_API automatically."
https://github.com/Homebrew/brew/pull/15765#issuecomment-1652856355

This reverts commit d9bc51f8171b49486a871a8bb12a2629df28a519.
2023-07-27 11:35:37 +08:00
Mike McQuaid
d9bc51f817
brew.sh: don't set HOMEBREW_NO_INSTALL_FROM_API automatically.
My understanding from conversations with Bo98 is that this should now
work fine on both older macOS versions and non-default prefixes.

Similarly, it's super confusing when this is set automatically and you
can't figure out why...
2023-07-26 15:36:04 +01:00
Mike McQuaid
cf65176853
Update Library/Homebrew/brew.sh 2023-07-21 11:46:04 +01:00
Mike McQuaid
0ae98a8a09
Enable HOMEBREW_SORBET_RUNTIME (sometimes)
Reverts #15385 with some tweaks.
2023-07-18 13:17:54 +01:00
Michka Popoff
518fb43112
Merge pull request #15656 from osalbahr/silverbrew
Feature: support symlinked /home
2023-07-15 13:45:07 +02:00
Sean Molenaar
7f55ee4494
Update Library/Homebrew/brew.sh 2023-07-12 10:59:57 +02:00
Sean Molenaar
ac78a4b512
Update Library/Homebrew/brew.sh 2023-07-12 10:55:52 +02:00
Sean Molenaar
2b83895d73
brew.sh: record OS version for non-debian linux 2023-07-12 10:51:25 +02:00
Osama Albahrani
64b6479100 brew.sh: fix HOMEBREW_PREFIX if /home is a symlink
Correct `HOMEBREW_PREFIX`, and its only dependent up to that point, `HOMEBREW_REPOSITORY`, if the defaults contain symlinks. For example:
```console
$ realpath /home/linuxbrew/.linuxbrew
/var/home/linuxbrew/.linuxbrew
$ ls -ld /home
lrwxrwxrwx. 4 root root 8 Jun 29 22:29 /home -> var/home
```
I was hoping to correct `HOMEBREW_PREFIX` from the start (in `bin/brew`), but the default prefixes are in `brew.sh`. See #15656 for a discussion on this middleground solution.

Co-Authored-By: rohanssrao <17805516+rohanssrao@users.noreply.github.com>
Co-Authored-By: Bo Anderson <mail@boanderson.me>
2023-07-09 18:33:31 -04:00
Osama Albahrani
287a359a74 brew.sh: set HOMEBREW_CELLAR after default prefix
Fixes #14557. This allows correcting the prefix variables first. See #15656.

Co-Authored-By: rohanssrao <17805516+rohanssrao@users.noreply.github.com>
2023-07-09 18:33:04 -04:00
Bo Anderson
bb7aef85db
Migrate remaining no-api commands to new scoped system 2023-06-22 17:11:20 +01:00
Bo Anderson
613d2aeb32
brew.sh: fix auto-update interval for dev-cmd users 2023-06-22 15:17:19 +01:00
Mike McQuaid
8d9aa9070a
Merge pull request #15564 from Bo98/better-auto-no-api
Better scoping for no-api commands
2023-06-22 12:38:03 +01:00
Bo Anderson
e2e80d77a3
dev-cmd/test: use localised no-api scoping 2023-06-22 01:57:35 +01:00
Bo Anderson
55419bfd8b
Allow bump commands to auto-update core tap clones 2023-06-22 01:39:55 +01:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Patrick Linnane
7c7ddd82fe
Revert "Merge pull request #15377 from carlocab/sorbet-runtime-take2"
This reverts commit cca98d5637d847548791b5afb16a5c609de2cb58, reversing
changes made to c0f8068573bbf886fdc78d3f9daca54d53e7e49e.
2023-05-08 12:16:11 -07:00
Austin Ziegler
74b50ddc89
Fix small errors in brew shellenv
These were introduced by typos and an incorrect assumption on the last
update of #15358. The last commit had been tested with a parameter, but
had not been re-tested *without* parameter.

Apologies for the error.
2023-05-08 11:06:30 -04:00
Mike McQuaid
628626b078
Merge pull request #15363 from halostatue/shellenv-shell-parameter
Allow brew shellenv to accept a shell name param
2023-05-08 12:39:05 +01:00
Carlo Cabrera
84cb8a42f7
Revert "Revert "Merge pull request #15369 from carlocab/sorbet-runtime""
We need to exclude any command that might read `lsyncd` on Linux while
simulating macOS. This seems like all of them.

This reverts commit bcf94f6e27d26a6844ee1fa7af73333321015987.
2023-05-08 11:37:48 +08: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
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
Dawid Dziurla
e49cd331db
Revert "Enable Sorbet by default for Homebrew developers and developer commands." 2023-05-05 13:58:58 +02:00