Skip to content

Commit

Permalink
test_formulae: relax cache invalidation criteria
Browse files Browse the repository at this point in the history
We don't need to throw out our cached bottle if the only dependencies
that have changed are build- or test-only.
  • Loading branch information
carlocab committed Sep 29, 2024
1 parent ffa1754 commit 08e518e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/test_formulae.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,15 @@ def artifact_cache_valid?(formula, formulae_dependents: false)
return false if sha.blank?
return false unless no_diff?(formula, sha)

formula.recursive_dependencies.all? do |dep|
recursive_dependencies = if formulae_dependents
formula.recursive_dependencies
else
formula.recursive_dependencies do |_, dep|
Dependency.prune if dep.build? || dep.test?
end
end

recursive_dependencies.all? do |dep|
no_diff?(dep.to_formula, sha)
end
end
Expand Down

0 comments on commit 08e518e

Please sign in to comment.