diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index dd64ddb615b239..66516692ea15cd 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -27,6 +27,10 @@ def install_args Install a or . Additional options specific to a may be appended to the command. + If `HOMEBREW_BUILD_FROM_SOURCE` is set, then both and any dependencies installed while + installing it are built from source even if bottles are available for them, regardless of whether + `--build-from-source` was passed or not. + Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the installed formulae or, every 30 days, for all formulae. EOS diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 08e197b5e3ab38..0a019cd8d450b0 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -26,6 +26,10 @@ def reinstall_args Uninstall and then reinstall a or using the same options it was originally installed with, plus any appended options specific to a . + If `HOMEBREW_BUILD_FROM_SOURCE` is set, then both and any dependencies reinstalled while + reinstalling it are built from source even if bottles are available for them, regardless of whether + `--build-from-source` was passed or not. + Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the reinstalled formulae or, every 30 days, for all formulae. EOS diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index aad5f5aa4a33e5..e89654468d1e06 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -23,6 +23,10 @@ def upgrade_args installed with, plus any appended brew formula options. If or are specified, upgrade only the given or kegs (unless they are pinned; see `pin`, `unpin`). + If `HOMEBREW_BUILD_FROM_SOURCE` is set, then both and any dependencies upgraded while + upgrading it are built from source even if bottles are available for them, regardless of whether + `--build-from-source` was passed or not. + Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the upgraded formulae or, every 30 days, for all formulae. EOS diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index e7b1bb941a1249..2902b175003a6e 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -58,7 +58,13 @@ module EnvConfig description: "Use this as the browser when opening project homepages.", default_text: "`$BROWSER` or the OS's default browser.", }, - HOMEBREW_CACHE: { + HOMEBREW_BUILD_FROM_SOURCE: { + description: "If set, then all supplied formulae, along with their (recursive) dependencies, are built " \ + "from source even if bottles are available for them, regardless of whether " \ + "`--build-from-source` was passed or not.", + boolean: true, + }, + HOMEBREW_CACHE: { description: "Use this directory as the download cache.", default_text: "macOS: `$HOME/Library/Caches/Homebrew`, " \ "Linux: `$XDG_CACHE_HOME/Homebrew` or `$HOME/.cache/Homebrew`.", diff --git a/docs/FAQ.md b/docs/FAQ.md index 15b08e60b091bf..2a0ec47a73fb58 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -72,6 +72,7 @@ following conditions: will use a bottled version of the formula, but `brew install --enable-bar ` will trigger a source build. * The `--build-from-source` option is invoked. +* The environement variable `HOMEBREW_BUILD_FROM_SOURCE` is set. * The machine is not running a supported version of macOS as all bottled builds are generated only for supported macOS versions. * Homebrew is installed to a prefix other than the default diff --git a/docs/Manpage.md b/docs/Manpage.md index 67067fb1844ba5..6a9f0af64681bd 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -297,6 +297,10 @@ If a *`formula`* or *`cask`* is provided, show summary of information about it. Install a *`formula`* or *`cask`*. Additional options specific to a *`formula`* may be appended to the command. +If `HOMEBREW_BUILD_FROM_SOURCE` is set, then both *`formula`* and any dependencies installed while +installing it are built from source even if bottles are available for them, regardless of whether +`--build-from-source` was passed or not. + Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the installed formulae or, every 30 days, for all formulae. @@ -503,6 +507,10 @@ all items or checking if any current formulae/casks have Ruby issues. Uninstall and then reinstall a *`formula`* or *`cask`* using the same options it was originally installed with, plus any appended options specific to a *`formula`*. +If `HOMEBREW_BUILD_FROM_SOURCE` is set, then both *`formula`* and any dependencies reinstalled while +reinstalling it are built from source even if bottles are available for them, regardless of whether +`--build-from-source` was passed or not. + Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the reinstalled formulae or, every 30 days, for all formulae. @@ -677,6 +685,10 @@ Upgrade outdated casks and outdated, unpinned formulae using the same options th installed with, plus any appended brew formula options. If *`cask`* or *`formula`* are specified, upgrade only the given *`cask`* or *`formula`* kegs (unless they are pinned; see `pin`, `unpin`). +If `HOMEBREW_BUILD_FROM_SOURCE` is set, then both *`formula`* and any dependencies upgraded while +upgrading it are built from source even if bottles are available for them, regardless of whether +`--build-from-source` was passed or not. + Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the upgraded formulae or, every 30 days, for all formulae. @@ -1910,6 +1922,9 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just *Default:* `$BROWSER` or the OS's default browser. + * `HOMEBREW_BUILD_FROM_SOURCE`: + If set, then all supplied formulae, along with their (recursive) dependencies, are built from source even if bottles are available for them, regardless of whether `--build-from-source` was passed or not. + - `HOMEBREW_CACHE`
Use this directory as the download cache. diff --git a/manpages/brew.1 b/manpages/brew.1 index e6cc9e5c9a8beb..c661c627425e1d 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -381,6 +381,9 @@ Treat all named arguments as casks\. Install a \fIformula\fR or \fIcask\fR\. Additional options specific to a \fIformula\fR may be appended to the command\. . .P +If \fBHOMEBREW_BUILD_FROM_SOURCE\fR is set, then both \fIformula\fR and any dependencies installed while installing it are built from source even if bottles are available for them, regardless of whether \fB\-\-build\-from\-source\fR was passed or not\. +. +.P Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the installed formulae or, every 30 days, for all formulae\. . .TP @@ -683,6 +686,9 @@ Syntax\-check all of Homebrew\'s Ruby files (if no \fB\fR is passed)\. Uninstall and then reinstall a \fIformula\fR or \fIcask\fR using the same options it was originally installed with, plus any appended options specific to a \fIformula\fR\. . .P +If \fBHOMEBREW_BUILD_FROM_SOURCE\fR is set, then both \fIformula\fR and any dependencies reinstalled while reinstalling it are built from source even if bottles are available for them, regardless of whether \fB\-\-build\-from\-source\fR was passed or not\. +. +.P Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the reinstalled formulae or, every 30 days, for all formulae\. . .TP @@ -921,6 +927,9 @@ Fetch and reset Homebrew and all tap repositories (or any specified \fIrepositor Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options\. If \fIcask\fR or \fIformula\fR are specified, upgrade only the given \fIcask\fR or \fIformula\fR kegs (unless they are pinned; see \fBpin\fR, \fBunpin\fR)\. . .P +If \fBHOMEBREW_BUILD_FROM_SOURCE\fR is set, then both \fIformula\fR and any dependencies upgraded while upgrading it are built from source even if bottles are available for them, regardless of whether \fB\-\-build\-from\-source\fR was passed or not\. +. +.P Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the upgraded formulae or, every 30 days, for all formulae\. . .TP @@ -2704,6 +2713,10 @@ Use this as the browser when opening project homepages\. \fIDefault:\fR \fB$BROWSER\fR or the OS\'s default browser\. . .TP +\fBHOMEBREW_BUILD_FROM_SOURCE\fR +If set, then all supplied formulae, along with their (recursive) dependencies, are built from source even if bottles are available for them, regardless of whether \fB\-\-build\-from\-source\fR was passed or not\. +. +.TP \fBHOMEBREW_CACHE\fR . .br