406 Commits

Author SHA1 Message Date
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
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
Bo Anderson
e2aae0fa63
Require Ruby 2.6.10 2023-04-12 13:15:34 +01:00
Mike McQuaid
5631310653
Auto-update from the API less often
Instead of doing so literally whenever we query for a formula, Instead
do so only when we're in an auto-updateable command.

This better fits the existing behaviour while still updating when it's
most important to do so.
2023-03-10 17:53:15 +00:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bo Anderson
559bec95bc
Scope HOMEBREW_NO_INSTALL_FROM_API to core formulae in brew audit 2023-02-24 13:33:46 +00:00
Mike McQuaid
8d02143c2b
Add generate-{cask,formula}-api commands
These replace the similar scripts in formulae.brew.sh.

Part of #14730.
2023-02-22 15:33:16 +00:00
Bo Anderson
dc286a11ff
Add shell optimisation for --cellar 2023-02-19 05:38:16 +00:00
Mike McQuaid
f39ab585b9
Further adjust HOMEBREW_AUTO_UPDATE_SECS
Add another case to update once an hour when developer commands have
been run.
2023-02-15 17:37:12 +00:00
Mike McQuaid
c5252817c2
analytics: refactor InfluxDB/Google handling. 2023-02-15 16:34:50 +00:00
Mike McQuaid
4c8ed77302
Improve homebrew/{core,cask} autotapping.
Don't automatically tap these when running a developer command that's
not using the API.

Fixes #14606
2023-02-14 09:54:24 +00:00
Mike McQuaid
75a20689b1
Add HOMEBREW_API_AUTO_UPDATE_SECS
This sets the default and allows customising how often we try to
download files from the API.

This does not affect `brew update` as we want to always check every time
on an explicit call.
2023-02-11 07:22:50 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Mike McQuaid
e301fe8fd8
brew.sh: move shared curl speed limit settings here.
This avoids duplication and potentially allows it to be used for various
other `curl` calls.
2023-02-10 17:27:10 +00:00
Mike McQuaid
cb1872e5bf
Merge pull request #14553 from MikeMcQuaid/4.0.0-changes 2023-02-08 11:05:08 +00:00
Carlo Cabrera
61e82290d7
brew.sh: declare commands that call auto-update as an array
Follow up to #14536.
2023-02-08 02:41:41 +08:00
Mike McQuaid
2a5d41d41b
Revert "Merge pull request #14547 from Homebrew/revert-14412-homebrew_install_from_api_default"
This reverts commit f4e60482791d2ff628efadfdbf0d14d9237d2d29, reversing
changes made to e26784f424061ca16987afcb21e036c66a298492.
2023-02-07 19:25:40 +01:00
Mike McQuaid
1d0779a397
Revert "Merge pull request #14384 from MikeMcQuaid/homebrew_install_from_api_dev"
This reverts commit b8a9fe4d3311bcef26362cddee8dca043f4087e4, reversing
changes made to daf5b276e24d9d41ed8d03fa900d83438121f0c6.
2023-02-07 16:31:47 +01:00
Mike McQuaid
0575903868
Revert "HOMEBREW_INSTALL_FROM_API: make the default for everyone." 2023-02-07 15:13:23 +01:00
Carlo Cabrera
76466f66d2
brew.sh: add bump to HOMEBREW_NO_INSTALL_FROM_API commands
`brew bump` relies on `livecheck`, which we don't want to query the API
for.

Also, some small refactoring:

1. Declare the list of commands we want to set
   `HOMEBREW_NO_INSTALL_FROM_API` for as an array.
2. Only check against this list when the command being run is a
   developer command, to avoid checking the list when we know we're not
   running a dev command.
2023-02-07 14:37:14 +08:00
Rylan Polster
39097583b9
Set HOMEBREW_NO_INSTALL_FROM_API for certain commands 2023-02-06 16:17:04 +01:00
Mike McQuaid
5f6c69bca2
HOMEBREW_INSTALL_FROM_API: make the default for everyone.
- remove all places we check the flag so it's a no-op now
- flip the messaging to refer to `HOMEBREW_NO_INSTALL_FROM_API` where
  relevant
