Regenerate runtime_dependencies after installation

This ensures the we’re calculating we’ve run `fix_dynamic_linkage` so
that their results are consistent with what we’re actually pouring.

Combined with the linkage cache (which will be enabled by default in
future) this has very little performance overhead for consistently
Correct tab results.

As a result, don’t bother looking at opportunistically linked
dependencies when creating a tab by default but only do so after
installation has completed.

Finally, only output the caveats and summary after all these
operations have completed.
This commit is contained in:
Mike McQuaid 2018-06-01 13:29:46 +01:00
parent 61617a257e
commit e9a66bff14
2 changed files with 13 additions and 6 deletions

View File

@ -604,17 +604,19 @@ class FormulaInstaller
post_install
end
caveats
ohai "Summary" if verbose? || show_summary_heading?
puts summary
# Updates the cache for a particular formula after doing an install
CacheStoreDatabase.use(:linkage) do |db|
break unless db.created?
LinkageChecker.new(keg, formula, cache_db: db)
end
# Update tab with actual runtime dependencies
tab = Tab.for_keg(keg)
Tab.clear_cache
tab.runtime_dependencies =
formula.runtime_dependencies(read_from_tab: false)
tab.write
# let's reset Utils.git_available? if we just installed git
Utils.clear_git_available_cache if formula.name == "git"
@ -623,6 +625,11 @@ class FormulaInstaller
!DevelopmentTools.curl_handles_most_https_certificates?
ENV["HOMEBREW_CURL"] = formula.opt_bin/"curl"
end
caveats
ohai "Summary" if verbose? || show_summary_heading?
puts summary
ensure
unlock
end

View File

@ -17,7 +17,7 @@ class Tab < OpenStruct
# Instantiates a Tab for a new installation of a formula.
def self.create(formula, compiler, stdlib)
build = formula.build
runtime_deps = formula.runtime_dependencies(read_from_tab: false)
runtime_deps = formula.declared_runtime_dependencies
attributes = {
"homebrew_version" => HOMEBREW_VERSION,
"used_options" => build.used_options.as_flags,