Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 294956 - mail-client/roundcube-0.3.1 is forcing PHP to use SQLite/SSL for no reason
Summary: mail-client/roundcube-0.3.1 is forcing PHP to use SQLite/SSL for no reason
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Web Application Packages Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-28 12:05 UTC by steveb
Modified: 2009-12-01 12:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description steveb 2009-11-28 12:05:43 UTC
mail-client/roundcube-0.3.1 does enforce SQLite to be installed for no particular reason. The code part that is responsible for that is:
-------------
IUSE="ldap mysql postgres +sqlite +ssl spell"
-------------

Why on earth is there a + in front of sqlite? And why is there a + in front of ssl? Both are NOT needed to run RoundCube and putting a + there forces PHP to be pulled in with those use flags should one not explicitly have set "-ssl" and/or "-sqlite" in make.conf.

Reproducible: Always
Comment 1 Rafał Mużyło 2009-11-29 00:11:52 UTC
One of database backends is required -
sqlite was chosen as default as the smallest
(though upstream seems to mostly ignore it,
as they don't use sqlite3 yet).

And ssl is a sane default - it's needed for secure connections
(tls stuff). Upstream does recommend it.

Comment 2 steveb 2009-11-29 08:44:32 UTC
(In reply to comment #1)
> One of database backends is required -
> sqlite was chosen as default as the smallest
> (though upstream seems to mostly ignore it,
> as they don't use sqlite3 yet).
> 
I understand that but in my case the +sqlite is not doing what it should. The goal of the ebuild is to ensure at least one SQL based backend. Right? Well... I do have MySQL enabled. So I am satisfying the requirements but the ebuild does not care about that. It is pulling SQLite into the mix. And this is not optimal.

IMHO the pkg_setup() does already check that at least one SQL backend is there:
------------
pkg_setup() {
        confutils_require_any mysql postgres sqlite
        use mysql && require_php_with_any_use mysql mysqli
------------

Now allow me to reference your response. If the + in front of sqlite in the use flag is there to ensure at least one SQL based backend to be selected, then please remove the above mentioned code from pkg_setup(). What? You are going to tell me that it is needed in case someone has -mysql -postgres -sqlite. Really? So that +sqlite in the use flags is useless. One can trick it out by adding -sqlite into his make.conf. And pkg_setup() would pick that up and bark that it needs at last one of mysql, postgres or sqlite. Well... then the +sqlite in the use flags should go away but the code in pkg_setup() should stay.

I understand what the original author wanted to achieve with the + in front of the sqlite use flag, but he/she is failing in that regard.

Imagine every ebuild in Portage to have + in front of recommended flags. That would be a huge mess. pkg_setup() is the right place to check for that kind of issues but not the IUSE variable inside the ebuild.


> And ssl is a sane default - it's needed for secure connections
> (tls stuff). Upstream does recommend it.
> 
I know what ssl is. No need to educate me in that area. But be honest: Do we need it to be a + in the use flags? No. Not really. I have ssl enabled anyway but I think here in bigger circles. That + in front of ssl is going to pull ssl in environments that have not by default enabled ssl or that have not explicitly disabled ssl.
Comment 3 Rafał Mużyło 2009-11-29 18:58:52 UTC
Well, that '+' is there exactly for that reason
- if somebody has neither of db useflags set,
ebuild would always fail.
confutils check is for the case of somebody explicitly
unsetting all those useflags.
With that '+' it will work and if you want a different
backend, you should notice and adjust useflags to fit your needs.

Explanation of '+ssl' I leave to the maintainer.
Comment 4 steveb 2009-11-30 14:31:45 UTC
(In reply to comment #3)
> Well, that '+' is there exactly for that reason
> - if somebody has neither of db useflags set,
> ebuild would always fail.
>
That is wrong. Sorry! Maybe I am looking at it from a to mathematical viewpoint but your statement is WRONG.

I have set "mysql" USE flag and emerged MySQL and I have build PHP with mysql and still that damn roundcube ebuild is salting my brain by telling me that I need to emerge PHP with sqlite use flag:
-----------
nyx ~ # emerge -pv roundcube

These are the packages that would be merged, in order:

Calculating dependencies... done!

emerge: there are no ebuilds built with USE flags to satisfy "dev-lang/php[pcre,iconv,crypt,session,spl,unicode,ssl,sqlite]".
!!! One of the following packages is required to complete your request:
- dev-lang/php-5.2.11-r1 (Change USE: +sqlite)
(dependency required by "mail-client/roundcube-0.3.1" [ebuild])
(dependency required by "roundcube" [argument])

nyx ~ #
-----------

Okay. Let's go and instruct emerge to not use sqlite:
-----------
nyx ~ # USE="-sqlite" emerge -pv roundcube

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] mail-client/roundcube-0.3.1  USE="mysql spell ssl vhosts -ldap -postgres -sqlite" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
nyx ~ #
-----------

Funny! Why on earth is it not picking up my mysql use flag that I already have? RIGHT! Because of that stupid + in the IUSE flags.

If you are really wanting to ensure one database backend then please remove that silly + in the IUSE in front of sqlite and add into RDEPEND this here:
-----------
!postgres? ( !mysql? ( dev-lang/php[sqlite] ) )
-----------

Now that is doing what you are claiming that the + sign is doing in the IUSE in front of sqlite. And with that I can live. But the + in IUSE is WRONG!

If you know anything about logic then it would be totally obvious to you that setting +sqlite in IUSE is equal to:
-----------
if not sqlite is set then set it
-----------
The +sqlite in IUSE does not care about if mysql is set and/or if postgres is set. And this is not okay from my viewpoint.

While all you want is:
-----------
if not ( mysql is set ) AND not ( postges is set) then set sqlite
-----------
And this is better done with adding "!postgres? ( !mysql? ( dev-lang/php[sqlite] ) )" into RDEPEND bevore the line "dev-lang/php[crypt,iconv,ldap?,pcre,postgres?,session,spl,sqlite?,ssl?,unicode]".


> confutils check is for the case of somebody explicitly
> unsetting all those useflags.
> With that '+' it will work and if you want a different
> backend, you should notice and adjust useflags to fit your needs.
> 
Please look above and explain me how my already set "mysql" USE flag is fitting into your claim about the + in front of the sqlite in IUSE.


> Explanation of '+ssl' I leave to the maintainer.
> 

// Steve
Comment 5 steveb 2009-11-30 14:35:16 UTC
I need to rephrase that first logic part:

If you know anything about logic then it would be totally obvious to you that
setting +sqlite in IUSE is equal to:
-----------
if not ( sqlite is set ) AND not ( sqlite is explicitly unset ) then set it
-----------
Comment 6 Benedikt Böhm (RETIRED) gentoo-dev 2009-12-01 07:45:11 UTC
fixed, thanks
Comment 7 steveb 2009-12-01 12:02:51 UTC
(In reply to comment #6)
> fixed, thanks
> 
Thank you Benedikt.