Merge pull request #12158 from FnControlOption/patch-7
build: delete post_superenv_hacks
This commit is contained in:
commit
9b42a104ee
@ -35,14 +35,6 @@ class Build
|
||||
end
|
||||
end
|
||||
|
||||
def post_superenv_hacks
|
||||
# Only allow Homebrew-approved directories into the PATH, unless
|
||||
# a formula opts-in to allowing the user's path.
|
||||
return if !formula.env.userpaths? && reqs.none? { |rq| rq.env.userpaths? }
|
||||
|
||||
ENV.userpaths!
|
||||
end
|
||||
|
||||
def effective_build_options_for(dependent)
|
||||
args = dependent.build.used_options
|
||||
args |= Tab.for_formula(dependent).used_options
|
||||
@ -92,7 +84,6 @@ class Build
|
||||
build_bottle: args.build_bottle?,
|
||||
bottle_arch: args.bottle_arch,
|
||||
)
|
||||
post_superenv_hacks
|
||||
reqs.each do |req|
|
||||
req.modify_build_environment(
|
||||
env: args.env, cc: args.cc, build_bottle: args.build_bottle?, bottle_arch: args.bottle_arch,
|
||||
|
@ -29,11 +29,6 @@ class BuildEnvironment
|
||||
@settings.include? :std
|
||||
end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def userpaths?
|
||||
@settings.include? :userpaths
|
||||
end
|
||||
|
||||
# DSL for specifying build environment settings.
|
||||
module DSL
|
||||
extend T::Sig
|
||||
|
@ -4,8 +4,6 @@
|
||||
require "build_environment"
|
||||
|
||||
describe BuildEnvironment do
|
||||
alias_matcher :use_userpaths, :be_userpaths
|
||||
|
||||
let(:env) { described_class.new }
|
||||
|
||||
describe "#<<" do
|
||||
@ -31,39 +29,17 @@ describe BuildEnvironment do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#userpaths?" do
|
||||
it "returns true if the environment contains :userpaths" do
|
||||
env << :userpaths
|
||||
expect(env).to use_userpaths
|
||||
end
|
||||
|
||||
it "returns false if the environment does not contain :userpaths" do
|
||||
expect(env).not_to use_userpaths
|
||||
end
|
||||
end
|
||||
|
||||
describe BuildEnvironment::DSL do
|
||||
subject(:build_environment_dsl) { double.extend(described_class) }
|
||||
|
||||
context "with a single argument" do
|
||||
before do
|
||||
build_environment_dsl.instance_eval do
|
||||
env :userpaths
|
||||
end
|
||||
end
|
||||
|
||||
its(:env) { is_expected.to use_userpaths }
|
||||
end
|
||||
|
||||
context "with multiple arguments" do
|
||||
before do
|
||||
build_environment_dsl.instance_eval do
|
||||
env :userpaths, :std
|
||||
env :std
|
||||
end
|
||||
end
|
||||
|
||||
its(:env) { is_expected.to be_std }
|
||||
its(:env) { is_expected.to use_userpaths }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user