Merge branch 'Homebrew:master' into mohammad
This commit is contained in:
commit
42d8c852ae
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@ -269,7 +269,7 @@ jobs:
|
||||
env:
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378
|
||||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
with:
|
||||
files: Library/Homebrew/test/coverage/coverage.xml
|
||||
|
||||
@ -370,6 +370,6 @@ jobs:
|
||||
|
||||
- run: brew test-bot --only-formulae --test-default-formula
|
||||
|
||||
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378
|
||||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
|
||||
with:
|
||||
files: Library/Homebrew/test/coverage/coverage.xml
|
||||
|
11
.github/workflows/triage-issues.yml
vendored
11
.github/workflows/triage-issues.yml
vendored
@ -29,15 +29,14 @@ jobs:
|
||||
contains(github.event.pull_request.labels.*.name, 'stale')
|
||||
)
|
||||
)
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Mark/Close Stale Issues and Pull Requests
|
||||
uses: actions/stale@v5
|
||||
uses: actions/stale@v6
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 21
|
||||
days-before-close: 7
|
||||
close-issue-reason: "not_planned"
|
||||
stale-issue-message: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs.
|
||||
@ -55,10 +54,10 @@ jobs:
|
||||
contains(github.event.pull_request.labels.*.name, 'stale')
|
||||
)
|
||||
)
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Mark/Close Stale `bump-formula-pr` and `bump-cask-pr` Pull Requests
|
||||
uses: actions/stale@v5
|
||||
uses: actions/stale@v6
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 2
|
||||
@ -72,7 +71,7 @@ jobs:
|
||||
|
||||
lock-threads:
|
||||
if: startsWith(github.repository, 'Homebrew/') && github.event_name != 'issue_comment'
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Lock Outdated Threads
|
||||
uses: dessant/lock-threads@e460dfeb36e731f3aeb214be6b0c9a9d9a67eda6
|
||||
|
@ -18,7 +18,7 @@ GEM
|
||||
commander (4.6.0)
|
||||
highline (~> 2.0.0)
|
||||
concurrent-ruby (1.1.10)
|
||||
connection_pool (2.2.5)
|
||||
connection_pool (2.3.0)
|
||||
did_you_mean (1.6.1)
|
||||
diff-lcs (1.5.0)
|
||||
docile (1.4.0)
|
||||
@ -139,7 +139,7 @@ GEM
|
||||
rubocop-performance (1.15.0)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
rubocop-ast (>= 0.4.0)
|
||||
rubocop-rails (2.16.0)
|
||||
rubocop-rails (2.16.1)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.33.0, < 2.0)
|
||||
|
@ -716,7 +716,7 @@ module Cask
|
||||
|
||||
return unless cask.homepage
|
||||
|
||||
validate_url_for_https_availability(cask.homepage, "homepage URL", cask.token, cask.tap,
|
||||
validate_url_for_https_availability(cask.homepage, SharedAudits::URL_TYPE_HOMEPAGE, cask.token, cask.tap,
|
||||
user_agents: [:browser, :default],
|
||||
check_content: true,
|
||||
strict: strict?)
|
||||
@ -793,6 +793,9 @@ module Cask
|
||||
else
|
||||
host_uri.host
|
||||
end
|
||||
|
||||
return false if homepage.blank?
|
||||
|
||||
home = homepage.downcase
|
||||
if (split_host = host.split(".")).length >= 3
|
||||
host = split_host[-2..].join(".")
|
||||
|
@ -318,6 +318,10 @@ module Homebrew
|
||||
"outdated.",
|
||||
boolean: true,
|
||||
},
|
||||
HOMEBREW_PIP_INDEX_URL: {
|
||||
description: "If set, `brew install <formula>` will use this URL to download PyPI package resources.",
|
||||
default_text: "`https://pypi.org/simple`.",
|
||||
},
|
||||
HOMEBREW_PRY: {
|
||||
description: "If set, use Pry for the `brew irb` command.",
|
||||
boolean: true,
|
||||
|
@ -57,7 +57,14 @@ module Stdenv
|
||||
# Os is the default Apple uses for all its stuff so let's trust them
|
||||
define_cflags "-Os #{SAFE_CFLAGS_FLAGS}"
|
||||
|
||||
begin
|
||||
send(compiler)
|
||||
rescue CompilerSelectionError
|
||||
# We don't care if our compiler fails to build the formula during `brew test`.
|
||||
raise unless testing_formula
|
||||
|
||||
send(DevelopmentTools.default_compiler)
|
||||
end
|
||||
|
||||
return unless cc&.match?(GNU_GCC_REGEXP)
|
||||
|
||||
|
@ -4,6 +4,6 @@
|
||||
class CompilerSelector
|
||||
sig { returns(String) }
|
||||
def self.preferred_gcc
|
||||
OS::LINUX_PREFERRED_GCC_FORMULA
|
||||
OS::LINUX_PREFERRED_GCC_COMPILER_FORMULA
|
||||
end
|
||||
end
|
||||
|
@ -34,7 +34,7 @@ class DependencyCollector
|
||||
private
|
||||
|
||||
GLIBC = "glibc"
|
||||
GCC = CompilerSelector.preferred_gcc.freeze
|
||||
GCC = OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA
|
||||
|
||||
sig { void }
|
||||
def init_global_dep_tree_if_needed!
|
||||
|
@ -8,10 +8,15 @@ class DevelopmentTools
|
||||
sig { params(tool: String).returns(T.nilable(Pathname)) }
|
||||
def locate(tool)
|
||||
(@locate ||= {}).fetch(tool) do |key|
|
||||
@locate[key] = if (path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
|
||||
path
|
||||
elsif File.executable?(path = "/usr/bin/#{tool}")
|
||||
Pathname.new path
|
||||
@locate[key] = if build_system_too_old? &&
|
||||
(binutils_path = HOMEBREW_PREFIX/"opt/binutils/bin/#{tool}").executable?
|
||||
binutils_path
|
||||
elsif build_system_too_old? && (glibc_path = HOMEBREW_PREFIX/"opt/glibc/bin/#{tool}").executable?
|
||||
glibc_path
|
||||
elsif (homebrew_path = HOMEBREW_PREFIX/"bin/#{tool}").executable?
|
||||
homebrew_path
|
||||
elsif File.executable?(system_path = "/usr/bin/#{tool}")
|
||||
Pathname.new system_path
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -30,7 +35,10 @@ class DevelopmentTools
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def system_gcc_too_old?
|
||||
gcc_version("gcc") < OS::LINUX_GCC_CI_VERSION
|
||||
gcc = "/usr/bin/gcc"
|
||||
return true unless File.exist?(gcc)
|
||||
|
||||
gcc_version(gcc) < OS::LINUX_GCC_CI_VERSION
|
||||
end
|
||||
|
||||
sig { returns(T::Hash[String, T.nilable(String)]) }
|
||||
|
@ -33,6 +33,7 @@ class Formula
|
||||
dependency_collector = spec.dependency_collector
|
||||
related_formula_names = Set.new([
|
||||
name,
|
||||
*aliases,
|
||||
*versioned_formulae_names,
|
||||
])
|
||||
[
|
||||
|
@ -20,7 +20,8 @@ module Homebrew
|
||||
].freeze
|
||||
private_constant :DYNAMIC_LINKERS
|
||||
|
||||
GCC_VERSION_SUFFIX = OS::LINUX_GCC_CI_VERSION.delete_suffix(".0").freeze
|
||||
PREFERRED_GCC_RUNTIME_VERSION = OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA.split("@").last.freeze
|
||||
private_constant :PREFERRED_GCC_RUNTIME_VERSION
|
||||
|
||||
# We link GCC runtime libraries that are not specificaly used for Fortran,
|
||||
# which are linked by the GCC formula. We only use the versioned shared libraries
|
||||
@ -37,13 +38,13 @@ module Homebrew
|
||||
def perform_preinstall_checks(all_fatal: false, cc: nil)
|
||||
generic_perform_preinstall_checks(all_fatal: all_fatal, cc: cc)
|
||||
symlink_ld_so
|
||||
symlink_gcc_libs
|
||||
setup_preferred_gcc_libs
|
||||
end
|
||||
|
||||
def global_post_install
|
||||
generic_global_post_install
|
||||
symlink_ld_so
|
||||
symlink_gcc_libs
|
||||
setup_preferred_gcc_libs
|
||||
end
|
||||
|
||||
def check_cpu
|
||||
@ -63,36 +64,71 @@ module Homebrew
|
||||
|
||||
def symlink_ld_so
|
||||
brew_ld_so = HOMEBREW_PREFIX/"lib/ld.so"
|
||||
return if brew_ld_so.readable?
|
||||
|
||||
ld_so = HOMEBREW_PREFIX/"opt/glibc/lib/ld-linux-x86-64.so.2"
|
||||
ld_so = HOMEBREW_PREFIX/"opt/glibc/bin/ld.so"
|
||||
unless ld_so.readable?
|
||||
ld_so = DYNAMIC_LINKERS.find { |s| File.executable? s }
|
||||
raise "Unable to locate the system's dynamic linker" unless ld_so
|
||||
if ld_so.blank?
|
||||
raise "Unable to locate the system's dynamic linker" unless brew_ld_so.readable?
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
return if brew_ld_so.readable? && (brew_ld_so.readlink == ld_so)
|
||||
|
||||
FileUtils.mkdir_p HOMEBREW_PREFIX/"lib"
|
||||
FileUtils.ln_sf ld_so, brew_ld_so
|
||||
end
|
||||
private_class_method :symlink_ld_so
|
||||
|
||||
def symlink_gcc_libs
|
||||
gcc_opt_prefix = HOMEBREW_PREFIX/"opt/#{OS::LINUX_PREFERRED_GCC_FORMULA}"
|
||||
def setup_preferred_gcc_libs
|
||||
gcc_opt_prefix = HOMEBREW_PREFIX/"opt/#{OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA}"
|
||||
glibc_installed = (HOMEBREW_PREFIX/"opt/glibc/bin/ld.so").readable?
|
||||
|
||||
return unless gcc_opt_prefix.readable?
|
||||
|
||||
if glibc_installed
|
||||
ld_so_conf_d = HOMEBREW_PREFIX/"etc/ld.so.conf.d"
|
||||
unless ld_so_conf_d.exist?
|
||||
ld_so_conf_d.mkpath
|
||||
FileUtils.chmod "go-w", ld_so_conf_d
|
||||
end
|
||||
|
||||
# Add gcc to ld search paths
|
||||
ld_gcc_conf = ld_so_conf_d/"50-homebrew-preferred-gcc.conf"
|
||||
unless ld_gcc_conf.exist?
|
||||
ld_gcc_conf.atomic_write <<~EOS
|
||||
# This file is generated by Homebrew. Do not modify.
|
||||
#{gcc_opt_prefix}/lib/gcc/#{PREFERRED_GCC_RUNTIME_VERSION}
|
||||
EOS
|
||||
FileUtils.chmod "u=rw,go-wx", ld_gcc_conf
|
||||
|
||||
FileUtils.rm_f HOMEBREW_PREFIX/"etc/ld.so.cache"
|
||||
system HOMEBREW_PREFIX/"opt/glibc/sbin/ldconfig"
|
||||
end
|
||||
else
|
||||
odie "#{HOMEBREW_PREFIX}/lib does not exist!" unless (HOMEBREW_PREFIX/"lib").readable?
|
||||
end
|
||||
|
||||
GCC_RUNTIME_LIBS.each do |library|
|
||||
gcc_library = gcc_opt_prefix/"lib/gcc/#{GCC_VERSION_SUFFIX}/#{library}"
|
||||
gcc_library_symlink = HOMEBREW_PREFIX/"lib/#{library}"
|
||||
|
||||
if glibc_installed
|
||||
# Remove legacy symlinks
|
||||
FileUtils.rm gcc_library_symlink if gcc_library_symlink.symlink?
|
||||
else
|
||||
gcc_library = gcc_opt_prefix/"lib/gcc/#{PREFERRED_GCC_RUNTIME_VERSION}/#{library}"
|
||||
# Skip if the link target doesn't exist.
|
||||
next unless gcc_library.readable?
|
||||
|
||||
# Also skip if the symlink already exists.
|
||||
next if gcc_library_symlink.readable? && (gcc_library_symlink.readlink == gcc_library)
|
||||
|
||||
odie "#{HOMEBREW_PREFIX}/lib does not exist!" unless (HOMEBREW_PREFIX/"lib").readable?
|
||||
|
||||
FileUtils.ln_sf gcc_library, gcc_library_symlink
|
||||
end
|
||||
end
|
||||
private_class_method :symlink_gcc_libs
|
||||
end
|
||||
private_class_method :setup_preferred_gcc_libs
|
||||
end
|
||||
end
|
||||
|
@ -30,16 +30,10 @@ class Keg
|
||||
lib_path = "#{new_prefix}/lib"
|
||||
rpath << lib_path unless rpath.include? lib_path
|
||||
|
||||
# Add GCC's lib directory (as of GCC 12+) to RPATH when there is existing linkage.
|
||||
# This fixes linkage for newly-poured bottles.
|
||||
if !name.match?(Version.formula_optionally_versioned_regex(:gcc)) &&
|
||||
rpath.any? { |rp| rp.match?(%r{lib/gcc/\d+$}) }
|
||||
# TODO: Replace with
|
||||
# rpath.map! { |path| path = path.sub(%r{lib/gcc/\d+$}, "lib/gcc/current") }
|
||||
# when
|
||||
# 1. Homebrew/homebrew-core#106755 is merged
|
||||
# 2. No formula has a runtime dependency on a versioned GCC (see `envoy.rb`)
|
||||
rpath.prepend HOMEBREW_PREFIX/"opt/gcc/lib/gcc/current"
|
||||
# Add GCC's lib directory (as of GCC 12+) to RPATH when there is existing versioned linkage.
|
||||
# This prevents broken linkage when pouring bottles built with an old GCC formula.
|
||||
unless name.match?(Version.formula_optionally_versioned_regex(:gcc))
|
||||
rpath.map! { |rp| rp.sub(%r{lib/gcc/\d+$}, "lib/gcc/current") }
|
||||
end
|
||||
|
||||
rpath.join(":")
|
||||
|
@ -28,7 +28,7 @@ module SystemConfig
|
||||
def formula_linked_version(formula)
|
||||
return "N/A" unless CoreTap.instance.installed?
|
||||
|
||||
Formulary.factory(formula).linked_version || "N/A"
|
||||
Formulary.factory(formula).any_installed_version || "N/A"
|
||||
rescue FormulaUnavailableError
|
||||
"N/A"
|
||||
end
|
||||
@ -47,7 +47,7 @@ module SystemConfig
|
||||
out.puts "Host glibc: #{host_glibc_version}"
|
||||
out.puts "/usr/bin/gcc: #{host_gcc_version}"
|
||||
out.puts "/usr/bin/ruby: #{host_ruby_version}" if RUBY_PATH != HOST_RUBY_PATH
|
||||
["glibc", CompilerSelector.preferred_gcc, "xorg"].each do |f|
|
||||
["glibc", CompilerSelector.preferred_gcc, OS::LINUX_PREFERRED_GCC_RUNTIME_FORMULA, "xorg"].each do |f|
|
||||
out.puts "#{f}: #{formula_linked_version(f)}"
|
||||
end
|
||||
end
|
||||
|
@ -2070,6 +2070,10 @@ class Formula
|
||||
"dependencies" => dependencies.reject(&:optional?)
|
||||
.reject(&:recommended?)
|
||||
.reject(&:build?)
|
||||
.reject(&:test?)
|
||||
.map(&:name)
|
||||
.uniq,
|
||||
"test_dependencies" => dependencies.select(&:test?)
|
||||
.map(&:name)
|
||||
.uniq,
|
||||
"recommended_dependencies" => dependencies.select(&:recommended?)
|
||||
|
@ -498,7 +498,7 @@ module Homebrew
|
||||
end
|
||||
|
||||
if (http_content_problem = curl_check_http_content(homepage,
|
||||
"homepage URL",
|
||||
SharedAudits::URL_TYPE_HOMEPAGE,
|
||||
user_agents: [:browser, :default],
|
||||
check_content: true,
|
||||
strict: @strict,
|
||||
@ -892,8 +892,9 @@ module Homebrew
|
||||
# This variation either:
|
||||
# 1. does not exist
|
||||
# 2. has no variation-specific dependencies
|
||||
# In either case, it matches Linux.
|
||||
return false if variation_dependencies.blank?
|
||||
# In either case, it matches Linux. We must check for `nil` because an empty
|
||||
# array indicates that this variation does not depend on GCC.
|
||||
return false if variation_dependencies.nil?
|
||||
# We found a non-Linux variation that depends on GCC.
|
||||
return false if variation_dependencies.include?("gcc")
|
||||
end
|
||||
|
@ -194,7 +194,7 @@ module Formulary
|
||||
depends_on dep
|
||||
end
|
||||
|
||||
[:build, :recommended, :optional].each do |type|
|
||||
[:build, :test, :recommended, :optional].each do |type|
|
||||
json_formula["#{type}_dependencies"].each do |dep|
|
||||
next if uses_from_macos_names.include? dep
|
||||
|
||||
@ -670,7 +670,8 @@ module Formulary
|
||||
return TapLoader.new(ref, from: from)
|
||||
end
|
||||
|
||||
return FromPathLoader.new(ref) if File.extname(ref) == ".rb" && Pathname.new(ref).expand_path.exist?
|
||||
pathname_ref = Pathname.new(ref)
|
||||
return FromPathLoader.new(ref) if File.extname(ref) == ".rb" && pathname_ref.expand_path.exist?
|
||||
|
||||
if Homebrew::EnvConfig.install_from_api?
|
||||
return FormulaAPILoader.new(ref) if Homebrew::API::Formula.all_formulae.key?(ref)
|
||||
@ -680,8 +681,12 @@ module Formulary
|
||||
formula_with_that_name = core_path(ref)
|
||||
return FormulaLoader.new(ref, formula_with_that_name) if formula_with_that_name.file?
|
||||
|
||||
possible_alias = core_alias_path(ref)
|
||||
return AliasLoader.new(possible_alias) if possible_alias.file?
|
||||
possible_alias = if pathname_ref.absolute?
|
||||
pathname_ref
|
||||
else
|
||||
core_alias_path(ref)
|
||||
end
|
||||
return AliasLoader.new(possible_alias) if possible_alias.symlink?
|
||||
|
||||
possible_tap_formulae = tap_paths(ref)
|
||||
raise TapFormulaAmbiguityError.new(ref, possible_tap_formulae) if possible_tap_formulae.size > 1
|
||||
|
@ -311,9 +311,12 @@ class LinkageChecker
|
||||
def harmless_broken_link?(dylib)
|
||||
# libgcc_s_* is referenced by programs that use the Java Service Wrapper,
|
||||
# and is harmless on x86(_64) machines
|
||||
# dyld will fall back to Apple libc++ if LLVM's is not available.
|
||||
[
|
||||
"/usr/lib/libgcc_s_ppc64.1.dylib",
|
||||
"/opt/local/lib/libgcc/libgcc_s.1.dylib",
|
||||
# TODO: Report linkage with `/usr/lib/libc++.1.dylib` when this link is broken.
|
||||
"#{HOMEBREW_PREFIX}/opt/llvm/lib/libc++.1.dylib",
|
||||
].include?(dylib)
|
||||
end
|
||||
|
||||
|
@ -50,7 +50,8 @@ module OS
|
||||
LINUX_GLIBC_CI_VERSION = "2.35"
|
||||
LINUX_GLIBC_NEXT_CI_VERSION = "2.35"
|
||||
LINUX_GCC_CI_VERSION = "11.0"
|
||||
LINUX_PREFERRED_GCC_FORMULA = "gcc@11"
|
||||
LINUX_PREFERRED_GCC_COMPILER_FORMULA = "gcc@11" # https://packages.ubuntu.com/jammy/gcc
|
||||
LINUX_PREFERRED_GCC_RUNTIME_FORMULA = "gcc@12" # https://packages.ubuntu.com/jammy/libstdc++6
|
||||
|
||||
if OS.mac?
|
||||
require "os/mac"
|
||||
|
@ -78,8 +78,11 @@ class Resource
|
||||
end
|
||||
|
||||
def downloader
|
||||
@downloader ||= download_strategy.new(url, download_name, version,
|
||||
mirrors: mirrors.dup, **specs)
|
||||
return @downloader if @downloader.present?
|
||||
|
||||
url, *mirrors = determine_url_mirrors
|
||||
@downloader = download_strategy.new(url, download_name, version,
|
||||
mirrors: mirrors, **specs)
|
||||
end
|
||||
|
||||
# Removes /s from resource names; this allows Go package names
|
||||
@ -277,6 +280,31 @@ class Resource
|
||||
version unless version.null?
|
||||
end
|
||||
|
||||
def determine_url_mirrors
|
||||
extra_urls = []
|
||||
|
||||
# glibc-bootstrap
|
||||
if url.start_with?("https://github.com/Homebrew/glibc-bootstrap/releases/download")
|
||||
if Homebrew::EnvConfig.artifact_domain.present?
|
||||
extra_urls << url.sub("https://github.com", Homebrew::EnvConfig.artifact_domain)
|
||||
end
|
||||
if Homebrew::EnvConfig.bottle_domain != HOMEBREW_BOTTLE_DEFAULT_DOMAIN
|
||||
tag, filename = url.split("/").last(2)
|
||||
extra_urls << "#{Homebrew::EnvConfig.bottle_domain}/glibc-bootstrap/#{tag}/#{filename}"
|
||||
end
|
||||
end
|
||||
|
||||
# PyPI packages: PEP 503 – Simple Repository API <https://peps.python.org/pep-0503>
|
||||
if Homebrew::EnvConfig.pip_index_url.present?
|
||||
pip_index_base_url = Homebrew::EnvConfig.pip_index_url.chomp("/").chomp("/simple")
|
||||
%w[https://files.pythonhosted.org https://pypi.org].each do |base_url|
|
||||
extra_urls << url.sub(base_url, pip_index_base_url) if url.start_with?("#{base_url}/packages")
|
||||
end
|
||||
end
|
||||
|
||||
[*extra_urls, url, *mirrors].uniq
|
||||
end
|
||||
|
||||
# A resource containing a Go package.
|
||||
class Go < Resource
|
||||
def stage(target, &block)
|
||||
|
@ -1728,8 +1728,10 @@ RuboCop::Cop::Rails::RootJoinChain::MSG = T.let(T.unsafe(nil), String)
|
||||
RuboCop::Cop::Rails::RootJoinChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
|
||||
|
||||
class RuboCop::Cop::Rails::RootPathnameMethods < ::RuboCop::Cop::Base
|
||||
include ::RuboCop::Cop::RangeHelp
|
||||
extend ::RuboCop::Cop::AutoCorrector
|
||||
|
||||
def dir_glob?(param0 = T.unsafe(nil)); end
|
||||
def on_send(node); end
|
||||
def pathname_method(param0 = T.unsafe(nil)); end
|
||||
def rails_root?(param0 = T.unsafe(nil)); end
|
||||
@ -1737,7 +1739,10 @@ class RuboCop::Cop::Rails::RootPathnameMethods < ::RuboCop::Cop::Base
|
||||
|
||||
private
|
||||
|
||||
def build_path_glob(path, method); end
|
||||
def evidence(node); end
|
||||
def include_interpolation?(arguments); end
|
||||
def join_arguments(arguments); end
|
||||
end
|
||||
|
||||
RuboCop::Cop::Rails::RootPathnameMethods::DIR_METHODS = T.let(T.unsafe(nil), Set)
|
@ -2655,6 +2655,8 @@ module Homebrew::EnvConfig
|
||||
|
||||
def self.no_proxy(); end
|
||||
|
||||
def self.pip_index_url(); end
|
||||
|
||||
def self.pry?(); end
|
||||
|
||||
def self.simulate_macos_on_linux?(); end
|
||||
|
@ -238,6 +238,7 @@ describe Formulary do
|
||||
},
|
||||
"build_dependencies" => ["build_dep"],
|
||||
"dependencies" => ["dep"],
|
||||
"test_dependencies" => ["test_dep"],
|
||||
"recommended_dependencies" => ["recommended_dep"],
|
||||
"optional_dependencies" => ["optional_dep"],
|
||||
"uses_from_macos" => ["uses_from_macos_dep"],
|
||||
@ -291,9 +292,9 @@ describe Formulary do
|
||||
expect(formula).to be_a(Formula)
|
||||
expect(formula.keg_only_reason.reason).to eq :provided_by_macos
|
||||
if OS.mac?
|
||||
expect(formula.deps.count).to eq 4
|
||||
elsif OS.linux?
|
||||
expect(formula.deps.count).to eq 5
|
||||
elsif OS.linux?
|
||||
expect(formula.deps.count).to eq 6
|
||||
end
|
||||
expect(formula.uses_from_macos_elements).to eq ["uses_from_macos_dep"]
|
||||
expect(formula.caveats).to eq "example caveat string"
|
||||
@ -329,7 +330,7 @@ describe Formulary do
|
||||
|
||||
formula = described_class.factory(formula_name)
|
||||
expect(formula).to be_a(Formula)
|
||||
expect(formula.deps.count).to eq 5
|
||||
expect(formula.deps.count).to eq 6
|
||||
expect(formula.deps.map(&:name).include?("variations_dep")).to be true
|
||||
end
|
||||
|
||||
@ -339,7 +340,7 @@ describe Formulary do
|
||||
|
||||
formula = described_class.factory(formula_name)
|
||||
expect(formula).to be_a(Formula)
|
||||
expect(formula.deps.count).to eq 5
|
||||
expect(formula.deps.count).to eq 6
|
||||
expect(formula.deps.map(&:name).include?("uses_from_macos_dep")).to be true
|
||||
end
|
||||
end
|
||||
|
@ -290,9 +290,27 @@ module Utils
|
||||
url_protected_by_cloudflare?(response) || url_protected_by_incapsula?(response)
|
||||
end
|
||||
|
||||
# https://github.com/Homebrew/brew/issues/13789
|
||||
# If the `:homepage` of a formula is private, it will fail an `audit`
|
||||
# since there's no way to specify a `strategy` with `using:` and
|
||||
# GitHub does not authorize access to the web UI using token
|
||||
#
|
||||
# Strategy:
|
||||
# If the `:homepage` 404s, it's a GitHub link, and we have a token then
|
||||
# check the API (which does use tokens) for the repository
|
||||
repo_details = url.match(%r{https?://github\.com/(?<user>[^/]+)/(?<repo>[^/]+)/?.*})
|
||||
check_github_api = url_type == SharedAudits::URL_TYPE_HOMEPAGE &&
|
||||
details[:status_code] == "404" &&
|
||||
repo_details &&
|
||||
Homebrew::EnvConfig.github_api_token
|
||||
|
||||
unless check_github_api
|
||||
return "The #{url_type} #{url} is not reachable (HTTP status code #{details[:status_code]})"
|
||||
end
|
||||
|
||||
"Unable to find homepage" if SharedAudits.github_repo_data(repo_details[:user], repo_details[:repo]).nil?
|
||||
end
|
||||
|
||||
if url.start_with?("https://") && Homebrew::EnvConfig.no_insecure_redirect? &&
|
||||
(details[:final_url].present? && !details[:final_url].start_with?("https://"))
|
||||
return "The #{url_type} #{url} redirects back to HTTP"
|
||||
|
@ -10,6 +10,8 @@ module SharedAudits
|
||||
include Utils::Curl
|
||||
extend Utils::Curl
|
||||
|
||||
URL_TYPE_HOMEPAGE = "homepage URL"
|
||||
|
||||
module_function
|
||||
|
||||
def github_repo_data(user, repo)
|
||||
|
@ -23,7 +23,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/byebug-11.1.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/coderay-1.1.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/highline-2.0.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/commander-4.6.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/connection_pool-2.2.5/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/connection_pool-2.3.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/did_you_mean-1.6.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/diff-lcs-1.5.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/docile-1.4.0/lib"
|
||||
@ -88,7 +88,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-progressbar-1.11
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width-2.3.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.35.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.15.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.16.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.16.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.13.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.11/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-3.0.0/lib"
|
||||
|
@ -845,6 +845,7 @@ Rails/RootJoinChain:
|
||||
Rails/RootPathnameMethods:
|
||||
Description: 'Use `Rails.root` IO methods instead of passing it to `File`.'
|
||||
Enabled: pending
|
||||
SafeAutocorrect: false
|
||||
VersionAdded: '2.16'
|
||||
|
||||
Rails/RootPublicPath:
|
@ -43,10 +43,15 @@ module RuboCop
|
||||
PATTERN
|
||||
|
||||
def on_send(node)
|
||||
child_node, method_name = *node.first_argument.children
|
||||
child_node, method_name, time_argument = *node.first_argument.children
|
||||
return if time_argument || !child_node
|
||||
return unless current_time?(child_node, method_name) || current_time_with_convert?(child_node, method_name)
|
||||
|
||||
add_offense(node) { |corrector| corrector.replace(node, 'freeze_time') }
|
||||
add_offense(node) do |corrector|
|
||||
last_argument = node.last_argument
|
||||
freeze_time_method = last_argument.block_pass_type? ? "freeze_time(#{last_argument.source})" : 'freeze_time'
|
||||
corrector.replace(node, freeze_time_method)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user