160 Commits

Author SHA1 Message Date
Douglas Eichelberger
2969cdb5c1 Enable types in brew.rb 2023-03-18 13:55:19 -07:00
Mike McQuaid
2884b1649b
api: don't download files as root when Homebrew's not owned by root.
This was mentioned in a random comment. While we're here, make some
helper functions to query this a bit more nicely elsewhere when we do
it.
2023-02-23 10:04:50 +00:00
Mike McQuaid
fbdec8738d
Warn more when building from source
We warn sometimes when we tell people to build from source and it's
not supported but we don't actually warn non-developers when invoking
the various install commands so: let's start doing so.

While we're here, also update the existing messaging to reflect the fact
we're on Mastodon now too and we don't want maintainers being
individually bothered about errors either.

I've tried to balance having messages here vs. having them be so long
at the beginning of installation that they will be missed or be overly
obnoxious.
2023-02-17 16:10:38 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Rylan Polster
39097583b9
Set HOMEBREW_NO_INSTALL_FROM_API for certain commands 2023-02-06 16:17:04 +01: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
Mike McQuaid
97def3c104
install: better error when using API and --HEAD.
- Tell people what to do to resolve this
- Tweak the instruction ordering to be consistent elsewhere
2023-01-26 11:08:56 +00:00
Mike McQuaid
46d727b475
HOMEBREW_INSTALL_FROM_API: various improvements.
- flip the messaging to refer to `HOMEBREW_NO_INSTALL_FROM_API` where relevant
- remove some duplicate checks
- better scope checks to just core tap formulae
2023-01-25 14:29:35 +00:00
apainintheneck
5708ed3171 Fix brew prof --stackprof
The `stackprof` gem wasn't being included
correctly because it was missing the path
directory. This vendored gems path is added
later on in `load_path.rb`.

We export the GEM_PATH and GEM_HOME environment
variables in setup_gem_environment! so we
can use that information if we require the
`rubygems` gem first.
2022-12-29 17:44:48 -08:00
Adrian Ho
a76451602d root auto-taps should be done as Homebrew user
Closes https://github.com/Homebrew/brew/issues/14263.
2022-12-19 18:06:09 +08:00
apainintheneck
c8f256b21d Cleanup brew prof
- Add exception in brew.rb require check for ruby-prof
2022-12-04 20:07:31 -08:00
Mike McQuaid
53b1c0f48e
Strengthen "don't create issues" language
We're still getting a non-trivial number of issues from configurations
we don't support and don't plan to.

Let people know that we know their experience will not be good and what
to expect if they file issues.

Co-authored-by: Eric Knibbe <enk3@outlook.com>
2022-10-20 11:39:20 +01:00
Bo Anderson
987abe7773
Prevent require executing some scripts 2022-09-08 01:44:31 +01:00
Rylan Polster
7ee35c6a0c
Allow developers to use dev commands and HOMEBREW_INSTALL_FROM_API 2022-09-06 12:59:13 -04:00
Mike McQuaid
e58d7d3456
brew: improve Docker detection.
Needed for Ubuntu 22.04.
2022-09-06 16:32:35 +01:00
Colin Dean
e7052fad0d Use heredoc for multiline error and store untapped official taps check
Review feedback on https://github.com/Homebrew/brew/pull/13581#pullrequestreview-1046232447
2022-07-21 13:24:23 -04:00
Colin Dean
5e56b9effe
Drops "cannot be retapped" from manual untap warning
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-07-21 11:51:21 -04:00
Colin Dean
ac53a6ae36 Instruct user to tap untapped official tap when running its commands
This came up in https://github.com/Homebrew/homebrew-bundle/issues/1108
wherein a user had unwittingly untapped some official taps that get
automatically tapped on first use and couldn't figure out why they
couldn't use the associated command.
2022-07-19 18:06:42 -04:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Bo Anderson
fae972c9d7
brew.rb: remove 'nice' error message for missing envs 2022-06-17 19:47:56 +01:00
Bo Anderson
db8ab91429
Remove missing env retry mechanism 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
Rylan Polster
0c520844b4
Improve message 2022-02-11 10:49:21 -05:00
Phoenix Eliot
7a5eb3dbdb Fix rubocop warning 2022-02-08 12:14:00 -05:00
Phoenix Eliot
9e2c5910c5 Simplify 'brew cask' check 2022-02-08 12:08:32 -05:00
Phoenix Eliot
f18cbd2066 Add helpful error message when attempting to run brew cask 2022-01-11 14:17:03 -05:00
Mike McQuaid
11c5f8f05a
Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:

- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents

For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves.
2021-11-25 09:10:59 +00:00
Rylan Polster
249886f36f
Cleanup developer mode handling in brew.{sh,rb} 2021-10-26 01:29:15 -04:00
Rylan Polster
06b1e1f495
Improve messaging
Co-authored-by: Eric Knibbe <3324775+EricFromCanada@users.noreply.github.com>
2021-10-22 17:15:19 -04:00
Rylan Polster
0b8032d421
Document HOMEBREW_INSTALL_FROM_API 2021-10-22 12:37:57 -04:00
Bo Anderson
30b24cf4ad
Use HOMEBREW_CURL universally, including formulae 2021-10-04 02:03:04 +01:00
Bo Anderson
d4b88b1b55
brew.rb: remove gem setup for stackprof 2021-08-11 02:13:37 +01:00
Rylan Polster
27ba803bb5
Remove need for HOMEBREW_NO_DEV_CMD_MESSAGE 2021-07-20 11:47:31 -04:00
Rylan Polster
564a207bad
Add HOMEBREW_NO_DEV_CMD_MESSAGE 2021-07-19 10:06:38 -04:00
Rylan Polster
9f15432742
Fix tests 2021-07-17 14:08:38 -04:00
Rylan Polster
5649d339d7
Show message when developer mode is turned on 2021-07-14 11:01:46 -04:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00:00
Rylan Polster
ebba369887
Tap: add untapped_official_taps method 2021-01-20 12:02:24 -05:00
Rylan Polster
3ca68c076e
Don't tap user-untapped official taps 2021-01-19 17:55:03 -05:00
Rylan Polster
4b8477ba70 Completions, Settings: move to Homebrew namespace 2021-01-13 11:20:28 -05:00
Rylan Polster
f1f3fdc315 settings: add module for managing git config settings 2021-01-12 16:27:25 -05:00
Markus Reiter
9ecdf117b3 Fix broken output on CI. 2020-12-11 22:15:18 +01:00
Mike McQuaid
9216d8abe6
rubocop-rails: make fixes. 2020-12-02 10:43:04 +00:00
Dustin Rodrigues
1c925d52fe docs - remove Discourse from communication methods 2020-11-15 13:20:03 -05:00
Mike McQuaid
5afff3f3aa
Handle macOS Homebrew on ARM
- Output `brew doctor` and `brew install` messages noting this configuration is (currently) unsupported and encourage use of Rosetta instead
- Output Rosetta 2 usage in `brew config` on ARM (whether in Rosetta 2 or not)
- Check the architecture of (newly installed) dependencies and ensure they are using the correct architecture.
- Don't allow installing macOS Intel Homebrew in macOS ARM Homebrew default prefix (and vice versa
- Actually write out the architecture of dependencies to the tab rather than generating and throwing them away
- Set and document the expected default prefix for macOS Intel Homebrew, macOS ARM Homebrew (`/opt/homebrew`) and Homebrew on Linux

While we're here:
- Don't say Big Sur is a prerelease version but still make it clear we
  don't support it (yet).
- Don't reference non-existent IRC channel
2020-11-12 17:06:47 +00:00
Markus Reiter
5bc626bbe1 Completely deprecate Homebrew.args. 2020-11-11 08:52:55 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
540fa4e84b Pass quiet when tapping external commands. 2020-09-09 21:49:22 +02:00
Rylan Polster
5b393cb049 help: show help text for tapped external command
Previously, running e.g. `brew help bundle` when homebrew-bundle was not
tapped would tap homebrew-bundle and then run `brew bundle` showing
`Error: No Brewfile found` instead of the expected help text.
2020-09-08 15:44:13 -04:00
Maxim Belkin
a6d29894d9 cleanup: fix and reuse portable ruby logic.
Align the logic in `cleanup_portable_ruby` with that in `ruby.sh`.

Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-09-03 09:43:41 +01:00