test-bot: uninstall build deps before bottle test.
This should hopefully more often catch the situation where things are marked as build dependencies incorrectly. Closes Homebrew/homebrew#37927. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
e7053ac35a
commit
a4f474ddb9
@ -366,11 +366,19 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "brew", "uses", canonical_formula_name
|
test "brew", "uses", canonical_formula_name
|
||||||
dependencies = Utils.popen_read("brew", "deps", canonical_formula_name).split("\n")
|
installed = Utils.popen_read("brew", "list").split("\n")
|
||||||
dependencies -= Utils.popen_read("brew", "list").split("\n")
|
dependencies = Utils.popen_read("brew", "deps", "--skip-optional",
|
||||||
|
canonical_formula_name).split("\n")
|
||||||
|
dependencies -= installed
|
||||||
unchanged_dependencies = dependencies - @formulae
|
unchanged_dependencies = dependencies - @formulae
|
||||||
changed_dependences = dependencies - unchanged_dependencies
|
changed_dependences = dependencies - unchanged_dependencies
|
||||||
|
|
||||||
|
runtime_dependencies = Utils.popen_read("brew", "deps",
|
||||||
|
"--skip-build", "--skip-optional",
|
||||||
|
canonical_formula_name).split("\n")
|
||||||
|
build_dependencies = dependencies - runtime_dependencies
|
||||||
|
unchanged_build_dependencies = build_dependencies - @formulae
|
||||||
|
|
||||||
dependents = Utils.popen_read("brew", "uses", "--skip-build", "--skip-optional", canonical_formula_name).split("\n")
|
dependents = Utils.popen_read("brew", "uses", "--skip-build", "--skip-optional", canonical_formula_name).split("\n")
|
||||||
dependents -= @formulae
|
dependents -= @formulae
|
||||||
dependents = dependents.map {|d| Formulary.factory(d)}
|
dependents = dependents.map {|d| Formulary.factory(d)}
|
||||||
@ -467,6 +475,10 @@ module Homebrew
|
|||||||
bottle_filename =
|
bottle_filename =
|
||||||
bottle_step.output.gsub(/.*(\.\/\S+#{bottle_native_regex}).*/m, '\1')
|
bottle_step.output.gsub(/.*(\.\/\S+#{bottle_native_regex}).*/m, '\1')
|
||||||
test "brew", "uninstall", "--force", canonical_formula_name
|
test "brew", "uninstall", "--force", canonical_formula_name
|
||||||
|
if unchanged_build_dependencies.any?
|
||||||
|
test "brew", "uninstall", "--force", *unchanged_build_dependencies
|
||||||
|
unchanged_dependencies -= unchanged_build_dependencies
|
||||||
|
end
|
||||||
test "brew", "install", bottle_filename
|
test "brew", "install", bottle_filename
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -500,7 +512,7 @@ module Homebrew
|
|||||||
test "brew", "uninstall", "--devel", "--force", canonical_formula_name
|
test "brew", "uninstall", "--devel", "--force", canonical_formula_name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
test "brew", "uninstall", "--force", *unchanged_dependencies unless unchanged_dependencies.empty?
|
test "brew", "uninstall", "--force", *unchanged_dependencies if unchanged_dependencies.any?
|
||||||
end
|
end
|
||||||
|
|
||||||
def homebrew
|
def homebrew
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user