Use RUBY_PATH and HOMEBREW_RUBY_EXEC_ARGS more universally

This commit is contained in:
Bo Anderson 2022-05-30 04:19:15 +01:00
parent fae972c9d7
commit 0a1762bd14
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
4 changed files with 10 additions and 11 deletions

View File

@ -32,7 +32,7 @@ module Homebrew
if args.stackprof?
Homebrew.install_gem_setup_path! "stackprof"
with_env HOMEBREW_STACKPROF: "1" do
system ENV["HOMEBREW_RUBY_PATH"], brew_rb, *args.named
system RUBY_PATH, brew_rb, *args.named
end
output_filename = "prof/d3-flamegraph.html"
safe_system "stackprof --d3-flamegraph prof/stackprof.dump > #{output_filename}"

View File

@ -33,10 +33,9 @@ module Homebrew
ruby_sys_args << "-e #{args.e}" if args.e
ruby_sys_args += args.named
exec RUBY_PATH,
ENV["HOMEBREW_RUBY_WARNINGS"],
exec(*HOMEBREW_RUBY_EXEC_ARGS,
"-I", $LOAD_PATH.join(File::PATH_SEPARATOR),
"-rglobal", "-rdev-cmd/irb",
*ruby_sys_args
*ruby_sys_args)
end
end

View File

@ -1084,12 +1084,12 @@ class FormulaInstaller
sig { void }
def post_install
args = %W[
nice #{RUBY_PATH}
#{ENV["HOMEBREW_RUBY_WARNINGS"]}
-I #{$LOAD_PATH.join(File::PATH_SEPARATOR)}
--
#{HOMEBREW_LIBRARY_PATH}/postinstall.rb
args = [
"nice",
*HOMEBREW_RUBY_EXEC_ARGS,
"-I", $LOAD_PATH.join(File::PATH_SEPARATOR),
"--",
HOMEBREW_LIBRARY_PATH/"postinstall.rb"
]
# Use the formula from the keg if:

View File

@ -5,7 +5,7 @@ homebrew_bootsnap_enabled = !ENV["HOMEBREW_NO_BOOTSNAP"] && ENV["HOMEBREW_BOOTSN
# portable ruby doesn't play nice with bootsnap
# Can't use .exclude? here because we haven't required active_support yet.
homebrew_bootsnap_enabled &&= !ENV["HOMEBREW_RUBY_PATH"].to_s.include?("/vendor/portable-ruby/") # rubocop:disable Rails/NegateInclude
homebrew_bootsnap_enabled &&= !RUBY_PATH.to_s.include?("/vendor/portable-ruby/") # rubocop:disable Rails/NegateInclude
homebrew_bootsnap_enabled &&= if ENV["HOMEBREW_MACOS_VERSION"]
# Apple Silicon doesn't play nice with bootsnap