Merge pull request #20624 from Homebrew/later_pathname_prepend

Make `Pathname.prepend WriteMkpathExtension` as late as possible.
This commit is contained in:
Mike McQuaid 2025-09-02 16:19:44 +00:00 committed by GitHub
commit ab980dc3b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 5 deletions

View File

@ -183,6 +183,8 @@ class Build
(formula.logs/"00.options.out").write \
"#{formula.full_name} #{formula.build.used_options.sort.join(" ")}".strip
Pathname.prepend WriteMkpathExtension
formula.install
stdlibs = detect_stdlibs
@ -247,8 +249,6 @@ begin
options = Options.create(args.flags_only)
build = Build.new(formula, options, args:)
Pathname.prepend WriteMkpathExtension
build.install
# Any exception means the build did not complete.
# The `case` for what to do per-exception class is further down.

View File

@ -32,8 +32,8 @@ begin
end
Pathname.prepend WriteMkpathExtension
formula.run_post_install
# Handle all possible exceptions.
rescue Exception => e # rubocop:disable Lint/RescueException
error_pipe&.puts e.to_json

View File

@ -45,10 +45,9 @@ begin
formula.extend(Debrew::Formula)
end
Pathname.prepend WriteMkpathExtension
ENV.extend(Stdenv)
ENV.setup_build_environment(formula:, testing_formula: true)
Pathname.prepend WriteMkpathExtension
# tests can also return false to indicate failure
run_test = proc { |_ = nil| raise "test returned false" if formula.run_test(keep_tmp: args.keep_tmp?) == false }