From f9e8531924138472a4fcf6ec9ff3f65f72286588 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Wed, 20 Jul 2022 18:18:12 +0800 Subject: [PATCH 01/20] cmd/update: stop Git's fsmonitor when needed Git's fsmonitor daemon will prevent our update lock file from being released if it is running before a `brew update`. Let's fix that by stopping it whenever necessary so our update lock is released upon completion. Fixes #13521. --- Library/Homebrew/cmd/update.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 0269d73edb..1aed9905cd 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -556,6 +556,12 @@ EOS [[ -d "${DIR}/.git" ]] || continue cd "${DIR}" || continue + # Git's fsmonitor daemon will not release our lock unless we stop it. + if git fsmonitor--daemon status &>/dev/null + then + git fsmonitor--daemon stop 2>/dev/null + fi + if ! git config --local --get remote.origin.url &>/dev/null then opoo "No remote 'origin' in ${DIR}, skipping update!" From fa384b03faac221d9a98a64a5d998c652fc45aca Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sat, 23 Jul 2022 02:00:28 +0200 Subject: [PATCH 02/20] Simplify `SimulateSystem` usage --- Library/Homebrew/extend/on_system.rb | 16 +-- Library/Homebrew/simulate_system.rb | 24 +++- Library/Homebrew/test/simulate_system_spec.rb | 118 ++++++++++++++++++ 3 files changed, 140 insertions(+), 18 deletions(-) create mode 100644 Library/Homebrew/test/simulate_system_spec.rb diff --git a/Library/Homebrew/extend/on_system.rb b/Library/Homebrew/extend/on_system.rb index 5ec59cbdfa..d151e26ddd 100644 --- a/Library/Homebrew/extend/on_system.rb +++ b/Library/Homebrew/extend/on_system.rb @@ -15,8 +15,7 @@ module OnSystem def arch_condition_met?(arch) raise ArgumentError, "Invalid arch condition: #{arch.inspect}" if ARCH_OPTIONS.exclude?(arch) - current_arch = Homebrew::SimulateSystem.arch || Hardware::CPU.type - arch == current_arch + arch == Homebrew::SimulateSystem.current_arch end sig { params(os_name: Symbol, or_condition: T.nilable(Symbol)).returns(T::Boolean) } @@ -26,14 +25,7 @@ module OnSystem return true if [:macos, *MacOSVersions::SYMBOLS.keys].include?(os_name) end - if BASE_OS_OPTIONS.include?(os_name) - if Homebrew::SimulateSystem.none? - return OS.linux? if os_name == :linux - return OS.mac? if os_name == :macos - end - - return Homebrew::SimulateSystem.send("#{os_name}?") - end + return Homebrew::SimulateSystem.send("treat_as_#{os_name}?") if BASE_OS_OPTIONS.include?(os_name) raise ArgumentError, "Invalid OS condition: #{os_name.inspect}" unless MacOSVersions::SYMBOLS.key?(os_name) @@ -41,10 +33,10 @@ module OnSystem raise ArgumentError, "Invalid OS `or_*` condition: #{or_condition.inspect}" end - return false if Homebrew::SimulateSystem.linux? || (Homebrew::SimulateSystem.none? && OS.linux?) + return false if Homebrew::SimulateSystem.treat_as_linux? base_os = MacOS::Version.from_symbol(os_name) - current_os = MacOS::Version.from_symbol(Homebrew::SimulateSystem.os || MacOS.version.to_sym) + current_os = MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os) return current_os >= base_os if or_condition == :or_newer return current_os <= base_os if or_condition == :or_older diff --git a/Library/Homebrew/simulate_system.rb b/Library/Homebrew/simulate_system.rb index d52a2af752..c93791afb9 100644 --- a/Library/Homebrew/simulate_system.rb +++ b/Library/Homebrew/simulate_system.rb @@ -32,19 +32,31 @@ module Homebrew end sig { returns(T::Boolean) } - def none? - @os.nil? && @arch.nil? - end + def treat_as_macos? + return OS.mac? if @os.blank? - sig { returns(T::Boolean) } - def macos? [:macos, *MacOSVersions::SYMBOLS.keys].include?(@os) end sig { returns(T::Boolean) } - def linux? + def treat_as_linux? + return OS.linux? if @os.blank? + @os == :linux end + + sig { returns(Symbol) } + def current_arch + @arch || Hardware::CPU.type + end + + sig { returns(Symbol) } + def current_os + return @os if @os.present? + return :linux if OS.linux? + + MacOS.version.to_sym + end end end end diff --git a/Library/Homebrew/test/simulate_system_spec.rb b/Library/Homebrew/test/simulate_system_spec.rb new file mode 100644 index 0000000000..9994b71fea --- /dev/null +++ b/Library/Homebrew/test/simulate_system_spec.rb @@ -0,0 +1,118 @@ +# typed: false +# frozen_string_literal: true + +require "settings" + +describe Homebrew::SimulateSystem do + after do + described_class.clear + end + + describe "::treat_as_macos?" do + it "returns true on macOS", :needs_macos do + described_class.clear + expect(described_class.treat_as_macos?).to be true + end + + it "returns false on Linux", :needs_linux do + described_class.clear + expect(described_class.treat_as_macos?).to be false + end + + it "returns false on macOS when simulating Linux", :needs_macos do + described_class.clear + described_class.os = :linux + expect(described_class.treat_as_macos?).to be false + end + + it "returns true on Linux when simulating a generic macOS version", :needs_linux do + described_class.clear + described_class.os = :macos + expect(described_class.treat_as_macos?).to be true + end + + it "returns true on Linux when simulating a specific macOS version", :needs_linux do + described_class.clear + described_class.os = :monterey + expect(described_class.treat_as_macos?).to be true + end + end + + describe "::treat_as_linux?" do + it "returns true on Linux", :needs_linux do + described_class.clear + expect(described_class.treat_as_linux?).to be true + end + + it "returns false on macOS", :needs_macos do + described_class.clear + expect(described_class.treat_as_linux?).to be false + end + + it "returns true on macOS when simulating Linux", :needs_macos do + described_class.clear + described_class.os = :linux + expect(described_class.treat_as_linux?).to be true + end + + it "returns false on Linux when simulating a generic macOS version", :needs_linux do + described_class.clear + described_class.os = :macos + expect(described_class.treat_as_linux?).to be false + end + + it "returns false on Linux when simulating a specific macOS version", :needs_linux do + described_class.clear + described_class.os = :monterey + expect(described_class.treat_as_linux?).to be false + end + end + + describe "::current_arch" do + it "returns the current architecture" do + described_class.clear + expect(described_class.current_arch).to eq Hardware::CPU.type + end + + it "returns the simulated architecture" do + described_class.clear + simulated_arch = if Hardware::CPU.arm? + :intel + else + :arm + end + described_class.arch = simulated_arch + expect(described_class.current_arch).to eq simulated_arch + end + end + + describe "::current_os" do + it "returns the current macOS version on macOS", :needs_macos do + described_class.clear + expect(described_class.current_os).to eq MacOS.version.to_sym + end + + it "returns `:linux` on Linux", :needs_linux do + described_class.clear + expect(described_class.current_os).to eq :linux + end + + it "returns `:linux` when simulating Linux on macOS", :needs_macos do + described_class.clear + described_class.os = :linux + expect(described_class.current_os).to eq :linux + end + + it "returns `:macos` when simulating a generic macOS version on Linux", :needs_linux do + described_class.clear + described_class.os = :macos + expect(described_class.current_os).to eq :macos + end + + it "returns `:macos` when simulating a specific macOS version on Linux", :needs_linux do + described_class.clear + described_class.os = :monterey + expect(described_class.current_os).to eq :monterey + end + end +end From 34a1bc66188f94caeb830a282b78a0ac7132f098 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sat, 23 Jul 2022 02:58:50 +0200 Subject: [PATCH 03/20] Use `SimulateSystem` for `ignore_missing_libraries` --- Library/Homebrew/extend/os/linux/formula.rb | 13 ------ Library/Homebrew/formula.rb | 13 ++++-- Library/Homebrew/test/formula_spec.rb | 48 +++++++++++++++++++++ 3 files changed, 58 insertions(+), 16 deletions(-) diff --git a/Library/Homebrew/extend/os/linux/formula.rb b/Library/Homebrew/extend/os/linux/formula.rb index da2d162bdf..f3586103bc 100644 --- a/Library/Homebrew/extend/os/linux/formula.rb +++ b/Library/Homebrew/extend/os/linux/formula.rb @@ -23,17 +23,4 @@ class Formula sig { params(targets: T.nilable(T.any(Pathname, String))).void } def deuniversalize_machos(*targets); end - - class << self - undef ignore_missing_libraries - - def ignore_missing_libraries(*libs) - libraries = libs.flatten - if libraries.any? { |x| !x.is_a?(String) && !x.is_a?(Regexp) } - raise FormulaSpecificationError, "#{__method__} can handle Strings and Regular Expressions only" - end - - allowed_missing_libraries.merge(libraries) - end - end end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index f52caa3650..1f842d6aaa 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -3214,10 +3214,17 @@ class Formula end # Permit links to certain libraries that don't exist. Available on Linux only. - def ignore_missing_libraries(*) - return if Homebrew::SimulateSystem.linux? + def ignore_missing_libraries(*libs) + unless Homebrew::SimulateSystem.treat_as_linux? + raise FormulaSpecificationError, "#{__method__} is available on Linux only" + end - raise FormulaSpecificationError, "#{__method__} is available on Linux only" + libraries = libs.flatten + if libraries.any? { |x| !x.is_a?(String) && !x.is_a?(Regexp) } + raise FormulaSpecificationError, "#{__method__} can handle Strings and Regular Expressions only" + end + + allowed_missing_libraries.merge(libraries) end # @private diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index d4680abd7f..0883985623 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -1845,4 +1845,52 @@ describe Formula do expect(f.test).to eq(2) end end + + describe "#ignore_missing_libraries" do + after do + Homebrew::SimulateSystem.clear + end + + it "adds library to allowed_missing_libraries on Linux", :needs_linux do + Homebrew::SimulateSystem.clear + f = formula do + url "foo-1.0" + + ignore_missing_libraries "bar.so" + end + expect(f.class.allowed_missing_libraries.to_a).to eq(["bar.so"]) + end + + it "adds library to allowed_missing_libraries on macOS when simulating Linux", :needs_macos do + Homebrew::SimulateSystem.os = :linux + f = formula do + url "foo-1.0" + + ignore_missing_libraries "bar.so" + end + expect(f.class.allowed_missing_libraries.to_a).to eq(["bar.so"]) + end + + it "raises an error on macOS", :needs_macos do + Homebrew::SimulateSystem.clear + expect { + formula do + url "foo-1.0" + + ignore_missing_libraries "bar.so" + end + }.to raise_error("ignore_missing_libraries is available on Linux only") + end + + it "raises an error on Linux when simulating macOS", :needs_linux do + Homebrew::SimulateSystem.os = :macos + expect { + formula do + url "foo-1.0" + + ignore_missing_libraries "bar.so" + end + }.to raise_error("ignore_missing_libraries is available on Linux only") + end + end end From 91cf9f2ad8daabb1dbe845341350c8aae5c141a4 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sat, 23 Jul 2022 02:47:22 +0200 Subject: [PATCH 04/20] Use `SimulateSystem` for `uses_from_macos` deps --- .../Homebrew/extend/os/mac/software_spec.rb | 27 ------- Library/Homebrew/extend/os/software_spec.rb | 7 +- Library/Homebrew/software_spec.rb | 21 +++++- .../test/os/mac/software_spec_spec.rb | 51 ------------- Library/Homebrew/test/software_spec_spec.rb | 75 +++++++++++++++---- 5 files changed, 78 insertions(+), 103 deletions(-) delete mode 100644 Library/Homebrew/extend/os/mac/software_spec.rb delete mode 100644 Library/Homebrew/test/os/mac/software_spec_spec.rb diff --git a/Library/Homebrew/extend/os/mac/software_spec.rb b/Library/Homebrew/extend/os/mac/software_spec.rb deleted file mode 100644 index 1be80083e2..0000000000 --- a/Library/Homebrew/extend/os/mac/software_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -# typed: true -# frozen_string_literal: true - -# The Library/Homebrew/extend/os/software_spec.rb conditional logic will need to be more nuanced -# if this file ever includes more than `uses_from_macos`. -class SoftwareSpec - undef uses_from_macos - - def uses_from_macos(deps, bounds = {}) - if deps.is_a?(Hash) - bounds = deps.dup - deps = [bounds.shift].to_h - end - - @uses_from_macos_elements << deps - - bounds = bounds.transform_values { |v| MacOS::Version.from_symbol(v) } - - # Linux simulating macOS. Assume oldest macOS version. - return if Homebrew::EnvConfig.simulate_macos_on_linux? && !bounds.key?(:since) - - # macOS new enough for dependency to not be required. - return if MacOS.version >= bounds[:since] - - depends_on deps - end -end diff --git a/Library/Homebrew/extend/os/software_spec.rb b/Library/Homebrew/extend/os/software_spec.rb index 32f46468f7..1e6f8f529c 100644 --- a/Library/Homebrew/extend/os/software_spec.rb +++ b/Library/Homebrew/extend/os/software_spec.rb @@ -1,9 +1,4 @@ # typed: strict # frozen_string_literal: true -# This logic will need to be more nuanced if this file includes more than `uses_from_macos`. -if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux? - require "extend/os/mac/software_spec" -elsif OS.linux? - require "extend/os/linux/software_spec" -end +require "extend/os/linux/software_spec" if OS.linux? diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index c27f124aa6..14825ce168 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -162,12 +162,25 @@ class SoftwareSpec add_dep_option(dep) if dep end - def uses_from_macos(spec, _bounds = {}) - spec = [spec.dup.shift].to_h if spec.is_a?(Hash) + def uses_from_macos(deps, bounds = {}) + if deps.is_a?(Hash) + bounds = deps.dup + deps = [bounds.shift].to_h + end - @uses_from_macos_elements << spec + @uses_from_macos_elements << deps - depends_on(spec) + # Linux simulating macOS. Assume oldest macOS version. + return if Homebrew::EnvConfig.simulate_macos_on_linux? && !bounds.key?(:since) + + # macOS new enough for dependency to not be required. + if Homebrew::SimulateSystem.treat_as_macos? + current_os = MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os) + since_os = MacOS::Version.from_symbol(bounds[:since]) if bounds.key?(:since) + return if current_os >= since_os + end + + depends_on deps end def uses_from_macos_names diff --git a/Library/Homebrew/test/os/mac/software_spec_spec.rb b/Library/Homebrew/test/os/mac/software_spec_spec.rb deleted file mode 100644 index c6a72db735..0000000000 --- a/Library/Homebrew/test/os/mac/software_spec_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -# typed: false -# frozen_string_literal: true - -require "software_spec" - -describe SoftwareSpec do - subject(:spec) { described_class.new } - - describe "#uses_from_macos" do - before do - allow(OS).to receive(:mac?).and_return(true) - allow(OS::Mac).to receive(:version).and_return(OS::Mac::Version.from_symbol(:sierra)) - end - - it "adds a macOS dependency if the OS version meets requirements" do - spec.uses_from_macos("foo", since: :el_capitan) - - expect(spec.deps).to be_empty - expect(spec.uses_from_macos_elements.first).to eq("foo") - end - - it "doesn't add a macOS dependency if the OS version doesn't meet requirements" do - spec.uses_from_macos("foo", since: :high_sierra) - - expect(spec.deps.first.name).to eq("foo") - expect(spec.uses_from_macos_elements).to eq(["foo"]) - end - - it "works with tags" do - spec.uses_from_macos("foo" => :build, :since => :high_sierra) - - dep = spec.deps.first - - expect(dep.name).to eq("foo") - expect(dep.tags).to include(:build) - end - - it "doesn't add a dependency if no OS version is specified" do - spec.uses_from_macos("foo") - spec.uses_from_macos("bar" => :build) - - expect(spec.deps).to be_empty - end - - it "raises an error if passing invalid OS versions" do - expect { - spec.uses_from_macos("foo", since: :bar) - }.to raise_error(MacOSVersionError, "unknown or unsupported macOS version: :bar") - end - end -end diff --git a/Library/Homebrew/test/software_spec_spec.rb b/Library/Homebrew/test/software_spec_spec.rb index 284cf2211a..a737088803 100644 --- a/Library/Homebrew/test/software_spec_spec.rb +++ b/Library/Homebrew/test/software_spec_spec.rb @@ -135,27 +135,72 @@ describe SoftwareSpec do end end - describe "#uses_from_macos" do - it "allows specifying dependencies", :needs_linux do - spec.uses_from_macos("foo") + describe "#uses_from_macos", :needs_linux do + context "when running on Linux", :needs_linux do + it "allows specifying dependencies" do + spec.uses_from_macos("foo") - expect(spec.deps.first.name).to eq("foo") + expect(spec.deps.first.name).to eq("foo") + end + + it "works with tags" do + spec.uses_from_macos("foo" => :build) + + expect(spec.deps.first.name).to eq("foo") + expect(spec.deps.first.tags).to include(:build) + end + + it "ignores OS version specifications" do + spec.uses_from_macos("foo", since: :mojave) + spec.uses_from_macos("bar" => :build, :since => :mojave) + + expect(spec.deps.first.name).to eq("foo") + expect(spec.deps.last.name).to eq("bar") + expect(spec.deps.last.tags).to include(:build) + end end - it "works with tags", :needs_linux do - spec.uses_from_macos("foo" => :build) + context "when running on macOS", :needs_macos do + before do + allow(OS).to receive(:mac?).and_return(true) + allow(OS::Mac).to receive(:version).and_return(OS::Mac::Version.from_symbol(:sierra)) + end - expect(spec.deps.first.name).to eq("foo") - expect(spec.deps.first.tags).to include(:build) - end + it "adds a macOS dependency if the OS version meets requirements" do + spec.uses_from_macos("foo", since: :el_capitan) - it "ignores OS version specifications", :needs_linux do - spec.uses_from_macos("foo", since: :mojave) - spec.uses_from_macos("bar" => :build, :since => :mojave) + expect(spec.deps).to be_empty + expect(spec.uses_from_macos_elements.first).to eq("foo") + end - expect(spec.deps.first.name).to eq("foo") - expect(spec.deps.last.name).to eq("bar") - expect(spec.deps.last.tags).to include(:build) + it "doesn't add a macOS dependency if the OS version doesn't meet requirements" do + spec.uses_from_macos("foo", since: :high_sierra) + + expect(spec.deps.first.name).to eq("foo") + expect(spec.uses_from_macos_elements).to eq(["foo"]) + end + + it "works with tags" do + spec.uses_from_macos("foo" => :build, :since => :high_sierra) + + dep = spec.deps.first + + expect(dep.name).to eq("foo") + expect(dep.tags).to include(:build) + end + + it "doesn't add a dependency if no OS version is specified" do + spec.uses_from_macos("foo") + spec.uses_from_macos("bar" => :build) + + expect(spec.deps).to be_empty + end + + it "raises an error if passing invalid OS versions" do + expect { + spec.uses_from_macos("foo", since: :bar) + }.to raise_error(MacOSVersionError, "unknown or unsupported macOS version: :bar") + end end end From 7392f9811e6c5a03038b336d9560c6fa1d76682d Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sun, 24 Jul 2022 22:59:42 +0200 Subject: [PATCH 05/20] `Formulary`: use variations hash when installing from API --- Library/Homebrew/formulary.rb | 5 +++++ Library/Homebrew/test/formulary_spec.rb | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index df7bfff951..0ca6a8033e 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -136,6 +136,11 @@ module Formulary class_s = Formulary.class_s(name) json_formula = Homebrew::API::Formula.all_formulae[name] + bottle_tag = Utils::Bottles.tag.to_s + if json_formula.key?("variations") && json_formula["variations"].key?(bottle_tag) + json_formula = json_formula.merge(json_formula["variations"][bottle_tag]) + end + klass = Class.new(::Formula) do desc json_formula["desc"] homepage json_formula["homepage"] diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 6276ecf876..68eb82733e 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -260,6 +260,16 @@ describe Formulary do } end + let(:variations_json) do + { + "variations" => { + Utils::Bottles.tag.to_s => { + "dependencies" => ["dep", "variations_dep"], + }, + }, + } + end + before do allow(described_class).to receive(:loader_for).and_return(described_class::FormulaAPILoader.new(formula_name)) end @@ -303,6 +313,16 @@ describe Formulary do formula.install }.to raise_error("Cannot build from source from abstract formula.") end + + it "returns a Formula with variations when given a name", :needs_macos do + allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(variations_json) + allow(Utils::Bottles).to receive(:tag).and_return(:arm64_monterey) + + formula = described_class.factory(formula_name) + expect(formula).to be_kind_of(Formula) + expect(formula.deps.count).to eq 5 + expect(formula.deps.map(&:name).include?("variations_dep")).to be true + end end end From bae5abda82002a88de44d854213a7ea4e308b3a2 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Mon, 25 Jul 2022 08:49:19 +0200 Subject: [PATCH 06/20] Remove `uses_from_macos` dep duplication in `FormulaAPILoader` --- Library/Homebrew/formulary.rb | 22 +++++++++++++--------- Library/Homebrew/test/formulary_spec.rb | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 0ca6a8033e..1e2aca4d43 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -141,6 +141,12 @@ module Formulary json_formula = json_formula.merge(json_formula["variations"][bottle_tag]) end + uses_from_macos_names = json_formula["uses_from_macos"].map do |dep| + next dep unless dep.is_a? Hash + + dep.keys.first + end + klass = Class.new(::Formula) do desc json_formula["desc"] homepage json_formula["homepage"] @@ -181,20 +187,18 @@ module Formulary disable! date: disable_date, because: reason end - json_formula["build_dependencies"].each do |dep| - depends_on dep => :build - end - json_formula["dependencies"].each do |dep| + next if uses_from_macos_names.include? dep + depends_on dep end - json_formula["recommended_dependencies"].each do |dep| - depends_on dep => :recommended - end + [:build, :recommended, :optional].each do |type| + json_formula["#{type}_dependencies"].each do |dep| + next if uses_from_macos_names.include? dep - json_formula["optional_dependencies"].each do |dep| - depends_on dep => :optional + depends_on dep => type + end end json_formula["uses_from_macos"].each do |dep| diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 68eb82733e..b303cb3ec0 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -270,6 +270,16 @@ describe Formulary do } end + let(:linux_variations_json) do + { + "variations" => { + "x86_64_linux" => { + "dependencies" => ["dep", "uses_from_macos_dep"], + }, + }, + } + end + before do allow(described_class).to receive(:loader_for).and_return(described_class::FormulaAPILoader.new(formula_name)) end @@ -323,6 +333,16 @@ describe Formulary do expect(formula.deps.count).to eq 5 expect(formula.deps.map(&:name).include?("variations_dep")).to be true end + + it "returns a Formula without duplicated deps and uses_from_macos with variations on Linux", :needs_linux do + allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(linux_variations_json) + allow(Utils::Bottles).to receive(:tag).and_return(:arm64_monterey) + + formula = described_class.factory(formula_name) + expect(formula).to be_kind_of(Formula) + expect(formula.deps.count).to eq 5 + expect(formula.deps.map(&:name).include?("variations_dep")).to be true + end end end From edc14c37866ce1d50f0e9f15e7b4d93923505bdd Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Mon, 25 Jul 2022 08:56:10 +0200 Subject: [PATCH 07/20] Fix style --- Library/Homebrew/test/formulary_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index b303cb3ec0..8e0708d692 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -335,7 +335,8 @@ describe Formulary do end it "returns a Formula without duplicated deps and uses_from_macos with variations on Linux", :needs_linux do - allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(linux_variations_json) + allow(Homebrew::API::Formula) + .to receive(:all_formulae).and_return formula_json_contents(linux_variations_json) allow(Utils::Bottles).to receive(:tag).and_return(:arm64_monterey) formula = described_class.factory(formula_name) From d4e5886571b4f64080dddf86c12b60ab47e484b7 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Mon, 25 Jul 2022 17:43:54 +0200 Subject: [PATCH 08/20] Simplify checking for variations hash availability Co-authored-by: Mike McQuaid --- Library/Homebrew/formulary.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 1e2aca4d43..b00c0a91f0 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -136,9 +136,10 @@ module Formulary class_s = Formulary.class_s(name) json_formula = Homebrew::API::Formula.all_formulae[name] - bottle_tag = Utils::Bottles.tag.to_s - if json_formula.key?("variations") && json_formula["variations"].key?(bottle_tag) - json_formula = json_formula.merge(json_formula["variations"][bottle_tag]) + if (bottle_tag = Utils::Bottles.tag.to_s.presence) && + (variations = json_formula["variations"].presence) && + (variation = variations[bottle_tag].presence) + json_formula = json_formula.merge(variation) end uses_from_macos_names = json_formula["uses_from_macos"].map do |dep| From 233cef08cf9f93ae2deeafdc710ca1b7ad520e72 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Mon, 25 Jul 2022 18:31:35 +0200 Subject: [PATCH 09/20] Fix style --- Library/Homebrew/formulary.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index b00c0a91f0..658b211c62 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -136,8 +136,8 @@ module Formulary class_s = Formulary.class_s(name) json_formula = Homebrew::API::Formula.all_formulae[name] - if (bottle_tag = Utils::Bottles.tag.to_s.presence) && - (variations = json_formula["variations"].presence) && + if (bottle_tag = Utils::Bottles.tag.to_s.presence) && + (variations = json_formula["variations"].presence) && (variation = variations[bottle_tag].presence) json_formula = json_formula.merge(variation) end From ebf109ade5e050e0b12a8c56d3e1282223d2d3d9 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Mon, 25 Jul 2022 19:22:15 +0200 Subject: [PATCH 10/20] Fix tests --- Library/Homebrew/test/formulary_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 8e0708d692..0fc043fe6b 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -326,7 +326,6 @@ describe Formulary do it "returns a Formula with variations when given a name", :needs_macos do allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(variations_json) - allow(Utils::Bottles).to receive(:tag).and_return(:arm64_monterey) formula = described_class.factory(formula_name) expect(formula).to be_kind_of(Formula) @@ -337,12 +336,11 @@ describe Formulary do it "returns a Formula without duplicated deps and uses_from_macos with variations on Linux", :needs_linux do allow(Homebrew::API::Formula) .to receive(:all_formulae).and_return formula_json_contents(linux_variations_json) - allow(Utils::Bottles).to receive(:tag).and_return(:arm64_monterey) formula = described_class.factory(formula_name) expect(formula).to be_kind_of(Formula) expect(formula.deps.count).to eq 5 - expect(formula.deps.map(&:name).include?("variations_dep")).to be true + expect(formula.deps.map(&:name).include?("uses_from_macos_dep")).to be true end end end From 4cc0e854ce98950cb75815dbf1813cfd8684195b Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Thu, 28 Jul 2022 09:18:16 -0400 Subject: [PATCH 11/20] Rename `treat_as_*?` to `simulating_or_running_on_*?` --- Library/Homebrew/extend/on_system.rb | 4 ++-- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/simulate_system.rb | 4 ++-- Library/Homebrew/software_spec.rb | 2 +- Library/Homebrew/test/simulate_system_spec.rb | 24 +++++++++---------- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Library/Homebrew/extend/on_system.rb b/Library/Homebrew/extend/on_system.rb index d151e26ddd..a7f7b3744f 100644 --- a/Library/Homebrew/extend/on_system.rb +++ b/Library/Homebrew/extend/on_system.rb @@ -25,7 +25,7 @@ module OnSystem return true if [:macos, *MacOSVersions::SYMBOLS.keys].include?(os_name) end - return Homebrew::SimulateSystem.send("treat_as_#{os_name}?") if BASE_OS_OPTIONS.include?(os_name) + return Homebrew::SimulateSystem.send("simulating_or_running_on_#{os_name}?") if BASE_OS_OPTIONS.include?(os_name) raise ArgumentError, "Invalid OS condition: #{os_name.inspect}" unless MacOSVersions::SYMBOLS.key?(os_name) @@ -33,7 +33,7 @@ module OnSystem raise ArgumentError, "Invalid OS `or_*` condition: #{or_condition.inspect}" end - return false if Homebrew::SimulateSystem.treat_as_linux? + return false if Homebrew::SimulateSystem.simulating_or_running_on_linux? base_os = MacOS::Version.from_symbol(os_name) current_os = MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 1f842d6aaa..d2f9ea56f2 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -3215,7 +3215,7 @@ class Formula # Permit links to certain libraries that don't exist. Available on Linux only. def ignore_missing_libraries(*libs) - unless Homebrew::SimulateSystem.treat_as_linux? + unless Homebrew::SimulateSystem.simulating_or_running_on_linux? raise FormulaSpecificationError, "#{__method__} is available on Linux only" end diff --git a/Library/Homebrew/simulate_system.rb b/Library/Homebrew/simulate_system.rb index c93791afb9..de61eabef7 100644 --- a/Library/Homebrew/simulate_system.rb +++ b/Library/Homebrew/simulate_system.rb @@ -32,14 +32,14 @@ module Homebrew end sig { returns(T::Boolean) } - def treat_as_macos? + def simulating_or_running_on_macos? return OS.mac? if @os.blank? [:macos, *MacOSVersions::SYMBOLS.keys].include?(@os) end sig { returns(T::Boolean) } - def treat_as_linux? + def simulating_or_running_on_linux? return OS.linux? if @os.blank? @os == :linux diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 14825ce168..30e9856d83 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -174,7 +174,7 @@ class SoftwareSpec return if Homebrew::EnvConfig.simulate_macos_on_linux? && !bounds.key?(:since) # macOS new enough for dependency to not be required. - if Homebrew::SimulateSystem.treat_as_macos? + if Homebrew::SimulateSystem.simulating_or_running_on_macos? current_os = MacOS::Version.from_symbol(Homebrew::SimulateSystem.current_os) since_os = MacOS::Version.from_symbol(bounds[:since]) if bounds.key?(:since) return if current_os >= since_os diff --git a/Library/Homebrew/test/simulate_system_spec.rb b/Library/Homebrew/test/simulate_system_spec.rb index 9994b71fea..0b72700d9f 100644 --- a/Library/Homebrew/test/simulate_system_spec.rb +++ b/Library/Homebrew/test/simulate_system_spec.rb @@ -8,63 +8,63 @@ describe Homebrew::SimulateSystem do described_class.clear end - describe "::treat_as_macos?" do + describe "::simulating_or_running_on_macos?" do it "returns true on macOS", :needs_macos do described_class.clear - expect(described_class.treat_as_macos?).to be true + expect(described_class.simulating_or_running_on_macos?).to be true end it "returns false on Linux", :needs_linux do described_class.clear - expect(described_class.treat_as_macos?).to be false + expect(described_class.simulating_or_running_on_macos?).to be false end it "returns false on macOS when simulating Linux", :needs_macos do described_class.clear described_class.os = :linux - expect(described_class.treat_as_macos?).to be false + expect(described_class.simulating_or_running_on_macos?).to be false end it "returns true on Linux when simulating a generic macOS version", :needs_linux do described_class.clear described_class.os = :macos - expect(described_class.treat_as_macos?).to be true + expect(described_class.simulating_or_running_on_macos?).to be true end it "returns true on Linux when simulating a specific macOS version", :needs_linux do described_class.clear described_class.os = :monterey - expect(described_class.treat_as_macos?).to be true + expect(described_class.simulating_or_running_on_macos?).to be true end end - describe "::treat_as_linux?" do + describe "::simulating_or_running_on_linux?" do it "returns true on Linux", :needs_linux do described_class.clear - expect(described_class.treat_as_linux?).to be true + expect(described_class.simulating_or_running_on_linux?).to be true end it "returns false on macOS", :needs_macos do described_class.clear - expect(described_class.treat_as_linux?).to be false + expect(described_class.simulating_or_running_on_linux?).to be false end it "returns true on macOS when simulating Linux", :needs_macos do described_class.clear described_class.os = :linux - expect(described_class.treat_as_linux?).to be true + expect(described_class.simulating_or_running_on_linux?).to be true end it "returns false on Linux when simulating a generic macOS version", :needs_linux do described_class.clear described_class.os = :macos - expect(described_class.treat_as_linux?).to be false + expect(described_class.simulating_or_running_on_linux?).to be false end it "returns false on Linux when simulating a specific macOS version", :needs_linux do described_class.clear described_class.os = :monterey - expect(described_class.treat_as_linux?).to be false + expect(described_class.simulating_or_running_on_linux?).to be false end end From c42169249e6dce5eb39239eb314873977ba9e57b Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Thu, 28 Jul 2022 22:02:31 +0800 Subject: [PATCH 12/20] cmd/update: stop fsmonitor after all Git operations complete Also, skip the status check, as that doesn't really help us. --- Library/Homebrew/cmd/update.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 1aed9905cd..7b9b2ad729 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -556,12 +556,6 @@ EOS [[ -d "${DIR}/.git" ]] || continue cd "${DIR}" || continue - # Git's fsmonitor daemon will not release our lock unless we stop it. - if git fsmonitor--daemon status &>/dev/null - then - git fsmonitor--daemon stop 2>/dev/null - fi - if ! git config --local --get remote.origin.url &>/dev/null then opoo "No remote 'origin' in ${DIR}, skipping update!" @@ -746,6 +740,9 @@ EOS merge_or_rebase "${DIR}" "${TAP_VAR}" "${UPSTREAM_BRANCH}" [[ -n "${HOMEBREW_VERBOSE}" ]] && echo fi + + # Git's fsmonitor daemon will not release our lock unless we stop it. + git fsmonitor--daemon stop 2>/dev/null done if [[ -n "${HOMEBREW_INSTALL_FROM_API}" ]] From 5e60d54e709642014c8fcd1d8e30215165ce582d Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Thu, 28 Jul 2022 22:20:07 +0800 Subject: [PATCH 13/20] update: disable Git fsmonitor for all Homebrew repositories Stopping the fsmonitor doesn't seem to work, so let's just prevent the fsmonitor from watching our repositories. --- Library/Homebrew/cmd/update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 7b9b2ad729..c358e439a3 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -556,6 +556,9 @@ EOS [[ -d "${DIR}/.git" ]] || continue cd "${DIR}" || continue + # Git's fsmonitor prevents the release of our locks + git config --bool core.fsmonitor false + if ! git config --local --get remote.origin.url &>/dev/null then opoo "No remote 'origin' in ${DIR}, skipping update!" @@ -740,9 +743,6 @@ EOS merge_or_rebase "${DIR}" "${TAP_VAR}" "${UPSTREAM_BRANCH}" [[ -n "${HOMEBREW_VERBOSE}" ]] && echo fi - - # Git's fsmonitor daemon will not release our lock unless we stop it. - git fsmonitor--daemon stop 2>/dev/null done if [[ -n "${HOMEBREW_INSTALL_FROM_API}" ]] From 506daa1a09d39438681051e3e2a03f0c3f1e506b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Jul 2022 18:03:51 +0000 Subject: [PATCH 14/20] build(deps): bump bootsnap from 1.12.0 to 1.13.0 in /Library/Homebrew Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.12.0 to 1.13.0. - [Release notes](https://github.com/Shopify/bootsnap/releases) - [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md) - [Commits](https://github.com/Shopify/bootsnap/compare/v1.12.0...v1.13.0) --- updated-dependencies: - dependency-name: bootsnap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Library/Homebrew/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 549e4251a3..6499d238a7 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -11,7 +11,7 @@ GEM public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) bindata (2.4.10) - bootsnap (1.12.0) + bootsnap (1.13.0) msgpack (~> 1.2) byebug (11.1.3) coderay (1.1.3) From f45114cfaefa13d3cb3de3533e3289da726deda8 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Thu, 28 Jul 2022 18:07:46 +0000 Subject: [PATCH 15/20] brew vendor-gems: commit updates. --- Library/Homebrew/vendor/bundle/bundler/setup.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 7fc5627185..b0b852f339 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -15,8 +15,8 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ast-2.4.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/bindata-2.4.10/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-15/2.6.0-static/msgpack-1.5.4" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/msgpack-1.5.4/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-15/2.6.0-static/bootsnap-1.12.0" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/bootsnap-1.12.0/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-15/2.6.0-static/bootsnap-1.13.0" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/bootsnap-1.13.0/lib" $:.unshift "#{path}/" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-15/2.6.0-static/byebug-11.1.3" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/byebug-11.1.3/lib" From cbff83898e586c7a58d5580fc81e780cb7363682 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Wed, 19 Jan 2022 03:00:55 +0800 Subject: [PATCH 16/20] formula_auditor: audit for deprecated dependencies Closes #12748. --- Library/Homebrew/formula_auditor.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index a06941104d..1a7292a244 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -307,6 +307,13 @@ module Homebrew EOS end + if dep_f.deprecated? && !formula.deprecated? && !formula.disabled? + problem <<~EOS + Dependency '#{dep.name}' is deprecated but has un-deprecated dependents. Either + un-deprecate '#{dep.name}' or deprecate all of its dependents. + EOS + end + # we want to allow uses_from_macos for aliases but not bare dependencies if self.class.aliases.include?(dep.name) && spec.uses_from_macos_names.exclude?(dep.name) problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'." From 7c7a92e8fb0b80b23ece1baee618dd5326d139aa Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Fri, 29 Jul 2022 20:10:05 +0800 Subject: [PATCH 17/20] formula_auditor: clean up error wording --- Library/Homebrew/formula_auditor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 1a7292a244..f7bbb09cc0 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -310,7 +310,7 @@ module Homebrew if dep_f.deprecated? && !formula.deprecated? && !formula.disabled? problem <<~EOS Dependency '#{dep.name}' is deprecated but has un-deprecated dependents. Either - un-deprecate '#{dep.name}' or deprecate all of its dependents. + un-deprecate '#{dep.name}' or deprecate it and all of its dependents. EOS end From 291eacd4825273693f0ce117e3076d7bb1b2ae9f Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Fri, 29 Jul 2022 09:30:18 -0700 Subject: [PATCH 18/20] audit_glibc: Fix the error message "The glibc version must be 2.35" should have read "The glibc version must be 2.23". --- Library/Homebrew/formula_auditor.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index a06941104d..880aaf3674 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -410,13 +410,10 @@ module Homebrew end def audit_glibc - return if formula.name != "glibc" return unless @core_tap + return if formula.name != "glibc" || formula.version.to_s == OS::CI_GLIBC_VERSION - version = formula.version.to_s - return if version == OS::CI_GLIBC_VERSION - - problem "The glibc version must be #{version}, as this is the version used by our CI on Linux. " \ + problem "The glibc version must be #{OS::CI_GLIBC_VERSION}, as this is the version used by our CI on Linux. " \ "Glibc is for users who have a system Glibc with a lower version, " \ "which allows them to use our Linux bottles, which were compiled against system Glibc on CI." end From 1ac5fc05bd4c46c5f5812428790f465f531dec4e Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Fri, 29 Jul 2022 10:13:09 -0700 Subject: [PATCH 19/20] audit_glibc: Permit glibc 2.35 See https://github.com/Homebrew/brew/issues/13619 --- Library/Homebrew/formula_auditor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 880aaf3674..179e7b3510 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -411,7 +411,7 @@ module Homebrew def audit_glibc return unless @core_tap - return if formula.name != "glibc" || formula.version.to_s == OS::CI_GLIBC_VERSION + return if formula.name != "glibc" || [OS::CI_GLIBC_VERSION, "2.35"].include?(formula.version.to_s) problem "The glibc version must be #{OS::CI_GLIBC_VERSION}, as this is the version used by our CI on Linux. " \ "Glibc is for users who have a system Glibc with a lower version, " \ From 7d1197e8eb938f30c3db9a8754c5557a8c08ed5c Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Fri, 29 Jul 2022 14:06:51 -0700 Subject: [PATCH 20/20] audit_glibc: Permit glibc 2.27, 2.31, or 2.35 --- Library/Homebrew/formula_auditor.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 179e7b3510..1a6f60b98d 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -411,7 +411,8 @@ module Homebrew def audit_glibc return unless @core_tap - return if formula.name != "glibc" || [OS::CI_GLIBC_VERSION, "2.35"].include?(formula.version.to_s) + return if formula.name != "glibc" + return if [OS::CI_GLIBC_VERSION, "2.27", "2.31", "2.35"].include?(formula.version.to_s) problem "The glibc version must be #{OS::CI_GLIBC_VERSION}, as this is the version used by our CI on Linux. " \ "Glibc is for users who have a system Glibc with a lower version, " \