Merge pull request #15893 from Bo98/prof-env

dev-cmd/prof: bleed less of the environment from gem installs
This commit is contained in:
Mike McQuaid 2023-08-21 15:50:44 +02:00 committed by GitHub
commit 8dd2073d84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ module Homebrew
def prof
args = prof_args.parse
Homebrew.install_bundler_gems!(groups: ["prof"])
Homebrew.install_bundler_gems!(groups: ["prof"], setup_path: false)
brew_rb = (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path
FileUtils.mkdir_p "prof"
@ -40,6 +40,8 @@ module Homebrew
raise UsageError, "`#{cmd}` is an unknown command!"
end
Homebrew.setup_gem_environment!
if args.stackprof?
with_env HOMEBREW_STACKPROF: "1" do
system(*HOMEBREW_RUBY_EXEC_ARGS, brew_rb, *args.named)