diff --git a/Dockerfile b/Dockerfile index 442fe01b99..b45db95b1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ RUN apt-get update \ libz-dev \ locales \ make \ + netbase \ openssh-client \ patch \ sudo \ diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 206d27d8cd..e051a5b9cf 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -49,7 +49,7 @@ GEM mini_portile2 (~> 2.4.0) ntlm-http (0.1.1) parallel (1.19.1) - parallel_tests (2.30.1) + parallel_tests (2.31.0) parallel parser (2.7.0.2) ast (~> 2.4.0) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 76d81bfeef..4c99c022a7 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -11,7 +11,7 @@ require "erb" BOTTLE_ERB = <<-EOS bottle do - <% if !root_url.start_with?(HOMEBREW_BOTTLE_DEFAULT_DOMAIN) %> + <% if root_url != "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}/bottles" %> root_url "<%= root_url %>" <% end %> <% if ![HOMEBREW_DEFAULT_PREFIX, LINUXBREW_DEFAULT_PREFIX].include?(prefix) %> diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 7931a86d9e..27176242f8 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -474,28 +474,6 @@ module Homebrew EOS end - def check_ld_vars - ld_vars = ENV.keys.grep(/^(|DY)LD_/) - return if ld_vars.empty? - - values = ld_vars.map { |var| "#{var}: #{ENV.fetch(var)}" } - message = inject_file_list values, <<~EOS - Setting DYLD_* or LD_* variables can break dynamic linking. - Set variables: - EOS - - if ld_vars.include? "DYLD_INSERT_LIBRARIES" - message += <<~EOS - - Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail. - Having this set is common if you use this software: - #{Formatter.url("https://asepsis.binaryage.com/")} - EOS - end - - message - end - def check_for_symlinked_cellar return unless HOMEBREW_CELLAR.exist? return unless HOMEBREW_CELLAR.symlink? diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 29e613fdd3..80eb373512 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1338,6 +1338,11 @@ class Formula args end + # Standard parameters for Go builds. + def std_go_args + ["-trimpath", "-o", bin/name] + end + # an array of all core {Formula} names # @private def self.core_names diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 06ce159785..53777d1e09 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -137,7 +137,7 @@ module Homebrew "--disable-silent-rules", "--prefix=\#{prefix}" <% elsif mode == :go %> - system "go", "build", "-o", "\#{bin}/\#{name}" + system "go", "build", *std_go_args <% elsif mode == :meson %> mkdir "build" do system "meson", "--prefix=\#{prefix}", ".." diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb index 32e5a2a560..ba1895ac79 100644 --- a/Library/Homebrew/missing_formula.rb +++ b/Library/Homebrew/missing_formula.rb @@ -28,10 +28,6 @@ module Homebrew Minimal installation: brew cask install basictex EOS - when "asymptote" then <<~EOS - Asymptote is part of MacTeX: - brew cask install mactex - EOS when "pip" then <<~EOS pip is part of the python formula: brew install python diff --git a/Library/Homebrew/rubocops/lines.rb b/Library/Homebrew/rubocops/lines.rb index 1a2c32d200..26e36f1397 100644 --- a/Library/Homebrew/rubocops/lines.rb +++ b/Library/Homebrew/rubocops/lines.rb @@ -424,6 +424,25 @@ module RuboCop # Avoid build-time checks in homebrew/core find_every_method_call_by_name(body_node, :system).each do |method| + next if @formula_name.start_with?("lib") + next if %w[ + beecrypt + ccrypt + git + gmp + gnupg + gnupg@1.4 + google-sparsehash + jemalloc + jpeg-turbo + mpfr + open-mpi + openssl@1.1 + pcre + wolfssl + xz + ].include?(@formula_name) + params = parameters(method) next unless node_equals?(params[0], "make") @@ -431,7 +450,8 @@ module RuboCop next unless regex_match_group(arg, /^(checks?|tests?)$/) offending_node(method) - problem "Formulae in homebrew/core should not run build-time checks" + problem "Formulae in homebrew/core (except e.g. cryptography, libraries) " \ + "should not run build-time checks" end end end diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index 7d3392415f..584d014cdd 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -24,12 +24,6 @@ module RuboCop rust ].freeze - # specific rust-nightly temporarily acceptable until a newer version is released. - # DO NOT RE-ADD A NEWER RUST-NIGHTLY IN FUTURE. - BINARY_URLS_WHITELIST = %w[ - https://static.rust-lang.org/dist/2019-08-24/rust-nightly-x86_64-apple-darwin.tar.xz - ].freeze - def audit_formula(_node, _class_node, _parent_class_node, body_node) urls = find_every_func_call_by_name(body_node, :url) mirrors = find_every_func_call_by_name(body_node, :mirror) @@ -232,7 +226,6 @@ module RuboCop audit_urls(urls, /(darwin|macos|osx)/i) do |_, url| next if url !~ /x86_64/i && url !~ /amd64/i next if BINARY_FORMULA_URLS_WHITELIST.include?(@formula_name) - next if BINARY_URLS_WHITELIST.include?(url) problem "#{url} looks like a binary package, not a source archive; " \ "homebrew/core is source-only." diff --git a/Library/Homebrew/test/diagnostic_checks_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb index 95f22b1d2a..5fd14791c4 100644 --- a/Library/Homebrew/test/diagnostic_checks_spec.rb +++ b/Library/Homebrew/test/diagnostic_checks_spec.rb @@ -113,26 +113,6 @@ describe Homebrew::Diagnostic::Checks do HOMEBREW_CELLAR.mkpath end - specify "#check_ld_vars catches LD vars" do - ENV["LD_LIBRARY_PATH"] = "foo" - expect(subject.check_ld_vars).to match("Setting DYLD_\\* or LD_\\* variables") - end - - specify "#check_ld_vars catches DYLD vars" do - ENV["DYLD_LIBRARY_PATH"] = "foo" - expect(subject.check_ld_vars).to match("Setting DYLD_\\* or LD_\\* variables") - end - - specify "#check_ld_vars catches LD and DYLD vars" do - ENV["LD_LIBRARY_PATH"] = "foo" - ENV["DYLD_LIBRARY_PATH"] = "foo" - expect(subject.check_ld_vars).to match("Setting DYLD_\\* or LD_\\* variables") - end - - specify "#check_ld_vars returns success when neither LD nor DYLD vars are set" do - expect(subject.check_ld_vars).to be nil - end - specify "#check_tmpdir" do ENV["TMPDIR"] = "/i/don/t/exis/t" expect(subject.check_tmpdir).to match("doesn't exist") diff --git a/Library/Homebrew/test/os/mac/diagnostic_spec.rb b/Library/Homebrew/test/os/mac/diagnostic_spec.rb index 353a4e7b68..aa44899d50 100644 --- a/Library/Homebrew/test/os/mac/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/mac/diagnostic_spec.rb @@ -28,9 +28,4 @@ describe Homebrew::Diagnostic::Checks do expect(subject.check_ruby_version) .to match "Ruby version 1.8.6 is unsupported on 10.12" end - - specify "#check_dyld_insert" do - ENV["DYLD_INSERT_LIBRARIES"] = "foo" - expect(subject.check_ld_vars).to match("Setting DYLD_INSERT_LIBRARIES") - end end diff --git a/Library/Homebrew/test/rubocops/lines_spec.rb b/Library/Homebrew/test/rubocops/lines_spec.rb index 9885bbc8fb..d84b10d889 100644 --- a/Library/Homebrew/test/rubocops/lines_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_spec.rb @@ -355,7 +355,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' system "make", "-j1", "test" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not run build-time checks + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core (except e.g. cryptography, libraries) should not run build-time checks end RUBY end diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh index 822ddd2789..7ddc5511aa 100644 --- a/Library/Homebrew/utils/ruby.sh +++ b/Library/Homebrew/utils/ruby.sh @@ -5,7 +5,7 @@ setup-ruby-path() { local ruby_version_new_enough # When bumping check if HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH (in brew.sh) # also needs to be changed. - local minimum_ruby_version="2.6.3" + local required_ruby_version="2.6" vendor_dir="$HOMEBREW_LIBRARY/Homebrew/vendor" vendor_ruby_current_version="$vendor_dir/portable-ruby/current" @@ -42,10 +42,10 @@ setup-ruby-path() { ruby_version_new_enough="true" elif [[ -n "$HOMEBREW_RUBY_PATH" && -z "$HOMEBREW_FORCE_VENDOR_RUBY" ]] then - ruby_version_new_enough="$("$HOMEBREW_RUBY_PATH" --enable-frozen-string-literal --disable=gems,did_you_mean,rubyopt -rrubygems -e "puts Gem::Version.new(RUBY_VERSION.to_s.dup) >= Gem::Version.new('$minimum_ruby_version')")" + usable_ruby_version="$("$HOMEBREW_RUBY_PATH" --enable-frozen-string-literal --disable=gems,did_you_mean,rubyopt -rrubygems -e "puts Gem::Version.new(RUBY_VERSION.to_s.dup).canonical_segments.first(2) == Gem::Version.new('$required_ruby_version').canonical_segments.first(2)")" fi - if [[ -z "$HOMEBREW_RUBY_PATH" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" || "$ruby_version_new_enough" != "true" ]] + if [[ -z "$HOMEBREW_RUBY_PATH" || -n "$HOMEBREW_FORCE_VENDOR_RUBY" || "$usable_ruby_version" != "true" ]] then brew vendor-install ruby if [[ ! -x "$vendor_ruby_path" ]] diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 3e9681c85e..6975feaf55 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -26,12 +26,12 @@ GEM ffi (>= 1.3.0) eventmachine (1.2.7) execjs (2.7.0) - faraday (0.17.1) + faraday (1.0.0) multipart-post (>= 1.2, < 3) ffi (1.12.1) forwardable-extended (2.6.0) gemoji (3.0.1) - github-pages (203) + github-pages (204) github-pages-health-check (= 1.16.1) jekyll (= 3.8.5) jekyll-avatar (= 0.7.0) @@ -40,7 +40,7 @@ GEM jekyll-default-layout (= 0.1.4) jekyll-feed (= 0.13.0) jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.12.1) + jekyll-github-metadata (= 2.13.0) jekyll-mentions (= 1.5.1) jekyll-optional-front-matter (= 0.3.2) jekyll-paginate (= 1.1.0) @@ -83,7 +83,7 @@ GEM html-pipeline (2.12.3) activesupport (>= 2) nokogiri (>= 1.4) - html-proofer (3.15.0) + html-proofer (3.15.1) addressable (~> 2.3) mercenary (~> 0.3) nokogumbo (~> 2.0) @@ -125,8 +125,8 @@ GEM jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) - jekyll-github-metadata (2.12.1) - jekyll (~> 3.4) + jekyll-github-metadata (2.13.0) + jekyll (>= 3.4, < 5.0) octokit (~> 4.0, != 4.4.0) jekyll-mentions (1.5.1) html-pipeline (~> 2.3) @@ -216,7 +216,8 @@ GEM mini_portile2 (~> 2.4.0) nokogumbo (2.0.2) nokogiri (~> 1.8, >= 1.8.4) - octokit (4.14.0) + octokit (4.15.0) + faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) parallel (1.19.1) pathutil (0.16.2) @@ -230,7 +231,7 @@ GEM rouge (3.13.0) ruby-enum (0.7.2) i18n - rubyzip (2.0.0) + rubyzip (2.1.0) safe_yaml (1.0.5) sass (3.7.4) sass-listen (~> 4.0.0) diff --git a/docs/Homebrew-linuxbrew-core-Maintainer-Guide.md b/docs/Homebrew-linuxbrew-core-Maintainer-Guide.md index 84b2fd7d66..c9967bc44e 100644 --- a/docs/Homebrew-linuxbrew-core-Maintainer-Guide.md +++ b/docs/Homebrew-linuxbrew-core-Maintainer-Guide.md @@ -393,8 +393,8 @@ If the formula is a Linux-only formula, it either: - will contain the line `# tag "linux"` - won't have macOS bottles -These formulae are fine for users to bump with `brew bump-formula-pr`, -but you should request that they remove the existing `x86_64_linux` +If the user hasn't used `brew bump-formula-pr`, or is submitting +another change, you should request that they remove the `x86_64_linux` bottle SHA line so that CI will build a bottle for the new version correctly. If the bottle SHA isn't removed, CI will fail with the following error: