diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 371432d8ce86a..22eab6bd85f46 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_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for outdated dependents and dependents with broken linkage, respectively. diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 9bceda66b236c..467aa61b875b1 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_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for outdated dependents and dependents with broken linkage, respectively. diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index b7fa29b42798e..1ae55338f553a 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_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for outdated dependents and dependents with broken linkage, respectively. diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index 4f8a95a46cacb..a7974de9fd3a1 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -63,6 +63,12 @@ module EnvConfig description: "Use this as the browser when opening project homepages.", default_text: "`$BROWSER` or the OS's default browser.", }, + 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`, " \ diff --git a/docs/FAQ.md b/docs/FAQ.md index efbf38d589037..54365382e25a2 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -76,6 +76,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 88f1c5d22b1c0..e49cef18e8d90 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -303,6 +303,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_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for outdated dependents and dependents with broken linkage, respectively. @@ -515,6 +519,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_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for outdated dependents and dependents with broken linkage, respectively. @@ -694,6 +702,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_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for outdated dependents and dependents with broken linkage, respectively. @@ -1942,6 +1954,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 3d675fde6cc87..52a417c67da19 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -392,6 +392,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_INSTALLED_DEPENDENTS_CHECK\fR is set, \fBbrew upgrade\fR or \fBbrew reinstall\fR will be run for outdated dependents and dependents with broken linkage, respectively\. . .P @@ -700,6 +703,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_INSTALLED_DEPENDENTS_CHECK\fR is set, \fBbrew upgrade\fR or \fBbrew reinstall\fR will be run for outdated dependents and dependents with broken linkage, respectively\. . .P @@ -945,6 +951,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_INSTALLED_DEPENDENTS_CHECK\fR is set, \fBbrew upgrade\fR or \fBbrew reinstall\fR will be run for outdated dependents and dependents with broken linkage, respectively\. . .P @@ -2753,6 +2762,12 @@ 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 +. +.br +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