Move MySQL and Postgres requirements into core #15878

Closed
jacknagel opened this Issue Nov 6, 2012 · 23 comments

Comments

Projects
None yet
5 participants
Contributor

jacknagel commented Nov 6, 2012

There's enough of these now that we should move them into requirements.rb:

git grep -l -i "(my|postgre)s(ql)?installed" | wc -l
      14

So that we can just tell contributors to add depends_on MysqlInstalled.new or depends_on :mysql rather than explain requirements and have them copy/paste the class from another formula.

Contributor

adamv commented Nov 6, 2012

Agreed; should use symbol form, or at least, not something that requires .new on the end.

Contributor

manphiz commented Nov 6, 2012

This looks interesting. I wonder whether other commonly used and CPU-eating packages can be handled the same way, such as QT, cmake, etc. to name a few.

Owner

MikeMcQuaid commented Nov 6, 2012

Agreed on symbol form but disagree on implementation; I think these should just install the package by default if the dependency isn't there. Can we do something similar with Fortran?

Member

mxcl commented Nov 6, 2012

The many times I have had to install something that depends on Fortran and it stops and tells me to install my own fortran or Homebrew's I have every time felt it ridiculous that a package manager is asking me if I should install its package of fortran or not.

Install the package.

Contributor

adamv commented Nov 6, 2012

Well with MySQL some time shit only needs a client library to connect to any MySQL instance (say, the one I run in a VM), not a fucking full on MySQL database sitting there.

Owner

MikeMcQuaid commented Nov 6, 2012

In which case we just pull in the client library?

Contributor

jacknagel commented Nov 6, 2012

I'm confused. There is zero behavior change here, it's just code cleanup.

Owner

MikeMcQuaid commented Nov 6, 2012

Aye, it's not your change that's a problem. It just seems a good place to whinge about requirements being used like this.

@ghost

ghost commented Nov 6, 2012

Could something like :mysql_clib, :postgresql_clib work for these, that would if no mysql installed, install mysql-connector-c/mysql-connector-c++/libpq and then recommends you brew mysql or official same as before. Everything should be compatible with these libraries right ? I'm gonna try it now

Contributor

jacknagel commented Nov 6, 2012

Maybe

depends_on :mysql
depends_on :mysql => :client
Owner

MikeMcQuaid commented Nov 6, 2012

The problem is that the decision between them is basically user configuration. For what it's worth I think we should just default to the connector when it's e.g. a library like Qt and the server if it's anything where they'd want it on their machine (e.g. Ruby on Rails or something similar).

@ghost

ghost commented Nov 6, 2012

postgresql does not provide libpq source separately (I have sent them email if they'd be interested in providing it separately). Would it be possible for :postgresql and :mysql to show with brew deps ? Is there option to link symlinks for formula ? and maybe disable libmysqlclient in mysql formula ?

@ghost

ghost commented Nov 6, 2012

For it to work seamlessly connector formula should link symlinks in lib folder. not everyone detects libmysql.

@ghost

ghost commented Nov 6, 2012

That would segregate these two into pure server and pure connector formulas and nothing would depend on server formulas.

Contributor

jacknagel commented Nov 6, 2012

As it is, the user has complete control over how they want to manage their mysql/postgres installation. Nobody has complained. I don't see any reason to try and make decisions for the user at this point.

Contributor

adamv commented Nov 6, 2012

Let's just keep what we have and move the repeated classes to symbols. Then open a new Issue to mess with the impl, if someone really wants to do that. (Note, if someone really wants to do that, submit code, not just a suggestion.)

Owner

MikeMcQuaid commented Nov 6, 2012

I'm complaining and I've had people complain to me in-person about this. I'll submit code.

Contributor

jacknagel commented Nov 6, 2012

@humdedum

That already exists in #14456, is being codified using => :optional and => :recommended, and is solving a different problem than what is being discussed.

Unknown referenced this issue Nov 8, 2012

Closed

freeDiameter 1.1.5 #15845

Contributor

jacknagel commented Nov 8, 2012

Pushed my patch; tweaks to the actual implementation or semantics can come later.

jacknagel closed this Nov 8, 2012

@ghost

ghost commented Nov 8, 2012

It doesn't quite work: Error: No available formula for pg_top :-/

Contributor

jacknagel commented Nov 8, 2012

I typo'd it, fixed in 84cc549

@ghost

ghost commented Nov 8, 2012

It would be nice that brew deps would later on be able to recognize these cases and maybe print them:

mysql (through homebrew or official installer)
postgresql (through homebrew or official installer)

xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.