Merge remote-tracking branch 'origin/master' into external-help-cli-parser
This commit is contained in:
commit
2b86e036fb
@ -16,6 +16,7 @@ RUN apt-get update \
|
||||
libz-dev \
|
||||
locales \
|
||||
make \
|
||||
netbase \
|
||||
openssh-client \
|
||||
patch \
|
||||
sudo \
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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) %>
|
||||
|
||||
@ -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?
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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}", ".."
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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."
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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" ]]
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user