Brew: minimum os requirement is not being inherited

Created on 9 Oct 2016  路  7Comments  路  Source: Homebrew/brew

In https://bot.brew.sh/job/Homebrew%20Core/8962/version=yosemite/console for https://github.com/Homebrew/homebrew-core/pull/5710 the build on Yosemite of vapoursynth causes CI failure because vapoursynth depends on zimg, for which the PR sets a minimum macOS requirement of El Capitan.

So for the time being I'm redundantly setting a minimum macOS requirement of El Capitan on vapoursynth as well to prevent the CI failure.

However, I believe this used to work transparently and reverse dependencies would correctly have an implicit minimum macOS requirement if any of their dependencies did. I'm not sure when or what broke this.

bug outdated

All 7 comments

I think this diff to test-bot may fix it:

diff --git a/cmd/brew-test-bot.rb b/cmd/brew-test-bot.rb
index ca67bd7..cc08d02 100755
--- a/cmd/brew-test-bot.rb
+++ b/cmd/brew-test-bot.rb
@@ -446,7 +446,12 @@ module Homebrew
     end

     def satisfied_requirements?(formula, spec, dependency = nil)
-      requirements = formula.send(spec).requirements
+      requirements = formula.requirements
+      deps_requirements = formula.send(spec).deps.inject(Set.new) do |reqs, f|
+        f = f.to_formula
+        f.requirements.each { |r| reqs << r } if f
+      end
+      deps_requirements.each { |r| requirements << r }

       unsatisfied_requirements = requirements.reject do |requirement|
         satisfied = false

(I know this is a relatively old ticket, but...)

I think that the best solution would be to flatten all of the dependencies into the generated Formula object. Certain commands, like brew deps, seem to be doing this already. If they're put into the Formula object, then regardless of the command that's run, they'll show up as expected.

Currently I'm speaking from not only very little knowledge of how Homebrew functions internally, but Ruby in general. Apologies that I can't be of much more help... 馃檨

Currently I'm speaking from not only very little knowledge of how Homebrew functions internally, but Ruby in general. Apologies that I can't be of much more help... 馃檨

@vinyldarkscratch We appreciate the enthusiasm but please avoid chiming in with comments on this and other issues/PRs unless you want to ask questions to be able to work on this. https://github.com/Homebrew/brew#contributing will give you input on how best to contribute to Homebrew.

@vinyldarkscratch My apologies, I've seen you've contributed a bunch to Homebrew/homebrew-core. Would you like help getting started in Homebrew/brew?

@MikeMcQuaid At first I was actually planning on tackling this one, though when looking through Homebrew鈥檚 code, I realized I should probably learn Ruby more (I鈥檓 a Python dev, though used a bit of Ruby for RPG Maker). So, I thought to leave my opinion for whoever would work on it next, if it wasn鈥檛 me again. But that makes sense, I鈥檒l watch out for next time!

As for getting started in this repo, I would love that, yes. Any way that I can help out! 馃槉

@vinyldarkscratch I think working on Homebrew could be a good way to learn Ruby, it was for me! In this case the right solution is for the computation of Requirements to consider the currently active software_specfor an installed formula. Shout if you have other questions!

@MikeMcQuaid Sounds good, I鈥檒l definitely be doing my best to learn Ruby as much as possible! And hopefully soon, even tackle this issue, amongst other ones.馃槈

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cfredhart picture cfredhart  路  4Comments

VagelisD picture VagelisD  路  3Comments

fxcoudert picture fxcoudert  路  3Comments

JustinTArthur picture JustinTArthur  路  3Comments

JaKXz picture JaKXz  路  3Comments