diff options
| -rw-r--r-- | Library/Homebrew/brew.sh | 24 | ||||
| -rw-r--r-- | Library/Homebrew/caveats.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 3 | ||||
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/mac/diagnostic.rb | 13 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/hooks/bottles.rb | 35 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/xcode.rb | 23 | ||||
| -rw-r--r-- | Library/Homebrew/test/bottle_hooks_spec.rb | 51 | ||||
| -rw-r--r-- | Library/Homebrew/test/os/mac/diagnostic_spec.rb | 8 | ||||
| -rwxr-xr-x | bin/brew | 28 | ||||
| -rw-r--r-- | docs/Xcode.md | 89 |
12 files changed, 39 insertions, 254 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index c8f66bd45..795ddcc4d 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -79,18 +79,6 @@ then export HOMEBREW_GEM_PATH="$GEM_PATH" fi -# Users may have these set, pointing the system Ruby -# at non-system gem paths -unset GEM_HOME -unset GEM_PATH - -# Users may have this set, injecting arbitrary environment changes into -# bash processes inside builds -unset BASH_ENV - -# Users may have this set, breaking grep's output. -unset GREP_OPTIONS - HOMEBREW_SYSTEM="$(uname -s)" case "$HOMEBREW_SYSTEM" in Darwin) HOMEBREW_MACOS="1" ;; @@ -246,6 +234,18 @@ case "$HOMEBREW_COMMAND" in --config) HOMEBREW_COMMAND="config" ;; esac +# Set HOMEBREW_DEV_CMD_RUN for users who have run a development command. +# This makes them behave like HOMEBREW_DEVELOPERs for brew update. +if [[ -z "$HOMEBREW_DEVELOPER" ]] +then + export HOMEBREW_GIT_CONFIG_FILE="$HOMEBREW_REPOSITORY/.git/config" + HOMEBREW_GIT_CONFIG_DEVELOPERMODE="$(git config --file="$HOMEBREW_GIT_CONFIG_FILE" --get homebrew.devcmdrun 2>/dev/null)" + if [[ "$HOMEBREW_GIT_CONFIG_DEVELOPERMODE" = "true" ]] + then + export HOMEBREW_DEV_CMD_RUN="1" + fi +fi + if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]] then HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index 49a517bd4..98321f1a1 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -64,7 +64,7 @@ class Caveats s << "\nFor compilers to find this software you may need to set:\n" s << " LDFLAGS: -L#{f.opt_lib}\n" if f.lib.directory? s << " CPPFLAGS: -I#{f.opt_include}\n" if f.include.directory? - if which("pkg-config") && + if which("pkg-config", ENV["HOMEBREW_PATH"]) && ((f.lib/"pkgconfig").directory? || (f.share/"pkgconfig").directory?) s << "For pkg-config to find this software you may need to set:\n" s << " PKG_CONFIG_PATH: #{f.opt_lib}/pkgconfig\n" if (f.lib/"pkgconfig").directory? diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 609e4094a..747784527 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -410,9 +410,6 @@ EOS QUIET_ARGS=() fi - # ensure GIT_CONFIG is unset as we need to operate on .git/config - unset GIT_CONFIG - # only allow one instance of brew update lock update diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 61f9b53a3..41deaf23e 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -1017,16 +1017,6 @@ module Homebrew EOS end - def check_for_old_env_vars - return unless ENV["HOMEBREW_KEEP_INFO"] - - <<~EOS - `HOMEBREW_KEEP_INFO` is no longer used - info files are no longer deleted by default; you may - remove this environment variable. - EOS - end - def check_for_pth_support homebrew_site_packages = Language::Python.homebrew_site_packages return unless homebrew_site_packages.directory? diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index f86155f2e..bb89b2367 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -262,19 +262,6 @@ module Homebrew EOS end - def check_for_unsupported_curl_vars - # Support for SSL_CERT_DIR seemed to be removed in the 10.10.5 update. - return unless MacOS.version >= :yosemite - return if ENV["SSL_CERT_DIR"].nil? - - <<~EOS - SSL_CERT_DIR support was removed from Apple's curl. - If fetching formulae fails you should: - unset SSL_CERT_DIR - and remove it from #{Utils::Shell.profile} if present. - EOS - end - def check_xcode_license_approved # If the user installs Xcode-only, they have to approve the # license or no "xc*" tool will work. diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 12a8a80bc..0836e7a9f 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -9,7 +9,6 @@ require "cleaner" require "formula_cellar_checks" require "install_renamed" require "cmd/postinstall" -require "hooks/bottles" require "debrew" require "sandbox" require "emoji" @@ -81,8 +80,6 @@ class FormulaInstaller end def pour_bottle?(install_bottle_options = { warn: false }) - return true if Homebrew::Hooks::Bottles.formula_has_bottle?(formula) - return false if @pour_failed return false if !formula.bottled? && !formula.local_bottle_path @@ -858,10 +855,6 @@ class FormulaInstaller end def pour - if Homebrew::Hooks::Bottles.formula_has_bottle?(formula) - return if Homebrew::Hooks::Bottles.pour_formula_bottle(formula) - end - if (bottle_path = formula.local_bottle_path) downloader = LocalBottleDownloadStrategy.new(bottle_path) else diff --git a/Library/Homebrew/hooks/bottles.rb b/Library/Homebrew/hooks/bottles.rb deleted file mode 100644 index c6612dea6..000000000 --- a/Library/Homebrew/hooks/bottles.rb +++ /dev/null @@ -1,35 +0,0 @@ -# Boxen (and perhaps others) want to override our bottling infrastructure so -# they can avoid declaring checksums in formulae files. -# Instead of periodically breaking their monkeypatches let's add some hooks that -# we can query to allow their own behaviour. - -# PLEASE DO NOT EVER RENAME THIS CLASS OR ADD/REMOVE METHOD ARGUMENTS! -module Homebrew - module Hooks - module Bottles - def self.setup_formula_has_bottle(&block) - @has_bottle = block - true - end - - def self.setup_pour_formula_bottle(&block) - @pour_bottle = block - true - end - - def self.formula_has_bottle?(formula) - return false unless @has_bottle - @has_bottle.call formula - end - - def self.pour_formula_bottle(formula) - return false unless @pour_bottle - @pour_bottle.call formula - end - - def self.reset_hooks - @has_bottle = @pour_bottle = nil - end - end - end -end diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 0b1cc7146..f977a066d 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -17,13 +17,13 @@ module OS when "10.9" then "6.2" when "10.10" then "7.2.1" when "10.11" then "8.2.1" - when "10.12" then "9.1" - when "10.13" then "9.1" + when "10.12" then "9.2" + when "10.13" then "9.2" else raise "macOS '#{MacOS.version}' is invalid" unless OS::Mac.prerelease? # Default to newest known version of Xcode for unreleased macOS versions. - "9.1" + "9.2" end end @@ -141,7 +141,11 @@ module OS end end - # The remaining logic provides a fake Xcode version based on the + detect_version_from_clang_version + end + + def detect_version_from_clang_version + # This logic provides a fake Xcode version based on the # installed CLT version. This is useful as they are packaged # simultaneously so workarounds need to apply to both based on their # comparable version. @@ -166,7 +170,7 @@ module OS when 80 then "8.0" when 81 then "8.3" when 90 then "9.0" - else "9.0" + else "9.0" end end @@ -217,14 +221,13 @@ module OS # on the older supported platform for that Xcode release, i.e there's no # CLT package for 10.11 that contains the Clang version from Xcode 8. case MacOS.version - when "10.13" then "900.0.38" - when "10.12" then "900.0.38" + when "10.13" then "900.0.39.2" + when "10.12" then "900.0.39.2" when "10.11" then "800.0.42.1" when "10.10" then "700.1.81" when "10.9" then "600.0.57" when "10.8" then "503.0.40" - else - "425.0.28" + else "425.0.28" end end @@ -232,7 +235,7 @@ module OS case MacOS.version when "10.13" then "9.0.0" when "10.12" then "8.0.0" - else "1.0.0" + else "1.0.0" end end diff --git a/Library/Homebrew/test/bottle_hooks_spec.rb b/Library/Homebrew/test/bottle_hooks_spec.rb deleted file mode 100644 index eb6617380..000000000 --- a/Library/Homebrew/test/bottle_hooks_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require "formula_installer" -require "hooks/bottles" - -describe Homebrew::Hooks::Bottles do - alias_matcher :pour_bottle, :be_pour_bottle - - subject { FormulaInstaller.new formula } - - let(:formula) do - double( - bottled?: false, - local_bottle_path: nil, - bottle_disabled?: false, - some_random_method: true, - keg_only?: false, - ) - end - - after(:each) do - described_class.reset_hooks - end - - describe "#setup_formula_has_bottle" do - context "given a block which evaluates to true" do - before(:each) do - described_class.setup_formula_has_bottle(&:some_random_method) - end - - it { is_expected.to pour_bottle } - end - - context "given a block which evaluates to false" do - before(:each) do - described_class.setup_formula_has_bottle { |f| !f.some_random_method } - end - - it { is_expected.not_to pour_bottle } - end - end - - describe "#setup_pour_formula_bottle" do - before(:each) do - described_class.setup_formula_has_bottle { true } - described_class.setup_pour_formula_bottle(&:some_random_method) - end - - it "does not raise an error" do - expect { subject.pour }.not_to raise_error - end - end -end diff --git a/Library/Homebrew/test/os/mac/diagnostic_spec.rb b/Library/Homebrew/test/os/mac/diagnostic_spec.rb index 83d95c2ef..f04652a93 100644 --- a/Library/Homebrew/test/os/mac/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/mac/diagnostic_spec.rb @@ -15,14 +15,6 @@ describe Homebrew::Diagnostic::Checks do .to match("We do not provide support for this pre-release version.") end - specify "#check_for_unsupported_curl_vars" do - allow(MacOS).to receive(:version).and_return(OS::Mac::Version.new("10.10")) - ENV["SSL_CERT_DIR"] = "/some/path" - - expect(subject.check_for_unsupported_curl_vars) - .to match("SSL_CERT_DIR support was removed from Apple's curl.") - end - specify "#check_for_beta_xquartz" do allow(MacOS::XQuartz).to receive(:version).and_return("2.7.10_beta2") @@ -59,35 +59,13 @@ do export "$VAR_NEW"="${!VAR}" done -# Set HOMEBREW_DEVELOPER for users who have run a development command -if [[ -z "$HOMEBREW_DEVELOPER" ]] -then - export HOMEBREW_GIT_CONFIG_FILE="$HOMEBREW_REPOSITORY/.git/config" - HOMEBREW_GIT_CONFIG_DEVELOPERMODE="$(git config --file="$HOMEBREW_GIT_CONFIG_FILE" --get homebrew.devcmdrun 2>/dev/null)" - if [[ "$HOMEBREW_GIT_CONFIG_DEVELOPERMODE" = "true" ]] - then - export HOMEBREW_DEV_CMD_RUN="1" - fi -fi - -if [[ -z "$HOMEBREW_NO_ENV_FILTERING" ]] -then - if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]] - then - # Use env filtering by default for users who have run a development command - # This will be enabled by default for all users in future. - export HOMEBREW_ENV_FILTERING="1" - fi -else - unset HOMEBREW_ENV_FILTERING -fi - -# test-bot sets environment filtering itself -if [[ -n "$HOMEBREW_ENV_FILTERING" && "$1" != "test-bot" ]] +# test-bot does environment filtering itself +if [[ -z "$HOMEBREW_NO_ENV_FILTERING" && "$1" != "test-bot" ]] then PATH="/usr/bin:/bin:/usr/sbin:/sbin" FILTERED_ENV=() + # Filter all but the specific variables. for VAR in HOME SHELL PATH TERM LOGNAME USER CI TRAVIS SSH_AUTH_SOCK SUDO_ASKPASS \ http_proxy https_proxy ftp_proxy HTTPS_PROXY FTP_PROXY \ "${!HOMEBREW_@}" "${!TRAVIS_@}" "${!JENKINS_@}" diff --git a/docs/Xcode.md b/docs/Xcode.md index 6c8626095..7fcc48877 100644 --- a/docs/Xcode.md +++ b/docs/Xcode.md @@ -2,88 +2,19 @@ ## Supported Xcode versions Homebrew supports and recommends the latest Xcode and/or Command Line -Tools available for your platform: +Tools available for your platform (see `OS::Mac::Xcode.latest_version` and `OS::Mac::CLT.latest_version` in [`Library/Homebrew/os/mac/xcode.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/os/mac/xcode.rb)). -| macOS | Xcode | Command Line Tools | -|-------|-------|--------------------| -| 10.6 | 3.2.6 | N/A | -| 10.7 | 4.6.3 | April 2013 | -| 10.8 | 5.1.1 | April 2014 | -| 10.9 | 6.2 | 6.2 | -| 10.10 | 7.2.1 | 7.2 | -| 10.11 | 8.2.1 | 8.2 | -| 10.12 | 9.1 | 9.0.1 | -| 10.13 | 9.1 | 9.0.1 | +## Xcode compiler versions -## Compiler version database +See `OS::Mac::STANDARD_COMPILERS` in [`Library/Homebrew/os/mac.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/os/mac.rb). -| Xcode | GCC 4.0 | GCC 4.2 | LLVM-GCC 4.2 | LLVM | Clang | LLVM (SVN) | -|-------|---------|---------|--------------|------------|-----------------|------------| -| 2.5.0 | 5370 | — | — | — | — | — | -| 3.1.4 | 5493 | 5577 | 5555 | 2064.3 | — | — | -| 3.2.0 | 5493 | 5646 | 5646 | 2118 | — | — | -| 3.2.1 | 5493 | 5646 | 5646 | 2206 | — | — | -| 3.2.2 | 5493 | 5659 | 5646 | 2207.5 | 1.0.2 | — | -| 3.2.3 | 5494 | 5664 | 5658 | 2326.10 | 1.5 (60) | — | -| 3.2.4 | 5494 | 5664 | 5658 | 2326.10 | 1.5 (60) | — | -| 3.2.5 | 5494 | 5664 | 5658 | 2333.4 | 1.6 (70) | — | -| 3.2.6 | 5494 | 5666 | 5658 | 2335.6 | 1.7 (77) | 2.9 | -| 4.0.0 | 5494 | 5666 | 5658 | 2335.9 | 2.0 (137) | 2.9 | -| 4.0.2 | 5494 | 5666 | 5658 | 2335.9 | 2.0 (137) | 2.9 | -| 4.1.0 | — | 5666 | 5658 | 2335.15.00 | 2.1 (163.7.1) | 3.0 | -| 4.2.0 | — | — | 5658 | 2336.1.00 | 3.0 (211.10.1) | 3.0 | -| 4.3.0 | — | — | 5658 | 2336.9.00 | 3.1 (318.0.45) | 3.1 | -| 4.3.1 | — | — | 5658 | 2336.9.00 | 3.1 (318.0.54) | 3.1 | -| 4.3.2 | — | — | 5658 | 2336.9.00 | 3.1 (318.0.58) | 3.1 | -| 4.3.3 | — | — | 5658 | 2336.9.00 | 3.1 (318.0.61) | 3.1 | -| 4.4.0 | — | — | 5658 | 2336.11.00 | 4.0 (421.0.57) | 3.1 | -| 4.4.1 | — | — | 5658 | 2336.11.00 | 4.0 (421.0.60) | 3.1 | -| 4.5.0 | — | — | 5658 | 2336.11.00 | 4.1 (421.11.65) | 3.1 | -| 4.5.1 | — | — | 5658 | 2336.11.00 | 4.1 (421.11.66) | 3.1 | -| 4.5.2 | — | — | 5658 | 2336.11.00 | 4.1 (421.11.66) | 3.1 | -| 4.6.0 | — | — | 5658 | 2336.11.00 | 4.2 (425.0.24) | 3.2 | -| 4.6.1 | — | — | 5658 | 2336.11.00 | 4.2 (425.0.27) | 3.2 | -| 4.6.2 | — | — | 5658 | 2336.11.00 | 4.2 (425.0.28) | 3.2 | -| 4.6.3 | — | — | 5658 | 2336.11.00 | 4.2 (425.0.28) | 3.2 | -| 5.0.0 | — | — | — | — | 5.0 (500.2.76) | 3.3 | -| 5.0.1 | — | — | — | — | 5.0 (500.2.78) | 3.3 | -| 5.0.1 | — | — | — | — | 5.0 (500.2.79) | 3.3 | -| 5.1 | — | — | — | — | 5.1 (503.0.38) | 3.4 | -| 5.1.1 | — | — | — | — | 5.1 (503.0.40) | 3.4 | -| 6.0 | — | — | — | — | 6.0 (600.0.51) | 3.5 | -| 6.0.1 | — | — | — | — | 6.0 (600.0.51) | 3.5 | -| 6.1 | — | — | — | — | 6.0 (600.0.54) | 3.5 | -| 6.2 | — | — | — | — | 6.0 (600.0.57) | 3.5 | -| 6.3 | — | — | — | — | 6.1 (602.0.49) | 3.6 | -| 6.3.1 | — | — | — | — | 6.1 (602.0.49) | 3.6 | -| 6.3.2 | — | — | — | — | 6.1 (602.0.53) | 3.6 | -| 6.4 | — | — | — | — | 6.1 (602.0.53) | 3.6 | -| 7.0 | — | — | — | — | 7.0 (700.0.72) | — | -| 7.0.1 | — | — | — | — | 7.0 (700.0.72) | — | -| 7.1 | — | — | — | — | 7.0 (700.1.76) | — | -| 7.1.1 | — | — | — | — | 7.0 (700.1.76) | — | -| 7.2 | — | — | — | — | 7.0 (700.1.81) | — | -| 7.2.1 | — | — | — | — | 7.0 (700.1.81) | — | -| 7.3 | — | — | — | — | 7.3 (703.0.29) | — | -| 7.3.1 | — | — | — | — | 7.3 (703.0.31) | — | -| 8.0 | — | — | — | — | 8.0 (800.0.38) | — | -| 8.1 | — | — | — | — | 8.0 (800.0.42.1)| — | -| 8.2 | — | — | — | — | 8.0 (800.0.42.1)| — | -| 8.2.1 | — | — | — | — | 8.0 (800.0.42.1)| — | -| 8.3 | — | — | — | — | 8.1 (802.0.38) | — | -| 8.3.1 | — | — | — | — | 8.1 (802.0.41) | — | -| 8.3.2 | — | — | — | — | 8.1 (802.0.42) | — | -| 8.3.3 | — | — | — | — | 8.1 (802.0.42) | — | -| 9.0.0 | — | — | — | — | 9.0 (900.0.37) | — | -| 9.0.1 | — | — | — | — | 9.0 (900.0.38) | — | -| 9.1 | — | — | — | — | 9.0 (900.0.38) | — | - -## References to Xcode and compiler versions in code +## Updating for new Xcode releases When a new Xcode release is made, the following things need to be updated: -* `MacOS::Xcode.latest_version` -* `MacOS::CLT.latest_version` -* `MacOS::STANDARD_COMPILERS` -* `MacOS::Xcode.version fallback logic` -* ensure compiler version Regexps continue to work (`MacOS` module) +- In [`Library/Homebrew/os/mac/xcode.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/os/mac/xcode.rb) + * `OS::Mac::Xcode.latest_version` + * `OS::Mac::CLT.latest_version` + * `OS::Mac::Xcode.detect_version_from_clang_version` +- In [`Library/Homebrew/os/mac.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/os/mac.rb) + * `OS::Mac::STANDARD_COMPILERS` |
