mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

`MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?` should never be true. In its earliest form, this would raise a bare RuntimeError in an effort to have the bug reported. Later, it was changed to silently disable superenv. But we don't want to do that. If there's a bug, or the user's system is misconfigured, we want to know, so that we can fix the bug, or the user can fix their system. So let's remove the condition.
32 lines
585 B
Ruby
32 lines
585 B
Ruby
require 'hardware'
|
|
require 'extend/ENV/shared'
|
|
require 'extend/ENV/std'
|
|
require 'extend/ENV/super'
|
|
|
|
def superenv?
|
|
Superenv.bin && Superenv.bin.directory? && ARGV.env != "std"
|
|
end
|
|
|
|
module EnvActivation
|
|
def activate_extensions!
|
|
if superenv?
|
|
extend(Superenv)
|
|
else
|
|
extend(Stdenv)
|
|
end
|
|
end
|
|
|
|
def with_build_environment
|
|
old_env = to_hash.dup
|
|
tmp_env = to_hash.dup.extend(EnvActivation)
|
|
tmp_env.activate_extensions!
|
|
tmp_env.setup_build_environment
|
|
replace(tmp_env)
|
|
yield
|
|
ensure
|
|
replace(old_env)
|
|
end
|
|
end
|
|
|
|
ENV.extend(EnvActivation)
|