diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index fcc78728d7c3e31df55b46df8e3ea7e48b408eea..fdd9092edc45076cf06040bcb64d30e344559422 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -12,8 +12,6 @@ end require_relative "global" -require "update_migrator" - begin trap("INT", std_trap) # restore default CTRL-C handler @@ -77,14 +75,15 @@ begin # `Homebrew.help` never returns, except for external/unknown commands. end - # Migrate LinkedKegs/PinnedKegs if update didn't already do so - UpdateMigrator.migrate_legacy_keg_symlinks_if_necessary - # Uninstall old brew-cask if it's still around; we just use the tap now. if cmd == "cask" && (HOMEBREW_CELLAR/"brew-cask").exist? system(HOMEBREW_BREW_FILE, "uninstall", "--force", "brew-cask") end + if ENV["HOMEBREW_BUILD_FROM_SOURCE"] + odeprecated("HOMEBREW_BUILD_FROM_SOURCE", "--build-from-source") + end + if internal_cmd Homebrew.send cmd.to_s.tr("-", "_").downcase elsif which "brew-#{cmd}" diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index bdc16416f53a20be4a29bc313ec760d6563f7685..788a610b23b92958322ddf386d66b3d8fdd65734 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -105,6 +105,18 @@ then HOMEBREW_FORCE_BREWED_CURL="1" fi + # Announce pre-Mavericks deprecation now + if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100900" ]] + then + printf "WARNING: Your version of macOS (%s) will not be able to run Homebrew when\n" "$HOMEBREW_MACOS_VERSION" >&2 + printf " version 2.0.0 is released (Q1 2019)!\n" >&2 + if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100700" ]] + then + printf " For 10.4 - 10.6 support see: https://github.com/mistydemeo/tigerbrew\n" >&2 + fi + printf "\n" >&2 + fi + # The system Git on macOS versions before Sierra is too old for some Homebrew functionality we rely on. HOMEBREW_MINIMUM_GIT_VERSION="2.14.3" if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101200" ]] diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 341c28475b931caae24551e1bd77c631eaf42027..2bb5779376fc8f738769e853da88af630fada4df 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -21,10 +21,9 @@ #: #: If `--cc=`<compiler> is passed, attempt to compile using <compiler>. #: <compiler> should be the name of the compiler's executable, for instance -#: `gcc-8` for gcc 8, `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a -#: Homebrew-provided GCC 4.9. In order to use LLVM's clang, use -#: `llvm_clang`. To specify the Apple-provided clang, use `clang`. This -#: parameter will only accept compilers that are provided by Homebrew or +#: `gcc-7` for GCC 7. In order to use LLVM's clang, use `llvm_clang`. +#: To specify the Apple-provided clang, use `clang`. +#: This parameter will only accept compilers that are provided by Homebrew or #: bundled with macOS. Please do not file issues if you encounter errors #: while using this flag. #: diff --git a/Library/Homebrew/cmd/prune.rb b/Library/Homebrew/cmd/prune.rb index daebb892f49aaa4468173afcc590f185953e3415..3c8ffdb3f0d243c262d422733f53ae2a58bde42f 100644 --- a/Library/Homebrew/cmd/prune.rb +++ b/Library/Homebrew/cmd/prune.rb @@ -25,8 +25,7 @@ module Homebrew def prune prune_args.parse - # TODO: deprecate and hide from manpage for next minor release. - # odeprecated("'brew prune'", "'brew cleanup'") + odeprecated("'brew prune'", "'brew cleanup'") Cleanup.new(dry_run: args.dry_run?).prune_prefix_symlinks_and_directories end end diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 71411637cda861cb51c04edc99635d7ebcfc75cb..7bacd47ca2840a03059764d313776a373192175b 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -7,7 +7,6 @@ require "migrator" require "formulary" require "descriptions" require "cleanup" -require "update_migrator" require "description_cache_store" module Homebrew @@ -83,13 +82,6 @@ module Homebrew updated = true end - out, _, status = system_command("git", - args: ["describe", "--tags", "--abbrev=0", initial_revision], - chdir: HOMEBREW_REPOSITORY, - print_stderr: false) - - initial_version = Version.new(out) if status.success? - updated_taps = [] Tap.each do |tap| next unless tap.git? @@ -112,11 +104,6 @@ module Homebrew updated = true end - UpdateMigrator.migrate_legacy_cache_if_necessary - UpdateMigrator.migrate_cache_entries_to_double_dashes(initial_version) - UpdateMigrator.migrate_cache_entries_to_symlinks(initial_version) - UpdateMigrator.migrate_legacy_keg_symlinks_if_necessary - if !updated if !ARGV.include?("--preinstall") && !ENV["HOMEBREW_UPDATE_FAILED"] puts "Already up-to-date." @@ -140,12 +127,6 @@ module Homebrew Tap.each(&:link_completions_and_manpages) Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"] - - # This should always be the last thing to run (but skip on auto-update). - if !ARGV.include?("--preinstall") || - ENV["HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION"] - UpdateMigrator.migrate_legacy_repository_if_necessary - end end def shorten_revision(revision) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 53204876f47c81e14efdcb4f9409fb316dc2407f..0b0c9a6a120ee2629db31ab1a96a8d235d9e0cde 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -66,39 +66,6 @@ git_init_if_necessary() { fi } -rename_taps_dir_if_necessary() { - local tap_dir - local tap_dir_basename - local tap_dir_hyphens - local user - local repo - - for tap_dir in "$HOMEBREW_LIBRARY"/Taps/* - do - [[ -d "$tap_dir/.git" ]] || continue - tap_dir_basename="${tap_dir##*/}" - if [[ "$tap_dir_basename" = *"-"* ]] - then - # only replace the *last* dash: yes, tap filenames suck - user="$(echo "${tap_dir_basename%-*}" | tr "[:upper:]" "[:lower:]")" - repo="$(echo "${tap_dir_basename:${#user}+1}" | tr "[:upper:]" "[:lower:]")" - mkdir -p "$HOMEBREW_LIBRARY/Taps/$user" - mv "$tap_dir" "$HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo" - - tap_dir_hyphens="${tap_dir_basename//[^\-]}" - if [[ ${#tap_dir_hyphens} -gt 1 ]] - then - echo "Homebrew changed the structure of Taps like <someuser>/<sometap>." >&2 - echo "So you may need to rename $HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo manually." >&2 - fi - else - echo "Homebrew changed the structure of Taps like <someuser>/<sometap>. " >&2 - echo "$tap_dir is an incorrect Tap path." >&2 - echo "So you may need to rename it to $HOMEBREW_LIBRARY/Taps/<someuser>/homebrew-<sometap> manually." >&2 - fi - done -} - repo_var() { local repo_var @@ -427,15 +394,12 @@ EOS lock update git_init_if_necessary - # rename Taps directories - # this procedure will be removed in the future if it seems unnecessary - rename_taps_dir_if_necessary safe_cd "$HOMEBREW_REPOSITORY" # if an older system had a newer curl installed, change each repo's remote URL from GIT to HTTPS if [[ -n "$HOMEBREW_SYSTEM_CURL_TOO_OLD" && - -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" && + -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" && "$(git config remote.origin.url)" =~ ^git:// ]] then git config remote.origin.url "$BREW_OFFICIAL_REMOTE" diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index e4766af75190d5f385f5795a0c5f4dce0cdc1e42..28635b3fab2bd3ae68e27287417474d6a1522969 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -31,10 +31,10 @@ module Homebrew # TODO: deprecate for next minor release. if ARGV.include?("--cleanup") ENV["HOMEBREW_INSTALL_CLEANUP"] = "1" - # odeprecated("'brew upgrade --cleanup'", "'HOMEBREW_INSTALL_CLEANUP'") + odeprecated("'brew upgrade --cleanup'", "'HOMEBREW_INSTALL_CLEANUP'") elsif ENV["HOMEBREW_UPGRADE_CLEANUP"] ENV["HOMEBREW_INSTALL_CLEANUP"] = "1" - # odeprecated("'HOMEBREW_UPGRADE_CLEANUP'", "'HOMEBREW_INSTALL_CLEANUP'") + odeprecated("'HOMEBREW_UPGRADE_CLEANUP'", "'HOMEBREW_INSTALL_CLEANUP'") end FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed? diff --git a/Library/Homebrew/compat.rb b/Library/Homebrew/compat.rb index 35e634dd89155698650fd07fd6b5e615196a1910..5079476f18bbc957c366fc7755399d9b9553c2b9 100644 --- a/Library/Homebrew/compat.rb +++ b/Library/Homebrew/compat.rb @@ -1,7 +1,8 @@ require "compat/extend/os/mac/utils/bottles" +require "compat/os/mac" require "compat/requirements/x11_requirement" require "compat/requirements/xcode_requirement" require "compat/cask" require "compat/download_strategy" -require "compat/fileutils" +require "compat/formula" require "compat/tap" diff --git a/Library/Homebrew/compat/cask.rb b/Library/Homebrew/compat/cask.rb index 03e78d7de499e8deda8d30ab83dde7ca34164249..59708eeb98514741fcf4ee51f5c481827c5a1250 100644 --- a/Library/Homebrew/compat/cask.rb +++ b/Library/Homebrew/compat/cask.rb @@ -1,8 +1,5 @@ -require "compat/cask/cask_loader" -require "compat/cask/cmd/--version" -require "compat/cask/cmd/cleanup" -require "compat/cask/cmd/search" require "compat/cask/cache" +require "compat/cask/cask_loader" require "compat/cask/caskroom" require "compat/cask/dsl" diff --git a/Library/Homebrew/compat/cask/cmd/--version.rb b/Library/Homebrew/compat/cask/cmd/--version.rb deleted file mode 100644 index a42c941956afc5a32ca415f36a47d014f8067673..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/cask/cmd/--version.rb +++ /dev/null @@ -1,31 +0,0 @@ -require "cask/cmd/abstract_command" -require "cmd/--version" - -module Cask - class Cmd - class Version < AbstractCommand - def self.command_name - "--#{super}" - end - - def initialize(*) - super - return if args.empty? - - raise ArgumentError, "#{self.class.command_name} does not take arguments." - end - - def run - odisabled "`brew cask --version`", "`brew --version`" - end - - def self.help - "displays the Homebrew Cask version" - end - - def self.visible - false - end - end - end -end diff --git a/Library/Homebrew/compat/cask/cmd/cleanup.rb b/Library/Homebrew/compat/cask/cmd/cleanup.rb deleted file mode 100644 index 39cb2db10db2608e85c9605e333c049f605f3dd3..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/cask/cmd/cleanup.rb +++ /dev/null @@ -1,29 +0,0 @@ -require "cask/cmd/abstract_command" -require "cleanup" - -using CleanupRefinement - -module Cask - class Cmd - class Cleanup < AbstractCommand - def self.help - "cleans up cached downloads and tracker symlinks" - end - - def self.visible - false - end - - attr_reader :cache_location - - def initialize(*args, cache_location: Cache.path) - super(*args) - @cache_location = Pathname.new(cache_location) - end - - def run - odisabled "`brew cask cleanup`", "`brew cleanup`" - end - end - end -end diff --git a/Library/Homebrew/compat/cask/cmd/search.rb b/Library/Homebrew/compat/cask/cmd/search.rb deleted file mode 100644 index f333255867f0ec459d5f021e7b6dcdb0275cffe0..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/cask/cmd/search.rb +++ /dev/null @@ -1,20 +0,0 @@ -require "cask/cmd/abstract_command" -require "cmd/search" - -module Cask - class Cmd - module Compat - class Search < AbstractCommand - def run - odisabled "`brew cask search`", "`brew search`" - end - - def self.visible - false - end - end - end - - prepend Compat - end -end diff --git a/Library/Homebrew/compat/download_strategy.rb b/Library/Homebrew/compat/download_strategy.rb index 519fe34af83718fd91058999833023827365f399..960ca9f067cf821b4ac9cb7e7063889e99d2a047 100644 --- a/Library/Homebrew/compat/download_strategy.rb +++ b/Library/Homebrew/compat/download_strategy.rb @@ -9,7 +9,7 @@ require "download_strategy" # distribution. (It will work for public buckets as well.) class S3DownloadStrategy < CurlDownloadStrategy def initialize(url, name, version, **meta) - odeprecated("S3DownloadStrategy", + odisabled("S3DownloadStrategy", "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") super end @@ -58,7 +58,7 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy require "utils/github" def initialize(url, name, version, **meta) - odeprecated("GitHubPrivateRepositoryDownloadStrategy", + odisabled("GitHubPrivateRepositoryDownloadStrategy", "a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)") super parse_url_pattern @@ -112,7 +112,7 @@ end # environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request. class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy def initialize(url, name, version, **meta) - odeprecated("GitHubPrivateRepositoryReleaseDownloadStrategy", + odisabled("GitHubPrivateRepositoryReleaseDownloadStrategy", "a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap (using require_relative)") super end @@ -168,7 +168,7 @@ end # ... class ScpDownloadStrategy < AbstractFileDownloadStrategy def initialize(url, name, version, **meta) - odeprecated("ScpDownloadStrategy", + odisabled("ScpDownloadStrategy", "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") super parse_url_pattern @@ -214,11 +214,11 @@ class DownloadStrategyDetector def detect_from_url(url) case url when %r{^s3://} - odeprecated("s3://", + odisabled("s3://", "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") S3DownloadStrategy when %r{^scp://} - odeprecated("scp://", + odisabled("scp://", "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") ScpDownloadStrategy else @@ -229,20 +229,20 @@ class DownloadStrategyDetector def detect_from_symbol(symbol) case symbol when :github_private_repo - odeprecated(":github_private_repo", + odisabled(":github_private_repo", "a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)") GitHubPrivateRepositoryDownloadStrategy when :github_private_release - odeprecated(":github_private_repo", + odisabled(":github_private_repo", "a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap "\ "(using require_relative)") GitHubPrivateRepositoryReleaseDownloadStrategy when :s3 - odeprecated(":s3", + odisabled(":s3", "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") S3DownloadStrategy when :scp - odeprecated(":scp", + odisabled(":scp", "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") ScpDownloadStrategy else diff --git a/Library/Homebrew/compat/extend/os/mac/utils/bottles.rb b/Library/Homebrew/compat/extend/os/mac/utils/bottles.rb index 5675539a103e5ad2c6b18ed0d64a0177a99cba03..4e26d0a4ea7bd1c51c95dcd878e14ffb410205eb 100644 --- a/Library/Homebrew/compat/extend/os/mac/utils/bottles.rb +++ b/Library/Homebrew/compat/extend/os/mac/utils/bottles.rb @@ -7,7 +7,7 @@ module Utils def tag_without_or_later(tag) return super unless tag.to_s.end_with?("_or_later") - odeprecated "`or_later` bottles", + odisabled "`or_later` bottles", "bottles without `or_later` (or_later is implied now)" tag.to_s[/(\w+)_or_later$/, 1].to_sym end diff --git a/Library/Homebrew/compat/fileutils.rb b/Library/Homebrew/compat/fileutils.rb deleted file mode 100644 index 72b3c783f9c6615aecdbf7622295526b298f99de..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/fileutils.rb +++ /dev/null @@ -1,16 +0,0 @@ -require "fileutils" - -module FileUtils - module Compat - def ruby(*) - odisabled "ruby", 'system "ruby"' - end - - def mktemp(*) - odisabled("FileUtils.mktemp", "mktemp") - end - module_function :mktemp - end - - prepend Compat -end diff --git a/Library/Homebrew/compat/formula.rb b/Library/Homebrew/compat/formula.rb new file mode 100644 index 0000000000000000000000000000000000000000..d85802e42561fb11502a1e51ede0c826850fe1a0 --- /dev/null +++ b/Library/Homebrew/compat/formula.rb @@ -0,0 +1,43 @@ +class Formula + module Compat + # Run `scons` using a Homebrew-installed version rather than whatever is + # in the `PATH`. + # TODO: deprecate + def scons(*args) + odeprecated("scons", 'system "scons"') + + system Formulary.factory("scons").opt_bin/"scons", *args + end + + # Run `make` 3.81 or newer. + # Uses the system make on Leopard and newer, and the + # path to the actually-installed make on Tiger or older. + # TODO: deprecate + def make(*args) + odeprecated("make", 'system "make"') + + if Utils.popen_read("/usr/bin/make", "--version") + .match(/Make (\d\.\d+)/)[1] > "3.80" + make_path = "/usr/bin/make" + else + make = Formula["make"].opt_bin/"make" + make_path = if make.exist? + make.to_s + else + (Formula["make"].opt_bin/"gmake").to_s + end + end + + if superenv? + make_name = File.basename(make_path) + with_env(HOMEBREW_MAKE: make_name) do + system "make", *args + end + else + system make_path, *args + end + end + end + + prepend Compat +end diff --git a/Library/Homebrew/compat/os/mac.rb b/Library/Homebrew/compat/os/mac.rb new file mode 100644 index 0000000000000000000000000000000000000000..7f6cd7ebf6b2804e77f12982f46a0c62fd9a7a0c --- /dev/null +++ b/Library/Homebrew/compat/os/mac.rb @@ -0,0 +1,14 @@ +module OS + module Mac + module Compat + module_function + + def prefer_64_bit? + odeprecated("MacOS.prefer_64_bit?") + Hardware::CPU.is_64_bit? + end + end + + prepend Compat + end +end diff --git a/Library/Homebrew/compat/requirements/x11_requirement.rb b/Library/Homebrew/compat/requirements/x11_requirement.rb index 4474784548f717bd8063a99bd85dee4268ac1eaf..6d1b686d8ab2b1ac1bc65b61c3e1a3ff409aea96 100644 --- a/Library/Homebrew/compat/requirements/x11_requirement.rb +++ b/Library/Homebrew/compat/requirements/x11_requirement.rb @@ -4,8 +4,7 @@ class X11Requirement < Requirement module Compat def initialize(tags = []) if tags.first.to_s.match?(/(\d\.)+\d/) - odeprecated('depends_on :x11 => "X.Y.Z"') - tags.shift + odisabled('depends_on :x11 => "X.Y.Z"') end super(tags) diff --git a/Library/Homebrew/compat/requirements/xcode_requirement.rb b/Library/Homebrew/compat/requirements/xcode_requirement.rb index 490d1570919cc8a600b5705f026c72ac414fb7e8..93ada7f8267bdafea8420fb90dd68f0d5bfbd253 100644 --- a/Library/Homebrew/compat/requirements/xcode_requirement.rb +++ b/Library/Homebrew/compat/requirements/xcode_requirement.rb @@ -8,7 +8,7 @@ class XcodeRequirement < Requirement else tags.find do |tag| next unless tag.to_s.match?(/(\d\.)+\d/) - odeprecated('depends_on :xcode => [..., "X.Y.Z"]') + odisabled('depends_on :xcode => [..., "X.Y.Z"]') tags.delete(tag) end end diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 0c360393e8f8adbb8724ea6e14202a4fe27577f0..4c6bc285ee39bd83e4b1f72fdc3cd629ffeb8994 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -1,10 +1,9 @@ # @private module CompilerConstants - GNU_GCC_VERSIONS = %w[4.4 4.5 4.6 4.7 4.8 4.9 5 6 7 8].freeze - GNU_GCC_REGEXP = /^gcc-(4\.[4-9]|[5-8])$/.freeze + GNU_GCC_VERSIONS = %w[4.9 5 6 7 8].freeze + GNU_GCC_REGEXP = /^gcc-(4\.9|[5-8])$/.freeze COMPILER_SYMBOL_MAP = { "gcc" => :gcc, - "gcc-4.0" => :gcc_4_0, "gcc-4.2" => :gcc_4_2, "clang" => :clang, "llvm_clang" => :llvm_clang, @@ -43,7 +42,7 @@ class CompilerFailure if spec.is_a?(Hash) _, major_version = spec.first name = "gcc-#{major_version}" - # so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible + # so fails_with :gcc => '7' simply marks all 7 releases incompatible version = "#{major_version}.999" else name = spec @@ -68,22 +67,12 @@ class CompilerFailure COLLECTIONS = { cxx11: [ - create(:gcc_4_0), create(:gcc_4_2), create(:clang) { build 425 }, - create(gcc: "4.4"), - create(gcc: "4.5"), - create(gcc: "4.6"), ], cxx14: [ create(:clang) { build 600 }, - create(:gcc_4_0), create(:gcc_4_2), - create(gcc: "4.4"), - create(gcc: "4.5"), - create(gcc: "4.6"), - create(gcc: "4.7"), - create(gcc: "4.8"), ], openmp: [ create(:clang), @@ -97,10 +86,9 @@ class CompilerSelector Compiler = Struct.new(:name, :version) COMPILER_PRIORITY = { - clang: [:clang, :gcc_4_2, :gnu, :gcc_4_0, :llvm_clang], - gcc_4_2: [:gcc_4_2, :gnu, :clang, :gcc_4_0], - gcc_4_0: [:gcc_4_0, :gcc_4_2, :gnu, :clang], - gcc: [:gnu, :gcc, :llvm_clang, :clang, :gcc_4_2, :gcc_4_0], + clang: [:clang, :gcc_4_2, :gnu, :llvm_clang], + gcc_4_2: [:gcc_4_2, :gnu, :clang], + gcc: [:gnu, :gcc, :llvm_clang, :clang, :gcc_4_2], }.freeze def self.select_for(formula, compilers = self.compilers) diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index c6ef192e2651180579d6b71d4b1c65545e610d48..fc74049f105ed10975db1c4c8e7f3abb1d9982a9 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -83,8 +83,6 @@ class DependencyCollector JavaRequirement.new(tags) end - def ld64_dep_if_needed(*); end - def self.tar_needs_xz_dependency? !new.xz_dep_if_needed([]).nil? end @@ -130,7 +128,6 @@ class DependencyCollector when :tuntap then TuntapRequirement.new(tags) when :x11 then X11Requirement.new(tags) when :xcode then XcodeRequirement.new(tags) - when :ld64 then ld64_dep_if_needed(tags) else raise ArgumentError, "Unsupported special dependency #{spec.inspect}" end diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index 303144bbeb686c388b0c110422e0ba6031eb90ec..728b4177e1d6b8442327aa149f9b2543680405c9 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -37,21 +37,10 @@ class DevelopmentTools :clang end - def gcc_4_0_build_version - @gcc_4_0_build_version ||= begin - if (path = locate("gcc-4.0")) && - build_version = `#{path} --version 2>/dev/null`[/build (\d{4,})/, 1] - Version.new build_version - else - Version::NULL - end - end - end - def gcc_4_2_build_version @gcc_4_2_build_version ||= begin - gcc = locate("gcc-4.2") || HOMEBREW_PREFIX/"opt/apple-gcc42/bin/gcc-4.2" - if gcc.exist? && !gcc.realpath.basename.to_s.start_with?("llvm") && + if (gcc = locate("gcc-4.2")) && + !gcc.realpath.basename.to_s.start_with?("llvm") && build_version = `#{gcc} --version 2>/dev/null`[/build (\d{4,})/, 1] Version.new build_version else @@ -109,7 +98,7 @@ class DevelopmentTools end def clear_version_cache - @gcc_4_0_build_version = @gcc_4_2_build_version = nil + @gcc_4_2_build_version = nil @clang_version = @clang_build_version = nil @non_apple_gcc_version = {} end diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index a063c9dba45cb53c3600a02a65a1a54da668f71b..138418f24e0ea3233e8074b6c2cd4bc2a6f79cf6 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -266,14 +266,6 @@ module SharedEnvExtension set_cpu_flags(flags) end - # ld64 is a newer linker provided for Xcode 2.5 - # @private - def ld64 - ld64 = Formulary.factory("ld64") - self["LD"] = ld64.bin/"ld" - append "LDFLAGS", "-B#{ld64.bin}/" - end - # @private def effective_arch if ARGV.build_bottle? && ARGV.bottle_arch diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index ed0c2b4fc0cd2c320c141d6e2a1343bc0630980b..a909f41df6f65b8595b8e58d73d6f7fe9a0f2126 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -100,11 +100,6 @@ module Stdenv dir/base.to_s.sub("gcc", "g++").sub("clang", "clang++") end - def gcc_4_0 - super - set_cpu_cflags - end - def gcc_4_2 super set_cpu_cflags @@ -126,21 +121,6 @@ module Stdenv set_cpu_cflags map end - def minimal_optimization - define_cflags "-Os #{SAFE_CFLAGS_FLAGS}" - end - alias generic_minimal_optimization minimal_optimization - - def no_optimization - define_cflags SAFE_CFLAGS_FLAGS - end - alias generic_no_optimization no_optimization - - # we've seen some packages fail to build when warnings are disabled! - def enable_warnings - remove_from_cflags "-w" - end - def m64 append_to_cflags "-m64" append "LDFLAGS", "-arch #{Hardware::CPU.arch_64_bit}" @@ -208,7 +188,6 @@ module Stdenv append flags, xarch unless xarch.empty? append flags, map.fetch(effective_arch) end - alias generic_set_cpu_flags set_cpu_flags def x11; end diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index 4236f3b5e25afa5e7d0f53c190a2935bc1dfc7cb..91b83a1f93ff88a676009470059eddde58ffd81c 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -264,15 +264,6 @@ module Superenv check_for_compiler_universal_support self["HOMEBREW_ARCHFLAGS"] = Hardware::CPU.universal_archs.as_arch_flags - - # GCC doesn't accept "-march" for a 32-bit CPU with "-arch x86_64" - return if compiler_any_clang? - return unless Hardware::CPU.is_32_bit? - - self["HOMEBREW_OPTFLAGS"] = self["HOMEBREW_OPTFLAGS"].sub( - /-march=\S*/, - "-Xarch_#{Hardware::CPU.arch_32_bit} \\0", - ) end def permit_arch_flags diff --git a/Library/Homebrew/extend/os/mac/dependency_collector.rb b/Library/Homebrew/extend/os/mac/dependency_collector.rb index 55b5f985eb066b162008958231f839a2e6e0cb8b..4a49c8d2926971939c13cb082c37bdfacc7bbdc5 100644 --- a/Library/Homebrew/extend/os/mac/dependency_collector.rb +++ b/Library/Homebrew/extend/os/mac/dependency_collector.rb @@ -1,9 +1,6 @@ -require "os/mac/ld64_dependency" - class DependencyCollector undef git_dep_if_needed, subversion_dep_if_needed, cvs_dep_if_needed, - xz_dep_if_needed, unzip_dep_if_needed, bzip2_dep_if_needed, - ld64_dep_if_needed + xz_dep_if_needed, unzip_dep_if_needed, bzip2_dep_if_needed def git_dep_if_needed(tags) return if MacOS.version >= :lion @@ -28,11 +25,4 @@ class DependencyCollector def unzip_dep_if_needed(tags); end def bzip2_dep_if_needed(tags); end - - def ld64_dep_if_needed(*) - # Tiger's ld is too old to properly link some software - return if MacOS.version > :tiger - - LD64Dependency.new - end end diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb index ab2cfe90ea73247752889aec62dfb2eaa6a2551b..018ab77547e71dccba0000865d5d81f657d8f3d5 100644 --- a/Library/Homebrew/extend/os/mac/development_tools.rb +++ b/Library/Homebrew/extend/os/mac/development_tools.rb @@ -11,7 +11,7 @@ class DevelopmentTools (@locate ||= {}).fetch(tool) do |key| @locate[key] = if (located_tool = generic_locate(tool)) located_tool - elsif MacOS.version > :tiger + else path = Utils.popen_read("/usr/bin/xcrun", "-no-cache", "-find", tool, err: :close).chomp Pathname.new(path) if File.executable?(path) end @@ -27,9 +27,6 @@ class DevelopmentTools def default_compiler case default_cc - # if GCC 4.2 is installed, e.g. via Tigerbrew, prefer it - # over the system's GCC 4.0 - when /^gcc-4\.0/ then gcc_4_2_build_version ? :gcc_4_2 : :gcc_4_0 when /^gcc/ then :gcc_4_2 when "clang" then :clang else @@ -75,26 +72,10 @@ class DevelopmentTools end def custom_installation_instructions - if MacOS.version > :leopard - <<~EOS - Install GNU's GCC - brew install gcc - EOS - elsif MacOS.version > :tiger - <<~EOS - Install GNU's GCC - brew install gcc@4.6 - EOS - else - # Tiger doesn't ship with apple-gcc42, and this is required to build - # some software that doesn't build properly with FSF GCC. - <<~EOS - Install Apple's GCC - brew install apple-gcc42 - or GNU's GCC - brew install gcc@4.6 - EOS - end + <<~EOS + Install GNU's GCC + brew install gcc + EOS end end end diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb index 9af802596894335b3239e081bb4bf8bd19135e66..04a2cb8e1762e581fdbd7109ded881af9250335d 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb @@ -54,36 +54,9 @@ module Stdenv # Leopard's ld needs some convincing that it's building 64-bit # See: https://github.com/mistydemeo/tigerbrew/issues/59 - return unless MacOS.version == :leopard && MacOS.prefer_64_bit? + return unless MacOS.version == :leopard append "LDFLAGS", "-arch #{Hardware::CPU.arch_64_bit}" - - # Many, many builds are broken thanks to Leopard's buggy ld. - # Our ld64 fixes many of those builds, though of course we can't - # depend on it already being installed to build itself. - ld64 if Formula["ld64"].installed? - end - - # Sets architecture-specific flags for every environment variable - # given in the list `flags`. - # @private - def set_cpu_flags(flags, map = Hardware::CPU.optimization_flags) - generic_set_cpu_flags(flags, map) - - # Works around a buggy system header on Tiger - append flags, "-faltivec" if MacOS.version == :tiger - end - - def minimal_optimization - generic_minimal_optimization - - macosxsdk unless MacOS::CLT.installed? - end - - def no_optimization - generic_no_optimization - - macosxsdk unless MacOS::CLT.installed? end def remove_macosxsdk(version = MacOS.version) diff --git a/Library/Homebrew/extend/os/mac/hardware/cpu.rb b/Library/Homebrew/extend/os/mac/hardware/cpu.rb index 986cf637e5ec259008cad735c8190bac532546ab..4a70687ba2babc5ab46ad8860efc38cc7e3583f9 100644 --- a/Library/Homebrew/extend/os/mac/hardware/cpu.rb +++ b/Library/Homebrew/extend/os/mac/hardware/cpu.rb @@ -66,9 +66,7 @@ module Hardware when 11 :g4e # PowerPC 7450 when 100 - # This is the only 64-bit PPC CPU type, so it's useful - # to distinguish in `brew config` output and in bottle tags - MacOS.prefer_64_bit? ? :g5_64 : :g5 # PowerPC 970 + :g5_64 # PowerPC 970 else :dunno end @@ -78,17 +76,11 @@ module Hardware # Returns an array that's been extended with ArchitectureListExtension, # which provides helpers like #as_arch_flags and #as_cmake_arch_flags. def universal_archs - # Building 64-bit is a no-go on Tiger, and pretty hit or miss on Leopard. - # Don't even try unless Tigerbrew's experimental 64-bit Leopard support is enabled. - if MacOS.version <= :leopard && !MacOS.prefer_64_bit? - [arch_32_bit].extend ArchitectureListExtension - else - # Amazingly, this order (64, then 32) matters. It shouldn't, but it - # does. GCC (some versions? some systems?) can blow up if the other - # order is used. - # https://superuser.com/questions/740563/gcc-4-8-on-macos-fails-depending-on-arch-order - [arch_64_bit, arch_32_bit].extend ArchitectureListExtension - end + # Amazingly, this order (64, then 32) matters. It shouldn't, but it + # does. GCC (some versions? some systems?) can blow up if the other + # order is used. + # https://superuser.com/questions/740563/gcc-4-8-on-macos-fails-depending-on-arch-order + [arch_64_bit, arch_32_bit].extend ArchitectureListExtension end # Determines whether the current CPU and macOS combination diff --git a/Library/Homebrew/extend/os/mac/utils/bottles.rb b/Library/Homebrew/extend/os/mac/utils/bottles.rb index 02b6822fc0d28bfecc4383671309e21f2b21d397..d6ab6f6a2bfdf144e15ddbc128a8d1d381b433b6 100644 --- a/Library/Homebrew/extend/os/mac/utils/bottles.rb +++ b/Library/Homebrew/extend/os/mac/utils/bottles.rb @@ -9,13 +9,7 @@ module Utils elsif MacOS.version == :snow_leopard Hardware::CPU.is_64_bit? ? :snow_leopard : :snow_leopard_32 else - # Return, e.g., :tiger_g3, :leopard_g5_64, :leopard_64 (which is Intel) - if Hardware::CPU.type == :ppc - tag = "#{MacOS.cat}_#{Hardware::CPU.family}".to_sym - else - tag = MacOS.cat - end - MacOS.prefer_64_bit? ? "#{tag}_64".to_sym : tag + "#{MacOS.cat}_64".to_sym end end end @@ -27,21 +21,9 @@ module Utils def find_matching_tag(tag) generic_find_matching_tag(tag) || - find_altivec_tag(tag) || find_older_compatible_tag(tag) end - # This allows generic Altivec PPC bottles to be supported in some - # formulae, while also allowing specific bottles in others; e.g., - # sometimes a formula has just :tiger_altivec, other times it has - # :tiger_g4, :tiger_g5, etc. - def find_altivec_tag(tag) - return unless tag.to_s =~ /(\w+)_(g4|g4e|g5)$/ - - altivec_tag = "#{Regexp.last_match(1)}_altivec".to_sym - altivec_tag if key?(altivec_tag) - end - def tag_without_or_later(tag) tag end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2d0be7bd669aa48cb94b69a6c0c3a078bf9a4cdd..eec6635b29732fff7f578f968888504eadec2ced 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1983,38 +1983,6 @@ class Formula end end - # Run `scons` using a Homebrew-installed version rather than whatever is - # in the `PATH`. - def scons(*args) - system Formulary.factory("scons").opt_bin/"scons", *args - end - - # Run `make` 3.81 or newer. - # Uses the system make on Leopard and newer, and the - # path to the actually-installed make on Tiger or older. - def make(*args) - if Utils.popen_read("/usr/bin/make", "--version") - .match(/Make (\d\.\d+)/)[1] > "3.80" - make_path = "/usr/bin/make" - else - make = Formula["make"].opt_bin/"make" - make_path = if make.exist? - make.to_s - else - (Formula["make"].opt_bin/"gmake").to_s - end - end - - if superenv? - make_name = File.basename(make_path) - with_env(HOMEBREW_MAKE: make_name) do - system "make", *args - end - else - system make_path, *args - end - end - # Run `xcodebuild` without Homebrew's compiler environment variables set. def xcodebuild(*args) removed = ENV.remove_cc_etc @@ -2388,7 +2356,6 @@ class Formula # depends_on :arch => :intel # If this formula only builds on Intel architecture. # depends_on :arch => :x86_64 # If this formula only builds on Intel x86 64-bit. # depends_on :arch => :ppc # Only builds on PowerPC? - # depends_on :ld64 # Sometimes ld fails on `MacOS.version < :leopard`. Then use this. # depends_on :x11 => :optional # X11/XQuartz components. # depends_on :osxfuse # Permits the use of the upstream signed binary or our source package. # depends_on :tuntap # Does the same thing as above. This is vital for Yosemite and above.</pre> @@ -2532,17 +2499,18 @@ class Formula # if so, then the compiler will be blacklisted for *all* versions. # # `major_version` should be the major release number only, for instance - # '4.8' for the GCC 4.8 series (4.8.0, 4.8.1, etc.). + # '7' for the GCC 7 series (7.0, 7.1, etc.). # If `version` or the block is omitted, then the compiler will be # blacklisted for all compilers in that series. # - # For example, if a bug is only triggered on GCC 4.8.1 but is not - # encountered on 4.8.2: + # For example, if a bug is only triggered on GCC 7.1 but is not + # encountered on 7.2: # - # <pre>fails_with :gcc => '4.8' do - # version '4.8.1' + # <pre>fails_with :gcc => '7' do + # version '7.1' # end</pre> def fails_with(compiler, &block) + odeprecated "fails_with :gcc_4_0" if compiler == :gcc_4_0 specs.each { |spec| spec.fails_with(compiler, &block) } end diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index ee647a995f73bb41be7278ba202eb4ac5500503b..7b7fb8804217d48f8eba3b0d9f86bf8e1626f994 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -7,7 +7,7 @@ module Homebrew module Install module_function - def check_ppc + def check_cpu case Hardware::CPU.type when :ppc abort <<~EOS @@ -32,7 +32,7 @@ module Homebrew end def perform_preinstall_checks - check_ppc + check_cpu attempt_directory_creation fatal_checks(:fatal_install_checks) end diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index 38c3728c4fcb469c77b34f95eff0be752f2a0c59..5cbcbded8eb6a30ba9b906d8c1299783cebc95c0 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -140,12 +140,6 @@ Note that environment variables must have a value set to be detected. For exampl If set, Homebrew uses this setting as the browser when opening project homepages, instead of the OS default browser. - * `HOMEBREW_BUILD_FROM_SOURCE`: - If set, instructs Homebrew to compile from source even when a formula - provides a bottle. This environment variable is intended for use by - Homebrew developers. Please do not file issues if you encounter errors when - using this environment variable. - * `HOMEBREW_CACHE`: If set, instructs Homebrew to use the specified directory as the download cache. diff --git a/Library/Homebrew/os/linux.rb b/Library/Homebrew/os/linux.rb index f78a675422fad72c34e7a8852a2e5bb9313d9896..96fbbb9037d11f76c432d55447a63273d2a0ad1a 100644 --- a/Library/Homebrew/os/linux.rb +++ b/Library/Homebrew/os/linux.rb @@ -7,10 +7,6 @@ module OS raise "Loaded OS::Linux on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] - def prefer_64_bit? - Hardware::CPU.is_64_bit? - end - def version Version::NULL end diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 20be51fceecaf731219f61ea60d1955de2ab37db..c7d7c590503b8ceee06b5a9c88fe36c71c451843 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -158,16 +158,8 @@ module OS paths.uniq end - def prefer_64_bit? - if ENV["HOMEBREW_PREFER_64_BIT"] && version == :leopard - Hardware::CPU.is_64_bit? - else - Hardware::CPU.is_64_bit? && version > :leopard - end - end - def preferred_arch - if prefer_64_bit? + if Hardware::CPU.is_64_bit? Hardware::CPU.arch_64_bit else Hardware::CPU.arch_32_bit @@ -175,13 +167,11 @@ module OS end STANDARD_COMPILERS = { - "2.0" => { gcc_4_0_build: 4061 }, - "2.5" => { gcc_4_0_build: 5370 }, - "3.1.4" => { gcc_4_0_build: 5493, gcc_4_2_build: 5577 }, - "3.2.6" => { gcc_4_0_build: 5494, gcc_4_2_build: 5666, clang: "1.7", clang_build: 77 }, - "4.0" => { gcc_4_0_build: 5494, gcc_4_2_build: 5666, clang: "2.0", clang_build: 137 }, - "4.0.1" => { gcc_4_0_build: 5494, gcc_4_2_build: 5666, clang: "2.0", clang_build: 137 }, - "4.0.2" => { gcc_4_0_build: 5494, gcc_4_2_build: 5666, clang: "2.0", clang_build: 137 }, + "3.1.4" => { gcc_4_2_build: 5577 }, + "3.2.6" => { gcc_4_2_build: 5666, clang: "1.7", clang_build: 77 }, + "4.0" => { gcc_4_2_build: 5666, clang: "2.0", clang_build: 137 }, + "4.0.1" => { gcc_4_2_build: 5666, clang: "2.0", clang_build: 137 }, + "4.0.2" => { gcc_4_2_build: 5666, clang: "2.0", clang_build: 137 }, "4.2" => { clang: "3.0", clang_build: 211 }, "4.3" => { clang: "3.1", clang_build: 318 }, "4.3.1" => { clang: "3.1", clang_build: 318 }, diff --git a/Library/Homebrew/os/mac/ld64_dependency.rb b/Library/Homebrew/os/mac/ld64_dependency.rb deleted file mode 100644 index a506a0ab2d38f168e4c15b0c18dacaf4cbbe703a..0000000000000000000000000000000000000000 --- a/Library/Homebrew/os/mac/ld64_dependency.rb +++ /dev/null @@ -1,11 +0,0 @@ -require "dependency" - -# This special dependency ensures that the Tigerbrew ld64 -# formula is used as gcc's ld in place of the old version -# that comes with the OS. -class LD64Dependency < Dependency - def initialize(name = "ld64", tags = [:build], env_proc = nil) - super - @env_proc = proc { ENV.ld64 } - end -end diff --git a/Library/Homebrew/os/mac/version.rb b/Library/Homebrew/os/mac/version.rb index 213d4028400695edf42cc0685f78932aa8722dd9..fe1d7988f45c9c250ec0ebbee8b622103e692378 100644 --- a/Library/Homebrew/os/mac/version.rb +++ b/Library/Homebrew/os/mac/version.rb @@ -15,7 +15,6 @@ module OS snow_leopard: "10.6", leopard_64: "10.5", leopard: "10.5", - tiger: "10.4", }.freeze def self.from_symbol(sym) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index b479da3745f2ac8e646e1e7fc062b4f44e11b81c..df6bc6158be9a84a40631d3acfbaae1d69fe7000 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -9,7 +9,6 @@ module OS def latest_version case MacOS.version - when "10.4" then "2.5" when "10.5" then "3.1.4" when "10.6" then "3.2.6" when "10.7" then "4.6.3" diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb index 27f30caa6742680740737111baf79c45812face3..514e52c5e4b739b7c01cf3f89c23c94d92c0353d 100644 --- a/Library/Homebrew/os/mac/xquartz.rb +++ b/Library/Homebrew/os/mac/xquartz.rb @@ -92,7 +92,6 @@ module OS # educated guess as to what version is installed. def guess_system_version case MacOS.version - when "10.4" then "1.1.3" when "10.5" then "2.1.6" when "10.6" then "2.3.6" when "10.7" then "2.6.3" diff --git a/Library/Homebrew/requirements/arch_requirement.rb b/Library/Homebrew/requirements/arch_requirement.rb index 0fff93a9efbf7b4c31d1b1ebb717c17929e82954..a39749a56df0cf839ffefb746173c5143330a395 100644 --- a/Library/Homebrew/requirements/arch_requirement.rb +++ b/Library/Homebrew/requirements/arch_requirement.rb @@ -10,7 +10,7 @@ class ArchRequirement < Requirement satisfy(build_env: false) do case @arch - when :x86_64 then MacOS.prefer_64_bit? + when :x86_64 then Hardware::CPU.is_64_bit? when :intel, :ppc then Hardware::CPU.type == @arch end end diff --git a/Library/Homebrew/rubocops/lines.rb b/Library/Homebrew/rubocops/lines.rb index fa1d1f2b2730f3d0e83dc9be27735953fca29ee3..3e1713f50d585a0d8583368d3d7d1bdc8722ba58 100644 --- a/Library/Homebrew/rubocops/lines.rb +++ b/Library/Homebrew/rubocops/lines.rb @@ -312,8 +312,6 @@ module RuboCop end find_method_with_args(body_node, :system, /^(otool|install_name_tool|lipo)/) do - next if @formula_name == "cctools" - problem "Use ruby-macho instead of calling #{@offensive_node.source}" end diff --git a/Library/Homebrew/shims/linux/super/g++-4.3 b/Library/Homebrew/shims/linux/super/g++-4.3 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/g++-4.3 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/g++-4.4 b/Library/Homebrew/shims/linux/super/g++-4.4 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/g++-4.4 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/g++-4.5 b/Library/Homebrew/shims/linux/super/g++-4.5 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/g++-4.5 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/g++-4.6 b/Library/Homebrew/shims/linux/super/g++-4.6 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/g++-4.6 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/g++-4.7 b/Library/Homebrew/shims/linux/super/g++-4.7 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/g++-4.7 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/g++-4.8 b/Library/Homebrew/shims/linux/super/g++-4.8 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/g++-4.8 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/gcc-4.3 b/Library/Homebrew/shims/linux/super/gcc-4.3 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/gcc-4.3 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/gcc-4.4 b/Library/Homebrew/shims/linux/super/gcc-4.4 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/gcc-4.4 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/gcc-4.5 b/Library/Homebrew/shims/linux/super/gcc-4.5 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/gcc-4.5 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/gcc-4.6 b/Library/Homebrew/shims/linux/super/gcc-4.6 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/gcc-4.6 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/gcc-4.7 b/Library/Homebrew/shims/linux/super/gcc-4.7 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/gcc-4.7 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/linux/super/gcc-4.8 b/Library/Homebrew/shims/linux/super/gcc-4.8 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/linux/super/gcc-4.8 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/g++-4.3 b/Library/Homebrew/shims/mac/super/g++-4.3 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/g++-4.3 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/g++-4.4 b/Library/Homebrew/shims/mac/super/g++-4.4 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/g++-4.4 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/g++-4.5 b/Library/Homebrew/shims/mac/super/g++-4.5 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/g++-4.5 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/g++-4.6 b/Library/Homebrew/shims/mac/super/g++-4.6 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/g++-4.6 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/g++-4.7 b/Library/Homebrew/shims/mac/super/g++-4.7 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/g++-4.7 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/g++-4.8 b/Library/Homebrew/shims/mac/super/g++-4.8 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/g++-4.8 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/gcc-4.3 b/Library/Homebrew/shims/mac/super/gcc-4.3 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/gcc-4.3 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/gcc-4.4 b/Library/Homebrew/shims/mac/super/gcc-4.4 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/gcc-4.4 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/gcc-4.5 b/Library/Homebrew/shims/mac/super/gcc-4.5 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/gcc-4.5 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/gcc-4.6 b/Library/Homebrew/shims/mac/super/gcc-4.6 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/gcc-4.6 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/gcc-4.7 b/Library/Homebrew/shims/mac/super/gcc-4.7 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/gcc-4.7 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/mac/super/gcc-4.8 b/Library/Homebrew/shims/mac/super/gcc-4.8 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/mac/super/gcc-4.8 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/g++-4.3 b/Library/Homebrew/shims/super/g++-4.3 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/g++-4.3 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/g++-4.4 b/Library/Homebrew/shims/super/g++-4.4 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/g++-4.4 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/g++-4.5 b/Library/Homebrew/shims/super/g++-4.5 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/g++-4.5 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/g++-4.6 b/Library/Homebrew/shims/super/g++-4.6 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/g++-4.6 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/g++-4.7 b/Library/Homebrew/shims/super/g++-4.7 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/g++-4.7 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/g++-4.8 b/Library/Homebrew/shims/super/g++-4.8 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/g++-4.8 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/gcc-4.2 b/Library/Homebrew/shims/super/gcc-4.2 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/gcc-4.2 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/gcc-4.3 b/Library/Homebrew/shims/super/gcc-4.3 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/gcc-4.3 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/gcc-4.4 b/Library/Homebrew/shims/super/gcc-4.4 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/gcc-4.4 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/gcc-4.5 b/Library/Homebrew/shims/super/gcc-4.5 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/gcc-4.5 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/gcc-4.6 b/Library/Homebrew/shims/super/gcc-4.6 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/gcc-4.6 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/gcc-4.7 b/Library/Homebrew/shims/super/gcc-4.7 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/gcc-4.7 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/shims/super/gcc-4.8 b/Library/Homebrew/shims/super/gcc-4.8 deleted file mode 120000 index 2652f5f42c003f125212dd61f95a3a8a37cb45d5..0000000000000000000000000000000000000000 --- a/Library/Homebrew/shims/super/gcc-4.8 +++ /dev/null @@ -1 +0,0 @@ -cc \ No newline at end of file diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 49b9e49f8ce86e0948f0d8a03d9e51cfd74e8121..8de09648175bdee2a312fb368de2a794e1cc9007 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -131,10 +131,6 @@ class SoftwareSpec def option(name, description = "") opt = PREDEFINED_OPTIONS.fetch(name) do - if name.is_a?(Symbol) - odisabled "passing arbitrary symbols (i.e. #{name.inspect}) to `option`" - end - unless name.is_a?(String) raise ArgumentError, "option name must be string or symbol; got a #{name.class}: #{name}" end @@ -212,6 +208,7 @@ class SoftwareSpec end def fails_with(compiler, &block) + odeprecated "fails_with :gcc_4_0" if compiler == :gcc_4_0 compiler_failures << CompilerFailure.create(compiler, &block) end diff --git a/Library/Homebrew/test/ENV_spec.rb b/Library/Homebrew/test/ENV_spec.rb index 408e2dddf516b84b4499318a750c703ab0c8396a..5aff602354f2b7ffefd724fa7ef16dd0c418e7bf 100644 --- a/Library/Homebrew/test/ENV_spec.rb +++ b/Library/Homebrew/test/ENV_spec.rb @@ -126,7 +126,7 @@ shared_examples EnvActivation do describe "#compiler" do it "allows switching compilers" do - [:clang, :gcc_4_2, :gcc_4_0].each do |compiler| + [:clang, :gcc_4_2].each do |compiler| subject.public_send(compiler) expect(subject.compiler).to eq(compiler) end diff --git a/Library/Homebrew/test/cmd/prune_spec.rb b/Library/Homebrew/test/cmd/prune_spec.rb deleted file mode 100644 index 1c63d125617399b9271c08bf03b2ee8da2f8bc92..0000000000000000000000000000000000000000 --- a/Library/Homebrew/test/cmd/prune_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -describe "brew prune", :integration_test do - it "removes empty directories and broken symlinks" do - share = (HOMEBREW_PREFIX/"share") - - (share/"pruneable/directory/here").mkpath - (share/"notpruneable/file").write "I'm here" - FileUtils.ln_s "/i/dont/exist/no/really/i/dont", share/"pruneable_symlink" - - expect { brew "prune", "--dry-run" } - .to output(%r{Would remove \(empty directory\): .*/pruneable/directory/here}).to_stdout - .and not_to_output.to_stderr - .and be_a_success - - expect { brew "prune" } - .to output(/Pruned 1 symbolic links and 3 directories/).to_stdout - .and not_to_output.to_stderr - .and be_a_success - - expect(share/"pruneable").not_to be_a_directory - expect(share/"notpruneable").to be_a_directory - expect(share/"pruneable_symlink").not_to be_a_symlink - end -end diff --git a/Library/Homebrew/test/compiler_failure_spec.rb b/Library/Homebrew/test/compiler_failure_spec.rb index 47b35d3bc9aa667d8866d1febfb01a3c430eb635..a6dc8b530ce9277bf1db7001813b58858ecd1310 100644 --- a/Library/Homebrew/test/compiler_failure_spec.rb +++ b/Library/Homebrew/test/compiler_failure_spec.rb @@ -21,17 +21,17 @@ describe CompilerFailure do end it "creates a failure when given a hash" do - failure = described_class.create(gcc: "4.8") - expect(failure).to fail_with(double("Compiler", name: "gcc-4.8", version: "4.8")) - expect(failure).to fail_with(double("Compiler", name: "gcc-4.8", version: "4.8.1")) - expect(failure).not_to fail_with(double("Compiler", name: "gcc-4.7", version: "4.7")) + failure = described_class.create(gcc: "7") + expect(failure).to fail_with(double("Compiler", name: "gcc-7", version: "7")) + expect(failure).to fail_with(double("Compiler", name: "gcc-7", version: "7.1")) + expect(failure).not_to fail_with(double("Compiler", name: "gcc-6", version: "6.0")) end it "creates a failure when given a hash and a block with aversion" do - failure = described_class.create(gcc: "4.8") { version "4.8.1" } - expect(failure).to fail_with(double("Compiler", name: "gcc-4.8", version: "4.8")) - expect(failure).to fail_with(double("Compiler", name: "gcc-4.8", version: "4.8.1")) - expect(failure).not_to fail_with(double("Compiler", name: "gcc-4.8", version: "4.8.2")) + failure = described_class.create(gcc: "7") { version "7.1" } + expect(failure).to fail_with(double("Compiler", name: "gcc-7", version: "7")) + expect(failure).to fail_with(double("Compiler", name: "gcc-7", version: "7.1")) + expect(failure).not_to fail_with(double("Compiler", name: "gcc-7", version: "7.2")) end end end diff --git a/Library/Homebrew/test/compiler_selector_spec.rb b/Library/Homebrew/test/compiler_selector_spec.rb index b4ec54333acb35b75154e1b636340ed3d1d54b8b..25bea750e800995b658631824bcb80fd60fb0dcd 100644 --- a/Library/Homebrew/test/compiler_selector_spec.rb +++ b/Library/Homebrew/test/compiler_selector_spec.rb @@ -9,7 +9,6 @@ describe CompilerSelector do let(:cc) { :clang } let(:versions) do double( - gcc_4_0_build_version: Version::NULL, gcc_4_2_build_version: Version.create("5666"), llvm_build_version: Version::NULL, clang_build_version: Version.create("425"), @@ -19,8 +18,8 @@ describe CompilerSelector do before do allow(versions).to receive(:non_apple_gcc_version) do |name| case name - when "gcc-4.8" then Version.create("4.8.1") - when "gcc-4.7" then Version.create("4.7.1") + when "gcc-7" then Version.create("7.1") + when "gcc-6" then Version.create("6.1") else Version::NULL end end @@ -32,14 +31,14 @@ describe CompilerSelector do end it "returns clang if it fails with non-Apple gcc" do - software_spec.fails_with(gcc: "4.8") + software_spec.fails_with(gcc: "7") expect(subject.compiler).to eq(:clang) end - it "still returns gcc-4.8 if it fails with gcc without a specific version" do + it "still returns gcc-7 if it fails with gcc without a specific version" do software_spec.fails_with(:clang) software_spec.fails_with(:gcc_4_2) - expect(subject.compiler).to eq("gcc-4.8") + expect(subject.compiler).to eq("gcc-7") end it "returns gcc if it fails with clang and llvm" do @@ -54,23 +53,23 @@ describe CompilerSelector do example "returns gcc if it fails with a specific gcc version" do software_spec.fails_with(:clang) - software_spec.fails_with(gcc: "4.8") + software_spec.fails_with(gcc: "7") expect(subject.compiler).to eq(:gcc_4_2) end example "returns a lower version of gcc if it fails with the highest version" do software_spec.fails_with(:clang) software_spec.fails_with(:gcc_4_2) - software_spec.fails_with(gcc: "4.8") - expect(subject.compiler).to eq("gcc-4.7") + software_spec.fails_with(gcc: "7") + expect(subject.compiler).to eq("gcc-6") end it "raises an error when gcc or llvm is missing" do allow(versions).to receive(:gcc_4_2_build_version).and_return(Version::NULL) software_spec.fails_with(:clang) - software_spec.fails_with(gcc: "4.8") - software_spec.fails_with(gcc: "4.7") + software_spec.fails_with(gcc: "7") + software_spec.fails_with(gcc: "6") expect { subject.compiler }.to raise_error(CompilerSelectionError) end diff --git a/Library/Homebrew/test/cxxstdlib_spec.rb b/Library/Homebrew/test/cxxstdlib_spec.rb index 4b2091b3b140ce3b97ffcac374b6f17c9230d4d6..2c11a9a1201d6ab6629fc5e41383ab7cf3f075b8 100644 --- a/Library/Homebrew/test/cxxstdlib_spec.rb +++ b/Library/Homebrew/test/cxxstdlib_spec.rb @@ -4,10 +4,9 @@ require "cxxstdlib" describe CxxStdlib do let(:clang) { described_class.create(:libstdcxx, :clang) } let(:gcc) { described_class.create(:libstdcxx, :gcc) } - let(:gcc40) { described_class.create(:libstdcxx, :gcc_4_0) } let(:gcc42) { described_class.create(:libstdcxx, :gcc_4_2) } - let(:gcc48) { described_class.create(:libstdcxx, "gcc-4.8") } - let(:gcc49) { described_class.create(:libstdcxx, "gcc-4.9") } + let(:gcc6) { described_class.create(:libstdcxx, "gcc-6") } + let(:gcc7) { described_class.create(:libstdcxx, "gcc-7") } let(:lcxx) { described_class.create(:libcxx, :clang) } let(:purec) { described_class.create(nil, :clang) } @@ -19,18 +18,18 @@ describe CxxStdlib do specify "compatibility with itself" do expect(gcc).to be_compatible_with(gcc) - expect(gcc48).to be_compatible_with(gcc48) + expect(gcc7).to be_compatible_with(gcc7) expect(clang).to be_compatible_with(clang) end specify "Apple/GNU libstdcxx incompatibility" do - expect(clang).not_to be_compatible_with(gcc48) - expect(gcc48).not_to be_compatible_with(clang) + expect(clang).not_to be_compatible_with(gcc7) + expect(gcc7).not_to be_compatible_with(clang) end specify "GNU cross-version incompatibility" do - expect(gcc48).not_to be_compatible_with(gcc49) - expect(gcc49).not_to be_compatible_with(gcc48) + expect(gcc6).not_to be_compatible_with(gcc7) + expect(gcc7).not_to be_compatible_with(gcc6) end specify "libstdcxx and libcxx incompatibility" do @@ -42,8 +41,8 @@ describe CxxStdlib do expect(purec).to be_compatible_with(clang) expect(clang).to be_compatible_with(purec) expect(purec).to be_compatible_with(purec) - expect(purec).to be_compatible_with(gcc48) - expect(gcc48).to be_compatible_with(purec) + expect(purec).to be_compatible_with(gcc7) + expect(gcc7).to be_compatible_with(purec) end end @@ -55,7 +54,7 @@ describe CxxStdlib do end it "returns false for non-Apple compilers" do - expect(gcc48).not_to be_an_apple_compiler + expect(gcc7).not_to be_an_apple_compiler end end diff --git a/Library/Homebrew/test/dependency_collector_spec.rb b/Library/Homebrew/test/dependency_collector_spec.rb index 09eba5318eb1ac6282651580cf5f36fb8abaf5e2..b921286a943a8237df6b00c1f4acf565129ddd18 100644 --- a/Library/Homebrew/test/dependency_collector_spec.rb +++ b/Library/Homebrew/test/dependency_collector_spec.rb @@ -49,23 +49,11 @@ describe DependencyCollector do expect(find_requirement(X11Requirement).tags).to be_empty end - specify "x11 with (ignored) minimum version" do - subject.add x11: "2.5.1" - expect(find_requirement(X11Requirement).min_version.to_s).not_to eq("2.5.1") - end - specify "x11 with tag" do subject.add x11: :optional expect(find_requirement(X11Requirement)).to be_optional end - specify "x11 with (ignored) minimum version and tag" do - subject.add x11: ["2.5.1", :optional] - dep = find_requirement(X11Requirement) - expect(dep.min_version.to_s).not_to eq("2.5.1") - expect(dep).to be_optional - end - it "doesn't mutate the dependency spec" do spec = { "foo" => :optional } copy = spec.dup diff --git a/Library/Homebrew/test/download_strategies_spec.rb b/Library/Homebrew/test/download_strategies_spec.rb index 126ded85d5414e83ae4c7a81c9d1657f5de6c2b5..21df40c50d06f11d05e3aab09ec7e586a22549cb 100644 --- a/Library/Homebrew/test/download_strategies_spec.rb +++ b/Library/Homebrew/test/download_strategies_spec.rb @@ -46,81 +46,6 @@ describe VCSDownloadStrategy do end end -describe "GitHubPrivateRepositoryDownloadStrategy", :needs_compat do - subject { GitHubPrivateRepositoryDownloadStrategy.new(url, "foo", version) } - - let(:url) { "https://github.com/owner/repo/archive/1.1.5.tar.gz" } - let(:version) { nil } - - before do - ENV["HOMEBREW_GITHUB_API_TOKEN"] = "token" - allow(GitHub).to receive(:repository).and_return({}) - end - - it "sets the @github_token instance variable" do - expect(subject.instance_variable_get(:@github_token)).to eq("token") - end - - it "parses the URL and sets the corresponding instance variables" do - expect(subject.instance_variable_get(:@owner)).to eq("owner") - expect(subject.instance_variable_get(:@repo)).to eq("repo") - expect(subject.instance_variable_get(:@filepath)).to eq("archive/1.1.5.tar.gz") - end - - its(:download_url) { is_expected.to eq("https://token@github.com/owner/repo/archive/1.1.5.tar.gz") } -end - -describe "GitHubPrivateRepositoryReleaseDownloadStrategy", :needs_compat do - subject { GitHubPrivateRepositoryReleaseDownloadStrategy.new(url, "foo", version) } - - let(:url) { "https://github.com/owner/repo/releases/download/tag/foo_v0.1.0_darwin_amd64.tar.gz" } - let(:version) { nil } - - before do - ENV["HOMEBREW_GITHUB_API_TOKEN"] = "token" - allow(GitHub).to receive(:repository).and_return({}) - end - - it "parses the URL and sets the corresponding instance variables" do - expect(subject.instance_variable_get(:@owner)).to eq("owner") - expect(subject.instance_variable_get(:@repo)).to eq("repo") - expect(subject.instance_variable_get(:@tag)).to eq("tag") - expect(subject.instance_variable_get(:@filename)).to eq("foo_v0.1.0_darwin_amd64.tar.gz") - end - - describe "#download_url" do - it "returns the download URL for a given resource" do - allow(subject).to receive(:resolve_asset_id).and_return(456) - expect(subject.download_url).to eq("https://token@api.github.com/repos/owner/repo/releases/assets/456") - end - end - - specify "#resolve_asset_id" do - release_metadata = { - "assets" => [ - { - "id" => 123, - "name" => "foo_v0.1.0_linux_amd64.tar.gz", - }, - { - "id" => 456, - "name" => "foo_v0.1.0_darwin_amd64.tar.gz", - }, - ], - } - allow(subject).to receive(:fetch_release_metadata).and_return(release_metadata) - expect(subject.send(:resolve_asset_id)).to eq(456) - end - - describe "#fetch_release_metadata" do - it "fetches release metadata from GitHub" do - expected_release_url = "https://api.github.com/repos/owner/repo/releases/tags/tag" - expect(GitHub).to receive(:open_api).with(expected_release_url).and_return({}) - subject.send(:fetch_release_metadata) - end - end -end - describe GitHubGitDownloadStrategy do subject { described_class.new(url, name, version) } @@ -200,24 +125,6 @@ describe GitDownloadStrategy do end end -describe "S3DownloadStrategy", :needs_compat do - subject { S3DownloadStrategy.new(url, name, version) } - - let(:name) { "foo" } - let(:url) { "https://bucket.s3.amazonaws.com/foo.tar.gz" } - let(:version) { nil } - - describe "#fetch" do - context "when given Bad S3 URL" do - let(:url) { "https://example.com/foo.tar.gz" } - - it "raises Bad S3 URL error" do - expect { subject.fetch }.to raise_error(RuntimeError, /S3/) - end - end - end -end - describe CurlDownloadStrategy do subject { described_class.new(url, name, version, **specs) } @@ -427,91 +334,6 @@ describe CurlPostDownloadStrategy do end end -describe "ScpDownloadStrategy", :needs_compat do - subject { ScpDownloadStrategy.new(url, name, version) } - - let(:name) { "foo" } - let(:url) { "scp://example.com/foo.tar.gz" } - let(:version) { nil } - - describe "#initialize" do - invalid_urls = %w[ - https://example.com/foo.tar.gz - scp://@example.com/foo.tar.gz - scp://example.com:/foo.tar.gz - scp://example.com - ] - - invalid_urls.each do |invalid_url| - context "with invalid URL #{invalid_url}" do - let(:url) { invalid_url } - - it "raises ScpDownloadStrategyError" do - expect { subject }.to raise_error(ScpDownloadStrategyError) - end - end - end - end - - describe "#fetch" do - before do - expect(subject.temporary_path).to receive(:rename).and_return(true) - end - - context "when given a valid URL" do - let(:url) { "scp://example.com/foo.tar.gz" } - - it "copies the file via scp" do - expect(subject) - .to receive(:system_command!) - .with("scp", args: ["example.com:/foo.tar.gz", anything]) - .and_return(true) - - subject.fetch - end - end - - context "when given a URL with a username" do - let(:url) { "scp://user@example.com/foo.tar.gz" } - - it "copies the file via scp" do - expect(subject) - .to receive(:system_command!) - .with("scp", args: ["user@example.com:/foo.tar.gz", anything]) - .and_return(true) - - subject.fetch - end - end - - context "when given a URL with a port" do - let(:url) { "scp://example.com:1234/foo.tar.gz" } - - it "copies the file via scp" do - expect(subject) - .to receive(:system_command!) - .with("scp", args: ["-P 1234 example.com:/foo.tar.gz", anything]) - .and_return(true) - - subject.fetch - end - end - - context "when given a URL with /~/" do - let(:url) { "scp://example.com/~/foo.tar.gz" } - - it "treats the path as relative to the home directory" do - expect(subject) - .to receive(:system_command!) - .with("scp", args: ["example.com:~/foo.tar.gz", anything]) - .and_return(true) - - subject.fetch - end - end - end -end - describe SubversionDownloadStrategy do subject { described_class.new(url, name, version, **specs) } @@ -565,31 +387,6 @@ describe DownloadStrategyDetector do it { is_expected.to eq(GitHubGitDownloadStrategy) } end - context "when given an S3 URL", :needs_compat do - let(:url) { "s3://bucket/homebrew/brew.tar.gz" } - - it "returns S3DownloadStrategy" do - allow(described_class).to receive(:require_aws_sdk).and_return(true) - expect(subject).to eq(S3DownloadStrategy) - end - end - - context "when given strategy = S3DownloadStrategy", :needs_compat do - let(:url) { "https://bkt.s3.amazonaws.com/key.tar.gz" } - let(:strategy) { S3DownloadStrategy } - - it "requires aws-sdk-s3" do - allow(described_class).to receive(:require_aws_sdk).and_return(true) - expect(subject).to eq(S3DownloadStrategy) - end - end - - context "when given an scp URL", :needs_compat do - let(:url) { "scp://example.com/brew.tar.gz" } - - it { is_expected.to eq(ScpDownloadStrategy) } - end - it "defaults to cURL" do expect(subject).to eq(CurlDownloadStrategy) end diff --git a/Library/Homebrew/test/os/mac/dependency_collector_spec.rb b/Library/Homebrew/test/os/mac/dependency_collector_spec.rb index 507a35336da4bccdcd38d1b40d5c825118c66424..d492cd24d8a99e0627e9fa3a312a32a60e069e89 100644 --- a/Library/Homebrew/test/os/mac/dependency_collector_spec.rb +++ b/Library/Homebrew/test/os/mac/dependency_collector_spec.rb @@ -12,16 +12,6 @@ describe DependencyCollector do expect(described_class).not_to need_tar_xz_dependency end - specify "LD64 pre-Leopard dependency" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.4")) - expect(subject.build(:ld64)).to eq(LD64Dependency.new) - end - - specify "LD64 Leopard or newer dependency" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.5")) - expect(subject.build(:ld64)).to be nil - end - specify "Resource xz pre-Mavericks dependency" do allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.8")) resource = Resource.new diff --git a/Library/Homebrew/test/requirements_spec.rb b/Library/Homebrew/test/requirements_spec.rb index a4c9af3ad9b40677573ce2b152a22ca227f2fe4e..7ad7cb7f32d201847d438a502759a87640798bff 100644 --- a/Library/Homebrew/test/requirements_spec.rb +++ b/Library/Homebrew/test/requirements_spec.rb @@ -12,15 +12,5 @@ describe Requirements do subject << Requirement.new expect(subject.count).to eq(2) end - - it "prefers the larger requirement when merging duplicates" do - subject << X11Requirement.new << X11Requirement.new(%w[2.6]) - expect(subject.to_a).to eq([X11Requirement.new(%w[2.6])]) - end - - it "does not use the smaller requirement when merging duplicates" do - subject << X11Requirement.new(%w[2.6]) << X11Requirement.new - expect(subject.to_a).to eq([X11Requirement.new(%w[2.6])]) - end end end diff --git a/Library/Homebrew/test/rubocops/lines_spec.rb b/Library/Homebrew/test/rubocops/lines_spec.rb index 9c90797e618faaf837dcc9fc0c1feb9ab9381dd8..5e7aa067f4539707f9e467f9d437a1d14558b0fc 100644 --- a/Library/Homebrew/test/rubocops/lines_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_spec.rb @@ -451,16 +451,6 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do RUBY end - it "ruby-macho alternatives audit exempted formula" do - expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/cctools.rb") - class Cctools < Formula - desc "foo" - url 'https://brew.sh/foo-1.0.tgz' - system "install_name_tool", "-id" - end - RUBY - end - it "npm install without language::Node args" do expect_offense(<<~RUBY) class Foo < Formula diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.intel_macintosh.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.intel_macintosh.bottle.tar.gz new file mode 120000 index 0000000000000000000000000000000000000000..58afc4df06350235be15f2825754ca37d1380700 --- /dev/null +++ b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.intel_macintosh.bottle.tar.gz @@ -0,0 +1 @@ +/usr/local/Homebrew/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz deleted file mode 120000 index 3e989830ba206a71ed27fa3c95f713ea341e1daf..0000000000000000000000000000000000000000 --- a/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz +++ /dev/null @@ -1 +0,0 @@ -testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-array.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-array.rb index 69b8fef6caee0d7dc3ebc45d5e260b0ca1e04980..8e54f7281785e7e2f6e75464f58b24c7ce028cad 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-array.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-array.rb @@ -6,7 +6,7 @@ cask 'with-depends-on-macos-array' do homepage 'https://brew.sh/with-depends-on-macos-array' # since all OS releases are included, this should always pass - depends_on macos: ['10.4', '10.5', '10.6', '10.7', '10.8', '10.9', '10.10', MacOS.version.to_s] + depends_on macos: ['10.5', '10.6', '10.7', '10.8', '10.9', '10.10', MacOS.version.to_s] app 'Caffeine.app' end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-comparison.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-comparison.rb index d34691d9631edd08ccd95a2e103379c719382830..72301e09cdd393afdbc6453d7d2efd793a814246 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-comparison.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-comparison.rb @@ -5,7 +5,7 @@ cask 'with-depends-on-macos-comparison' do url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage 'https://brew.sh/with-depends-on-macos-comparison' - depends_on macos: '>= 10.4' + depends_on macos: '>= 10.5' app 'Caffeine.app' end diff --git a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb index 53fde04775887610427fa63954426ce7f39975d9..67db1b29f8138bcd4786705e6ed93d3fe95a0999 100644 --- a/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb +++ b/Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-failure.rb @@ -6,7 +6,7 @@ cask 'with-depends-on-macos-failure' do homepage 'https://brew.sh/with-depends-on-macos-failure' # guarantee a mismatched release - depends_on macos: MacOS.version.to_s == '10.4' ? '10.5' : '10.4' + depends_on macos: MacOS.version.to_s == '10.5' ? '10.6' : '10.5' app 'Caffeine.app' end diff --git a/Library/Homebrew/test/update_migrator_spec.rb b/Library/Homebrew/test/update_migrator_spec.rb deleted file mode 100644 index 74c4de48e54ccb9494c89536eb5465a8569c53f3..0000000000000000000000000000000000000000 --- a/Library/Homebrew/test/update_migrator_spec.rb +++ /dev/null @@ -1,86 +0,0 @@ -require "update_migrator" - -describe UpdateMigrator do - describe "::migrate_cache_entries_to_double_dashes" do - let(:formula_name) { "foo" } - let(:f) { - formula formula_name do - url "https://brew.sh/foo-1.2.3.tar.gz" - version "1.2.3" - end - } - let(:old_cache_file) { HOMEBREW_CACHE/"#{formula_name}-1.2.3.tar.gz" } - let(:new_cache_file) { HOMEBREW_CACHE/"#{formula_name}--1.2.3.tar.gz" } - - before do - FileUtils.touch old_cache_file - allow(Formula).to receive(:each).and_yield(f) - end - - it "moves old files to use double dashes when upgrading from <= 1.7.1" do - described_class.migrate_cache_entries_to_double_dashes(Version.new("1.7.1")) - - expect(old_cache_file).not_to exist - expect(new_cache_file).to exist - end - - context "when the formula name contains dashes" do - let(:formula_name) { "foo-bar" } - - it "does not introduce extra double dashes when called multiple times" do - described_class.migrate_cache_entries_to_double_dashes(Version.new("1.7.1")) - described_class.migrate_cache_entries_to_double_dashes(Version.new("1.7.1")) - - expect(old_cache_file).not_to exist - expect(new_cache_file).to exist - end - end - - it "does not move files if upgrading from > 1.7.1" do - described_class.migrate_cache_entries_to_double_dashes(Version.new("1.7.2")) - - expect(old_cache_file).to exist - expect(new_cache_file).not_to exist - end - end - - describe "::migrate_cache_entries_to_symlinks" do - let(:formula_name) { "foo" } - let(:f) { - formula formula_name do - url "https://brew.sh/foo-1.2.3.tar.gz" - version "1.2.3" - end - } - let(:old_cache_file) { HOMEBREW_CACHE/"#{formula_name}--1.2.3.tar.gz" } - let(:new_cache_symlink) { HOMEBREW_CACHE/"#{formula_name}--1.2.3.tar.gz" } - let(:new_cache_file) { - HOMEBREW_CACHE/"downloads/4a81b0e17a7540b7afe1685671a0a126645117e6c0bc6c66f5ad13b7a5912f80--foo-1.2.3.tar.gz" - } - - before do - old_cache_file.dirname.mkpath - FileUtils.touch old_cache_file - allow(Formula).to receive(:[]).and_return(f) - end - - it "moves old files to use symlinks when upgrading from <= 1.7.2" do - described_class.migrate_cache_entries_to_symlinks(Version.new("1.7.2")) - - expect(old_cache_file).to eq(new_cache_symlink) - expect(new_cache_symlink).to be_a_symlink - expect(new_cache_symlink.readlink.to_s) - .to eq "downloads/4a81b0e17a7540b7afe1685671a0a126645117e6c0bc6c66f5ad13b7a5912f80--foo-1.2.3.tar.gz" - expect(new_cache_file).to exist - expect(new_cache_file).to be_a_file - end - - it "does not move files if upgrading from > 1.7.2" do - described_class.migrate_cache_entries_to_symlinks(Version.new("1.7.3")) - - expect(old_cache_file).to exist - expect(new_cache_file).not_to exist - expect(new_cache_symlink).not_to be_a_symlink - end - end -end diff --git a/Library/Homebrew/test/utils/bottles/bottles_spec.rb b/Library/Homebrew/test/utils/bottles/bottles_spec.rb index 8b54b0b3449c2f5acb26f51e60cd4567caf426b7..906743e82587d887f05ddcf99824788b77591299 100644 --- a/Library/Homebrew/test/utils/bottles/bottles_spec.rb +++ b/Library/Homebrew/test/utils/bottles/bottles_spec.rb @@ -2,65 +2,12 @@ require "utils/bottles" describe Utils::Bottles do describe "#tag", :needs_macos do - it "returns :tiger_foo on Tiger PowerPC" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.4")) - allow(Hardware::CPU).to receive(:type).and_return(:ppc) - allow(Hardware::CPU).to receive(:family).and_return(:foo) - allow(MacOS).to receive(:prefer_64_bit?).and_return(false) - expect(described_class.tag).to eq(:tiger_foo) - end - - it "returns :tiger on Tiger Intel" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.4")) - allow(Hardware::CPU).to receive(:type).and_return(:intel) - allow(MacOS).to receive(:prefer_64_bit?).and_return(false) - expect(described_class.tag).to eq(:tiger) - end - - it "returns :tiger_g5_64 on Tiger PowerPC 64-bit" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.4")) - allow(Hardware::CPU).to receive(:type).and_return(:ppc) - allow(Hardware::CPU).to receive(:family).and_return(:g5) - allow(MacOS).to receive(:prefer_64_bit?).and_return(true) - expect(described_class.tag).to eq(:tiger_g5_64) - end - - # Note that this will probably never be used - it "returns :tiger_64 on Tiger Intel 64-bit" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.4")) - allow(Hardware::CPU).to receive(:type).and_return(:intel) - allow(MacOS).to receive(:prefer_64_bit?).and_return(true) - expect(described_class.tag).to eq(:tiger_64) - end - - it "returns :leopard on Leopard Intel" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.5")) - allow(Hardware::CPU).to receive(:type).and_return(:intel) - allow(MacOS).to receive(:prefer_64_bit?).and_return(false) - expect(described_class.tag).to eq(:leopard) - end - - it "returns :leopard_g5_64 on Leopard PowerPC 64-bit" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.5")) - allow(Hardware::CPU).to receive(:type).and_return(:ppc) - allow(Hardware::CPU).to receive(:family).and_return(:g5) - allow(MacOS).to receive(:prefer_64_bit?).and_return(true) - expect(described_class.tag).to eq(:leopard_g5_64) - end - it "returns :leopard_64 on Leopard Intel 64-bit" do allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.5")) allow(Hardware::CPU).to receive(:type).and_return(:intel) - allow(MacOS).to receive(:prefer_64_bit?).and_return(true) expect(described_class.tag).to eq(:leopard_64) end - it "returns :snow_leopard_32 on Snow Leopard 32-bit" do - allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.6")) - allow(Hardware::CPU).to receive(:is_64_bit?).and_return(false) - expect(described_class.tag).to eq(:snow_leopard_32) - end - it "returns :snow_leopard on Snow Leopard 64-bit" do allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.6")) allow(Hardware::CPU).to receive(:is_64_bit?).and_return(true) diff --git a/Library/Homebrew/test/utils/bottles/collector_spec.rb b/Library/Homebrew/test/utils/bottles/collector_spec.rb index 08484e5455c6ec86022ca013bd40ccc052f8490c..3eefdec40c4d070b5df4eafba6e89382781e40d6 100644 --- a/Library/Homebrew/test/utils/bottles/collector_spec.rb +++ b/Library/Homebrew/test/utils/bottles/collector_spec.rb @@ -17,29 +17,10 @@ describe Utils::Bottles::Collector do expect(subject.fetch_checksum_for(:foo)).to be nil end - it "returns nil when there is no match and later tag is present" do - subject[:lion_or_later] = "foo" - expect(subject.fetch_checksum_for(:foo)).to be nil - end - - it "prefers exact matches" do - subject[:lion_or_later] = "foo" - subject[:mountain_lion] = "bar" - expect(subject.fetch_checksum_for(:mountain_lion)).to eq(["bar", :mountain_lion]) - end - - it "finds '_or_later' tags", :needs_macos do - subject[:lion_or_later] = "foo" - expect(subject.fetch_checksum_for(:mountain_lion)).to eq(["foo", :lion_or_later]) + it "uses older tags when needed", :needs_macos do + subject[:lion] = "foo" + expect(subject.fetch_checksum_for(:mountain_lion)).to eq(["foo", :lion]) expect(subject.fetch_checksum_for(:snow_leopard)).to be nil end - - it "finds '_altivec' tags", :needs_macos do - subject[:tiger_altivec] = "foo" - expect(subject.fetch_checksum_for(:tiger_g4)).to eq(["foo", :tiger_altivec]) - expect(subject.fetch_checksum_for(:tiger_g4e)).to eq(["foo", :tiger_altivec]) - expect(subject.fetch_checksum_for(:tiger_g5)).to eq(["foo", :tiger_altivec]) - expect(subject.fetch_checksum_for(:tiger_g3)).to be nil - end end end diff --git a/Library/Homebrew/update_migrator.rb b/Library/Homebrew/update_migrator.rb deleted file mode 100644 index 467df09d59d7492c93d9df7c1cf005504795958e..0000000000000000000000000000000000000000 --- a/Library/Homebrew/update_migrator.rb +++ /dev/null @@ -1,384 +0,0 @@ -require "cask/cask_loader" -require "cask/download" - -module UpdateMigrator - class << self - def formula_resources(formula) - specs = [formula.stable, formula.devel, formula.head].compact - - [*formula.bottle&.resource] + specs.flat_map do |spec| - [ - spec, - *spec.resources.values, - *spec.patches.select(&:external?).map(&:resource), - ] - end - end - private :formula_resources - - def parse_extname(url) - uri_path = if URI::DEFAULT_PARSER.make_regexp =~ url - uri = URI(url) - uri.query ? "#{uri.path}?#{uri.query}" : uri.path - else - url - end - - # Given a URL like https://example.com/download.php?file=foo-1.0.tar.gz - # the extension we want is ".tar.gz", not ".php". - Pathname.new(uri_path).ascend do |path| - ext = path.extname[/[^?&]+/] - return ext if ext - end - - nil - end - private :parse_extname - - def migrate_cache_entries_to_double_dashes(initial_version) - return if initial_version && initial_version > "1.7.1" - - return if ENV.key?("HOMEBREW_DISABLE_LOAD_FORMULA") - - return unless HOMEBREW_CACHE.directory? - return if HOMEBREW_CACHE.children.empty? - - ohai "Migrating cache entries..." - - Formula.each do |formula| - formula_resources(formula).each do |resource| - downloader = resource.downloader - - url = downloader.url - name = resource.download_name - version = resource.version - - extname = parse_extname(url) - old_location = downloader.cache/"#{name}-#{version}#{extname}" - new_location = downloader.cache/"#{name}--#{version}#{extname}" - - next unless old_location.file? - - if new_location.exist? - begin - FileUtils.rm_rf old_location - rescue Errno::EACCES - opoo "Could not remove #{old_location}, please do so manually." - end - else - begin - FileUtils.mv old_location, new_location - rescue Errno::EACCES - opoo "Could not move #{old_location} to #{new_location}, please do so manually." - end - end - end - end - end - - def migrate_cache_entries_to_symlinks(initial_version) - return if initial_version && initial_version > "1.7.2" - - return if ENV.key?("HOMEBREW_DISABLE_LOAD_FORMULA") - - return unless HOMEBREW_CACHE.directory? - return if HOMEBREW_CACHE.children.empty? - - ohai "Migrating cache entries..." - - cache_entries = lambda do |path| - if path.directory? - path.children - .reject(&:symlink?) - .select(&:file?) - .map { |child| child.basename.to_s } - .select { |basename| basename.include?("--") } - .map { |basename| basename.sub(/\-\-.*/, "") } - .uniq - else - [] - end - end - - load_formula = lambda do |formula| - begin - Formula[formula] - rescue FormulaUnavailableError - nil - end - end - - load_cask = lambda do |cask| - begin - Cask::CaskLoader.load(cask) - rescue Cask::CaskUnavailableError - nil - end - end - - formula_downloaders = - cache_entries.call(HOMEBREW_CACHE) - .map(&load_formula) - .compact - .flat_map { |formula| formula_resources(formula) } - .map { |resource| [resource.downloader, resource.download_name, resource.version] } - - cask_downloaders = - cache_entries.call(HOMEBREW_CACHE/"Cask") - .map(&load_cask) - .compact - .map { |cask| [Cask::Download.new(cask).downloader, cask.token, cask.version] } - - downloaders = formula_downloaders + cask_downloaders - - downloaders.each do |downloader, name, version| - next unless downloader.respond_to?(:symlink_location) - - url = downloader.url - extname = parse_extname(url) - old_location = downloader.cache/"#{name}--#{version}#{extname}" - next unless old_location.file? - - new_symlink_location = downloader.symlink_location - new_location = downloader.cached_location - - if new_location.exist? && new_symlink_location.symlink? - begin - FileUtils.rm_rf old_location unless old_location == new_symlink_location - rescue Errno::EACCES - opoo "Could not remove #{old_location}, please do so manually." - end - else - begin - new_location.dirname.mkpath - if new_location.exist? - FileUtils.rm_rf old_location - else - FileUtils.mv old_location, new_location - end - symlink_target = new_location.relative_path_from(new_symlink_location.dirname) - new_symlink_location.dirname.mkpath - FileUtils.ln_s symlink_target, new_symlink_location, force: true - rescue Errno::EACCES - opoo "Could not move #{old_location} to #{new_location}, please do so manually." - end - end - end - end - - def migrate_legacy_cache_if_necessary - legacy_cache = Pathname.new "/Library/Caches/Homebrew" - return if HOMEBREW_CACHE.to_s == legacy_cache.to_s - return unless legacy_cache.directory? - return unless legacy_cache.readable_real? - - migration_attempted_file = legacy_cache/".migration_attempted" - return if migration_attempted_file.exist? - - return unless legacy_cache.writable_real? - - FileUtils.touch migration_attempted_file - - # This directory could have been compromised if it's world-writable/ - # a symlink/owned by another user so don't copy files in those cases. - world_writable = legacy_cache.stat.mode & 0777 == 0777 - return if world_writable - return if legacy_cache.symlink? - return if !legacy_cache.owned? && legacy_cache.lstat.uid.nonzero? - - ohai "Migrating #{legacy_cache} to #{HOMEBREW_CACHE}..." - HOMEBREW_CACHE.mkpath - legacy_cache.cd do - legacy_cache.entries.each do |f| - next if [".", "..", ".migration_attempted"].include? f.to_s - - begin - FileUtils.cp_r f, HOMEBREW_CACHE - rescue - @migration_failed ||= true - end - end - end - - if @migration_failed - opoo <<~EOS - Failed to migrate #{legacy_cache} to - #{HOMEBREW_CACHE}. Please do so manually. - EOS - else - ohai "Deleting #{legacy_cache}..." - FileUtils.rm_rf legacy_cache - if legacy_cache.exist? - FileUtils.touch migration_attempted_file - opoo <<~EOS - Failed to delete #{legacy_cache}. - Please do so manually. - EOS - end - end - end - - def migrate_legacy_keg_symlinks_if_necessary - legacy_linked_kegs = HOMEBREW_LIBRARY/"LinkedKegs" - return unless legacy_linked_kegs.directory? - - HOMEBREW_LINKED_KEGS.mkpath unless legacy_linked_kegs.children.empty? - legacy_linked_kegs.children.each do |link| - name = link.basename.to_s - src = begin - link.realpath - rescue Errno::ENOENT - begin - (HOMEBREW_PREFIX/"opt/#{name}").realpath - rescue Errno::ENOENT - begin - Formulary.factory(name).installed_prefix - rescue - next - end - end - end - dst = HOMEBREW_LINKED_KEGS/name - dst.unlink if dst.exist? - FileUtils.ln_sf(src.relative_path_from(dst.parent), dst) - end - FileUtils.rm_rf legacy_linked_kegs - - legacy_pinned_kegs = HOMEBREW_LIBRARY/"PinnedKegs" - return unless legacy_pinned_kegs.directory? - - HOMEBREW_PINNED_KEGS.mkpath unless legacy_pinned_kegs.children.empty? - legacy_pinned_kegs.children.each do |link| - name = link.basename.to_s - src = link.realpath - dst = HOMEBREW_PINNED_KEGS/name - FileUtils.ln_sf(src.relative_path_from(dst.parent), dst) - end - FileUtils.rm_rf legacy_pinned_kegs - end - - def migrate_legacy_repository_if_necessary - return unless Homebrew.default_prefix? - return unless Homebrew.default_prefix?(HOMEBREW_REPOSITORY) - - ohai "Migrating HOMEBREW_REPOSITORY (please wait)..." - - unless HOMEBREW_PREFIX.writable_real? - ofail <<~EOS - #{HOMEBREW_PREFIX} is not writable. - - You should change the ownership and permissions of #{HOMEBREW_PREFIX} - temporarily back to your user account so we can complete the Homebrew - repository migration: - sudo chown -R $(whoami) #{HOMEBREW_PREFIX} - EOS - return - end - - new_homebrew_repository = Pathname.new "#{HOMEBREW_PREFIX}/Homebrew" - new_homebrew_repository.rmdir_if_possible - if new_homebrew_repository.exist? - ofail <<~EOS - #{new_homebrew_repository} already exists. - Please remove it manually or uninstall and reinstall Homebrew into a new - location as the migration cannot be done automatically. - EOS - return - end - new_homebrew_repository.mkpath - - repo_files = HOMEBREW_REPOSITORY.cd do - Utils.popen_read("git ls-files").lines.map(&:chomp) - end - - unless Utils.popen_read("git status --untracked-files=all --porcelain").empty? - HOMEBREW_REPOSITORY.cd do - quiet_system "git", "merge", "--abort" - quiet_system "git", "rebase", "--abort" - quiet_system "git", "reset", "--mixed" - safe_system "git", "-c", "user.email=brew-update@localhost", - "-c", "user.name=brew update", - "stash", "save", "--include-untracked" - end - stashed = true - end - - FileUtils.cp_r "#{HOMEBREW_REPOSITORY}/.git", "#{new_homebrew_repository}/.git" - new_homebrew_repository.cd do - safe_system "git", "checkout", "--force", "." - safe_system "git", "stash", "pop" if stashed - end - - if (HOMEBREW_REPOSITORY/"Library/Locks").exist? - FileUtils.cp_r "#{HOMEBREW_REPOSITORY}/Library/Locks", "#{new_homebrew_repository}/Library/Locks" - end - - if (HOMEBREW_REPOSITORY/"Library/Taps").exist? - FileUtils.cp_r "#{HOMEBREW_REPOSITORY}/Library/Taps", "#{new_homebrew_repository}/Library/Taps" - end - - unremovable_paths = [] - extra_remove_paths = [ - ".git", - "Library/Locks", - "Library/Taps", - "Library/Homebrew/cask", - "Library/Homebrew/test", - ] - (repo_files + extra_remove_paths).each do |file| - path = Pathname.new "#{HOMEBREW_REPOSITORY}/#{file}" - begin - FileUtils.rm_rf path - rescue Errno::EACCES - unremovable_paths << path - end - quiet_system "rmdir", "-p", path.parent if path.parent.exist? - end - - unless unremovable_paths.empty? - ofail <<~EOS - Could not remove old HOMEBREW_REPOSITORY paths! - Please do this manually with: - sudo rm -rf #{unremovable_paths.join " "} - EOS - end - - Keg::MUST_EXIST_DIRECTORIES.each { |dir| FileUtils.mkdir_p dir } - - src = Pathname.new("#{new_homebrew_repository}/bin/brew") - dst = Pathname.new("#{HOMEBREW_PREFIX}/bin/brew") - begin - FileUtils.ln_s(src.relative_path_from(dst.parent), dst) - rescue Errno::EACCES, Errno::ENOENT - ofail <<~EOS - Could not create symlink at #{dst}! - Please do this manually with: - sudo ln -sf #{src} #{dst} - sudo chown $(whoami) #{dst} - EOS - end - - link_completions_manpages_and_docs(new_homebrew_repository) - - ohai "Migrated HOMEBREW_REPOSITORY to #{new_homebrew_repository}!" - if HOMEBREW_PREFIX == "/usr/local" - puts <<~EOS - Homebrew no longer needs to have ownership of #{HOMEBREW_PREFIX}. If you wish you can - return #{HOMEBREW_PREFIX} to its default ownership with: - sudo chown root:wheel #{HOMEBREW_PREFIX} - EOS - end - rescue => e - ofail <<~EOS - #{Tty.bold}Failed to migrate HOMEBREW_REPOSITORY to #{new_homebrew_repository}!#{Tty.reset} - The error was: - #{e} - Please try to resolve this error yourself and then run `brew update` again to - complete the migration. If you need help please +1 an existing error or comment - with your new error in issue: - #{Formatter.url("https://github.com/Homebrew/brew/issues/987")} - EOS - $stderr.puts e.backtrace - end - end -end diff --git a/docs/C++-Standard-Libraries.md b/docs/C++-Standard-Libraries.md index 9cf2e1fad7a09585830e1fcdc151915a9e82a50d..2eaa89050cf7b0074130b30fd6245fde758405f9 100644 --- a/docs/C++-Standard-Libraries.md +++ b/docs/C++-Standard-Libraries.md @@ -20,9 +20,9 @@ dependencies that you built on 10.8 or earlier. If you're reading this page beca you were directed here by a build error, you can most likely fix the issue if you reinstall all the dependencies of the package you're trying to build. -Example install using GCC 4.8: +Example install using GCC 7: ```sh -brew install gcc48 -brew install --cc=gcc-4.8 <formula> +brew install gcc@7 +brew install --cc=gcc-7 <formula> ``` diff --git a/docs/Custom-GCC-and-cross-compilers.md b/docs/Custom-GCC-and-cross-compilers.md index 057d5d3b5fe1f74c6d0eb6e2d0006fab8bc1256a..d46fd18df7e12c85c392d955ed837b97c5347365 100644 --- a/docs/Custom-GCC-and-cross-compilers.md +++ b/docs/Custom-GCC-and-cross-compilers.md @@ -16,7 +16,7 @@ GCC or cross-compiler suite, please link it in here. - Homebrew provides a `gcc` formula for use with Xcode 4.2+ or when needing C++11 support on earlier versions. -- Homebrew provides older GCC formulae, e.g. `gcc@4.9` and `gcc@6`. +- Homebrew provides older GCC formulae, e.g. `gcc@7` - Homebrew provides the LLVM Clang, which is bundled with the `llvm` formula. - [RISC-V](https://github.com/riscv/homebrew-riscv) provides the RISC-V toolchain including binutils and GCC. diff --git a/docs/Installation.md b/docs/Installation.md index 2434f0a7735d1ecbe81e580d8ca98a28130b9e00..5e4b64c94cc7c8a793329919dbbbc9cb1eeb6ec5 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -10,7 +10,7 @@ installed to `/usr/local` already. It tells you exactly what it will do before it does it too. And you have to confirm everything it will do before it starts. ## Requirements -* An Intel CPU <sup>[1](#1)</sup> +* An 64-bit Intel CPU <sup>[1](#1)</sup> * macOS 10.12 or higher <sup>[2](#2)</sup> * Command Line Tools (CLT) for Xcode: `xcode-select --install`, [developer.apple.com/downloads](https://developer.apple.com/downloads) or @@ -20,9 +20,7 @@ it does it too. And you have to confirm everything it will do before it starts. ## Alternative Installs ### OS X Mountain Lion (10.8) and below -Because GitHub now only allows clients that support TLS 1.2 to access repositories over HTTPS, the Homebrew installer will use the GIT protocol when run on systems older than OS X Mavericks (10.9). This requires the availability of a `git` binary, which can be provided by pre-installing the [Command Line Tools or Xcode](https://developer.apple.com/download/more/) on Lion or Mountain Lion, or a [prepackaged installer](https://code.google.com/archive/p/git-osx-installer/downloads) on Leopard or Snow Leopard. Homebrew will also require the Command Line Tools or Xcode in order to automatically compile and install a newer `curl` and `git` with support for TLS 1.2. - -Also note that when installing on OS X Leopard (10.5), you need to bypass its outdated built-in certificates by adding `--insecure` to the [installation command](https://brew.sh/#install)'s list of `curl` flags. +Because GitHub now only allows clients that support TLS 1.2 to access repositories over HTTPS, the Homebrew installer will use the Git protocol when run on systems older than OS X Mavericks (10.9). This requires the availability of a `git` binary, which can be provided by pre-installing the [Command Line Tools for Xcode](https://developer.apple.com/download/more/). Homebrew will also require the Command Line Tools or Xcode in order to automatically compile and install a newer `curl` and `git` with support for TLS 1.2. ### Untar anywhere Just extract (or `git clone`) Homebrew wherever you want. Just avoid: @@ -31,7 +29,7 @@ Just extract (or `git clone`) Homebrew wherever you want. Just avoid: * `/tmp` subdirectories because Homebrew gets upset. * `/sw` and `/opt/local` because build scripts get confused when Homebrew is there instead of Fink or MacPorts, respectively. -However do yourself a favor and install to `/usr/local`. Some things may +However do yourself a favour and install to `/usr/local`. Some things may not build when installed elsewhere. One of the reasons Homebrew just works relative to the competition is **because** we recommend installing to `/usr/local`. *Pick another prefix at your peril!* @@ -46,13 +44,11 @@ Create a Homebrew installation wherever you extract the tarball. Whichever `brew ## Uninstallation Uninstallation is documented in the [FAQ](FAQ.md). -<a name="1"><sup>1</sup></a> Not all formulae have CPU or OS requirements, but -you can assume you will have trouble if you don鈥檛 conform. Also, you can find -PowerPC and Tiger branches from other users in the fork network. See -[Interesting Taps and Forks](Interesting-Taps-and-Forks.md). +<a name="1"><sup>1</sup></a> For 32-bit or PPC support see +[Tigerbrew](https://github.com/mistydemeo/tigerbrew). -<a name="2"><sup>2</sup></a> 10.12 or higher is recommended. 10.5鈥�10.11 are -supported on a best-effort basis. For 10.4 see +<a name="2"><sup>2</sup></a> 10.12 or higher is recommended. 10.9鈥�10.11 are +supported on a best-effort basis. For 10.4-10.6 see [Tigerbrew](https://github.com/mistydemeo/tigerbrew). <a name="3"><sup>3</sup></a> Most formulae require a compiler. A handful diff --git a/docs/Manpage.md b/docs/Manpage.md index 1dafa94a037179825907896ef3725d3600d8cf12..a72de59480c8b43628dc45e163df7d410e837215 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -259,10 +259,9 @@ these flags should only appear after a command. If `--cc=`*`compiler`* is passed, attempt to compile using *`compiler`*. *`compiler`* should be the name of the compiler's executable, for instance - `gcc-8` for gcc 8, `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a - Homebrew-provided GCC 4.9. In order to use LLVM's clang, use - `llvm_clang`. To specify the Apple-provided clang, use `clang`. This - parameter will only accept compilers that are provided by Homebrew or + `gcc-7` for GCC 7. In order to use LLVM's clang, use `llvm_clang`. + To specify the Apple-provided clang, use `clang`. + This parameter will only accept compilers that are provided by Homebrew or bundled with macOS. Please do not file issues if you encounter errors while using this flag. @@ -1134,12 +1133,6 @@ Note that environment variables must have a value set to be detected. For exampl If set, Homebrew uses this setting as the browser when opening project homepages, instead of the OS default browser. - * `HOMEBREW_BUILD_FROM_SOURCE`: - If set, instructs Homebrew to compile from source even when a formula - provides a bottle. This environment variable is intended for use by - Homebrew developers. Please do not file issues if you encounter errors when - using this environment variable. - * `HOMEBREW_CACHE`: If set, instructs Homebrew to use the specified directory as the download cache. diff --git a/docs/Tips-N'-Tricks.md b/docs/Tips-N'-Tricks.md index d3c1fbc038f6446ad97ed3bd145e37bf3f171bc6..2e29670b7cbe0139f72cfaa265232e3fdec06967 100644 --- a/docs/Tips-N'-Tricks.md +++ b/docs/Tips-N'-Tricks.md @@ -3,7 +3,7 @@ ## Installing previous versions of formulae The supported method of installing specific versions of -some formulae is to see if there is a versioned formula (e.g. `gcc@6`) available. If the version you鈥檙e looking for isn鈥檛 available, consider using `brew extract`. +some formulae is to see if there is a versioned formula (e.g. `gcc@7`) available. If the version you鈥檙e looking for isn鈥檛 available, consider using `brew extract`. ### Installing directly from pull requests You can [browse pull requests](https://github.com/Homebrew/homebrew-core/pulls) diff --git a/manpages/brew.1 b/manpages/brew.1 index c3c194663d36b41ef43aba2d187667cb5a924d33..4316caab076fc83188b5b789aaafccadb3987347 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -270,7 +270,7 @@ If \fB\-\-ignore\-dependencies\fR is passed, skip installing any dependencies of If \fB\-\-only\-dependencies\fR is passed, install the dependencies with specified options but do not install the specified formula\. . .IP -If \fB\-\-cc=\fR\fIcompiler\fR is passed, attempt to compile using \fIcompiler\fR\. \fIcompiler\fR should be the name of the compiler\'s executable, for instance \fBgcc\-8\fR for gcc 8, \fBgcc\-4\.2\fR for Apple\'s GCC 4\.2, or \fBgcc\-4\.9\fR for a Homebrew\-provided GCC 4\.9\. In order to use LLVM\'s clang, use \fBllvm_clang\fR\. To specify the Apple\-provided clang, use \fBclang\fR\. This parameter will only accept compilers that are provided by Homebrew or bundled with macOS\. Please do not file issues if you encounter errors while using this flag\. +If \fB\-\-cc=\fR\fIcompiler\fR is passed, attempt to compile using \fIcompiler\fR\. \fIcompiler\fR should be the name of the compiler\'s executable, for instance \fBgcc\-7\fR for GCC 7\. In order to use LLVM\'s clang, use \fBllvm_clang\fR\. To specify the Apple\-provided clang, use \fBclang\fR\. This parameter will only accept compilers that are provided by Homebrew or bundled with macOS\. Please do not file issues if you encounter errors while using this flag\. . .IP If \fB\-\-build\-from\-source\fR (or \fB\-s\fR) is passed, compile the specified \fIformula\fR from source even if a bottle is provided\. Dependencies will still be installed from bottles if they are available\. @@ -1256,10 +1256,6 @@ By default, Homebrew uses \fBhttps://homebrew\.bintray\.com/\fR as its download If set, Homebrew uses this setting as the browser when opening project homepages, instead of the OS default browser\. . .TP -\fBHOMEBREW_BUILD_FROM_SOURCE\fR -If set, instructs Homebrew to compile from source even when a formula provides a bottle\. This environment variable is intended for use by Homebrew developers\. Please do not file issues if you encounter errors when using this environment variable\. -. -.TP \fBHOMEBREW_CACHE\fR If set, instructs Homebrew to use the specified directory as the download cache\. .