Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Recommended and Optionals #1604

Closed
anagrius opened this Issue · 14 comments

7 participants

@anagrius

Am I right in saying that specifying a dependency as recommended or optional has not effect? You can't specify which options you want to install a formula with.

I can see the problems such a feature would cause with the current naming convention of /. And also one would have to explicitly specify the variant on depends_on.

Are there any development on this topic? I know I could use it. Or is it anything you would like someone to work on?

@adamv
Owner

Right, any deps that are specified will be installed, and if any dep installs fail, everything will fail.

Specifying which optional deps to compile will likely be part of a higher-level, better UI tool, which then calls brew underneath to install.

We're open to suggestions.

@anagrius

Ok.

I updated the ffmpeg formula to reflect some of my ideas with a few extra examples.

Try and take a look at: http://gist.github.com/439951

This would retain backwards compatibility with current formulae.

This would of course also require the brew install to accept and option like:

brew install --features=a,b,c foo

Before I begin looking any further at it I would love some feedback. I might be completely far off with this?

@mikemcquaid
Owner

@adamv Was there any progress on this?

@mikemcquaid
Owner

@adamv @mxcl @mistydemeo @Sharpie @jacknagel I think we should remove recommended/optional or do something with them. The current in-between stage is rather confusing.

@jacknagel
Owner

I always imagined that optional would do something like "if dep is installed, use it, otherwise ignore it", but I don't know that recommended could ever be anything other than an annotation.

@Sharpie
Collaborator

I think we should remove them. It doesn't seem like they will be used when options are re-factored for inter-formula dependencies.

@mikemcquaid
Owner

Agreed @jacknagel about optional, that sounds reasonable. Even then I think that's handled enough already using options. Agreed with @Sharpie too. Will wait for a few more OKs and then might purge them.

@jacknagel
Owner

That being said, I'm not married to :optional either. I'd be OK with removing it.

It doesn't seem like they will be used when options are re-factored for inter-formula dependencies.

Good point, :optional will probably be supplanted by more specific "this option requires this dep" type stuff.

@mxcl
Owner

I started adding these annotations in the early days in case it would later become possible to make use of them. I don't see why there is need to remove them, at the very least it is still useful metadata for people reading the formula. And hopefully we can figure out how to make them more useful in general.

@mxcl
Owner

Yes optional was meant to mean, if the install of the dep fails, you can still install this formula. Recommended was meant to allow the user to opt out if they like, because it is a good idea to have it, but the formula will still install without it.

@mistydemeo
Owner

I can see :optional as being useful in formulae with very large numbers of requirements, e.g. ffmpeg, where providing the user with 10+ commandline switches would be overwhelming. That's more of an edge case than the norm.

@mikemcquaid
Owner

I think it's a bit confusing/messy to have them and not use them. Agreed about edge cases but I'd also personally rather install the minimum number of dependencies required, dunno about others. Won't remove them.

@adamv
Owner

One way to use options (manually) is to install the ones you want by hand, then install the main formula using --ignore-dependencies. UI tooling can help with this.

@adamv
Owner

Closing in favor of new work happening in #13923.

@adamv adamv closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.