- adjust the documentation
2023-02-05 18:13:08 +01:00
Xuehai Pan
ba3bccf9ed api: download from HOMEBREW_API_DOMAIN 2023-02-04 13:05:20 +00:00
Mike McQuaid
bdbcf094fa
brew.sh: fix HOMEBREW_INSTALL_FROM_API logic.
Ensure that we handle this a bit more correctly so it's unset more often.
2023-02-03 09:59:06 +00:00
Mike McQuaid
46fc4f9f1b
Don't allow HOMEBREW_INSTALL_FROM_API when building from source
When either being in a non-default prefix or being on an unsupported
macOS version we expect most things to be built from source. In that
environment, do not allow HOMEBREW_INSTALL_FROM_API to be set.

Fixes #14475
2023-02-02 14:49:34 +00:00
Dawid Dziurla
e1700178bd
brew.sh: add missing dev-cmd aliases 2023-02-01 13:51:18 +01:00
Mike McQuaid
8e1bcd93f3
brew.sh: test HOMEBREW_INSTALL_FROM_API on developers.
Test `HOMEBREW_INSTALL_FROM_API` on `HOMEBREW_DEV_CMD_RUN` and
`HOMEBREW_DEVELOPER` folks who haven't run a
`HOMEBREW_DEVELOPER_COMMAND`.

The next step after this will be to make this functionality the default
for everyone.
2023-01-20 19:50:42 +00:00
Mike McQuaid
653b349c8b
Change HOMEBREW_INSTALL_FROM_API update frequency
This doesn't need to be nearly as often for HOMEBREW_INSTALL_FROM_API users because we're getting the latest information from the API when needed rather than just at `brew update` time.
2023-01-18 15:11:42 +00:00
Mike McQuaid
a85e1a3e5a
brew.sh: tweak comment. 2023-01-05 09:59:30 +00:00
Asutosh Palai
96449a94e0 restoring the original path after update
This fix is required for ARM Linux where portable Homebrew Portable Ruby is not
available. Without this fix, after auto update, brew is restarted with cleaned up path.
This causes it to pick not find user installed Ruby by RVM or rbenv, causing brew to fail.
2023-01-04 22:23:01 +00:00
Mike McQuaid
40f85af824
brew.sh: fix shellcheck. 2022-12-13 11:37:05 +00:00
Carlo Cabrera
239743f39b
Fix shellcheck error 2022-11-24 22:15:03 +08:00
Carlo Cabrera
cf01a7f985
brew.sh: remove HOMEBREW_CHANGE_ARCH_TO_ARM
We used to need this because the GitHub runner process was running under
Rosetta. GitHub Actions has supported native M1 runners for a few months
now, so I think it's time to remove this.
2022-11-24 22:07:30 +08:00
Bo Anderson
7d7083d0f3
Universally apply Ruby disable options 2022-11-05 01:58:12 +00:00
Bo Anderson
8cb056c657
Remove sitedir from LOAD_PATH 2022-10-24 19:42:49 +01:00
Michka Popoff
354852f848
brew: remove HOMEBREW_ON_DEBIAN7
This is not used anymore, we are building on ubuntu 16.04 for our portable packages: https://github.com/Homebrew/homebrew-portable-ruby
2022-09-28 23:12:58 +02:00
Bo Anderson
a0985191ea
Add messaging for Docker image deprecation 2022-09-07 13:26:08 +01:00
Mike McQuaid
e58d7d3456
brew: improve Docker detection.
Needed for Ubuntu 22.04.
2022-09-06 16:32:35 +01:00
Mike McQuaid
8cb5350d65
Revert "Merge pull request #13447 from notfromstatefarm/feature/support-custom-ssh"
This reverts commit ef00b40a5172d5628a0c861f655a2277fd16a1e0, reversing
changes made to e1fca95836fcb1ad989cd995228192846fc99612.
2022-06-28 09:42:50 +01:00
notfromstatefarm
8d76522be2
remove HOMEBREW_SSH_PATH 2022-06-22 19:22:48 -04:00
notfromstatefarm
540313f18b
support custom git SSH binaries 2022-06-22 19:22:41 -04:00
Bo Anderson
1e52f08f49
brew.sh: fix HOMEBREW_CORE_DEFAULT_GIT_REMOTE not being exported 2022-06-17 19:47:55 +01:00
Rylan Polster
b896f6cb0d
Allow more developer commands with HOMEBREW_INSTALL_FROM_API 2022-06-16 21:31:15 -04:00