Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 668560 - dev-db/mariadb-connector-c[mysqlcompat]: installs /usr/include/mysql symlink atop a directory
Summary: dev-db/mariadb-connector-c[mysqlcompat]: installs /usr/include/mysql symlink ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 665826 665930
  Show dependency tree
 
Reported: 2018-10-14 09:15 UTC by Michał Górny
Modified: 2021-05-12 21:59 UTC (History)
3 users (show)

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


Attachments
dev-db:mariadb-connector-c-3.0.6:20181014-090708.log (dev-db:mariadb-connector-c-3.0.6:20181014-090708.log,146.61 KB, text/x-log)
2018-10-14 09:15 UTC, Michał Górny
Details
dev-db:mariadb-10.3.9:20180925-184923.log.xz (dev-db:mariadb-10.3.9:20180925-184923.log.xz,48.33 KB, application/x-xz)
2018-10-18 14:58 UTC, Michał Górny
Details
Patch (mariadb-connector-c.patch,2.61 KB, patch)
2018-10-29 01:39 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff
Patch (mariadb-connector-c.patch,2.15 KB, patch)
2018-10-29 06:18 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-10-14 09:15:06 UTC
Created attachment 551000 [details]
dev-db:mariadb-connector-c-3.0.6:20181014-090708.log

* Messages for package dev-db/mariadb-connector-c-3.0.6:
 * Log file: /var/log/portage/dev-db:mariadb-connector-c-3.0.6:20181014-090708.log

 * 
 * Installation of a symlink is blocked by a directory:
 *   '/usr/include/mysql'
 * This symlink will be merged with a different name:
 *   '/usr/include/mysql.backup.0000'
 * 

However, it seems that /usr/include/mysql is a valid directory installed by dev-db/mariadb, so the end result will depend on which of the packages is installed first.

@dev-portage, I think collision-protect should really have complained here instead of silently installing a broken package.
Comment 1 Zac Medico gentoo-dev 2018-10-14 19:36:15 UTC
(In reply to Michał Górny from comment #0)
> @dev-portage, I think collision-protect should really have complained here
> instead of silently installing a broken package.

Hmm, the patch from bug 326685 was intended to make it report a collision in this case, so I'm curious why it didn't work:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=a4a4d87786e6c0c34370870af2071904d6184a9d

As a side note, we could handle this particular case atomically on Linux, using the renameat2 syscall.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-10-14 19:47:25 UTC
Ah, I probably never got around to backport it.
Comment 3 Thomas Deutschmann gentoo-dev Security 2018-10-18 14:13:35 UTC
Package has set

> RDEPEND="${DEPEND}
> 	mysqlcompat? (
> 		!dev-db/mysql[client-libs(+)]
> 		!dev-db/mysql-cluster[client-libs(+)]
> 		!dev-db/mariadb[client-libs(+)]
> 		!dev-db/mariadb-galera[client-libs(+)]
> 		!dev-db/percona-server[client-libs(+)]
> 		!dev-db/mysql-connector-c
> 	)
> 	!>=dev-db/mariadb-10.2.0[client-libs(+)]
> "

And we have also have


> # grep -Fr -- 'client-libs' /usr/portage/profiles/
> /usr/portage/profiles/use.local.desc:dev-db/mariadb:client-libs - Build the client libraries from the server package instead of the C Connector packages
> /usr/portage/profiles/use.local.desc:dev-db/mysql:client-libs - Build the client libraries from the server package instead of the C Connector packages (not recommended)
> /usr/portage/profiles/base/package.use.mask:# Mask client-libs USE to force users to install alternative standard pacakges
> /usr/portage/profiles/base/package.use.mask:dev-db/mariadb client-libs
> /usr/portage/profiles/base/package.use.mask:dev-db/mariadb-galera client-libs
> /usr/portage/profiles/base/package.use.mask:dev-db/mysql client-libs
> /usr/portage/profiles/base/package.use.mask:dev-db/percona-server client-libs

You said

> However, it seems that /usr/include/mysql is a valid directory installed by dev-db/mariadb

I don't understand how you were able to hit this.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-10-18 14:58:23 UTC
Created attachment 551776 [details]
dev-db:mariadb-10.3.9:20180925-184923.log.xz

Here's the build log.  It installs some *server* headers, apparently.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-10-27 07:44:19 UTC
Ping.  This is blocking dependency updates on packages now.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2018-10-29 01:39:09 UTC
Created attachment 553580 [details, diff]
Patch
Comment 7 Arfrever Frehtes Taifersar Arahesis 2018-10-29 06:18:27 UTC
Created attachment 553596 [details, diff]
Patch

(Improved, smaller patch)
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2019-01-24 07:55:45 UTC
mgorny: +1 on the patch; it would merge correctly if the symlink already existed right?
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-01-24 08:07:19 UTC
(In reply to Robin Johnson from comment #8)
> mgorny: +1 on the patch; it would merge correctly if the symlink already
> existed right?

Good question.  My guess is that it's entirely undefined and forbidden.  @dev-portage?  Probably would require pkg_preinst() old symlink removal.
Comment 10 Leho Kraav (:macmaN @lkraav) 2019-03-15 18:35:17 UTC
This is definitely real, so the bug could probably moved to CONF status?

media-tv/kodi-17.6, for example, currently fails to configure, because it can't find headers in /usr/include/mysql.

I have stable mariadb-connector-c-3.0.6 currently, if things have improved in 3.0.9, perhaps it could be stabilized?
Comment 11 Brian Evans Gentoo Infrastructure gentoo-dev 2019-03-15 18:42:54 UTC
(In reply to Leho Kraav (:macmaN @lkraav) from comment #10)
> This is definitely real, so the bug could probably moved to CONF status?
> 
> media-tv/kodi-17.6, for example, currently fails to configure, because it
> can't find headers in /usr/include/mysql.
> 
> I have stable mariadb-connector-c-3.0.6 currently, if things have improved
> in 3.0.9, perhaps it could be stabilized?

Turn off mariadb USE flag and then kodi will work.  I am seriously going to have to remove this mysqlcompat USE flag
Comment 12 Larry the Git Cow gentoo-dev 2019-03-15 19:09:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5195b2ae5d4c7edf3fea92e2b7f441f0160860b6

commit 5195b2ae5d4c7edf3fea92e2b7f441f0160860b6
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-03-15 19:05:28 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-03-15 19:05:28 +0000

    dev-db/mariadb-connector-c: Begin to drop the mysqlcompat USE flag
    
    This library is functionally incompatible and should never have introduced
    this in the first place.
    
    Bug: https://bugs.gentoo.org/show_bug.cgi?id=666750
    Bug: https://bugs.gentoo.org/668560
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 .../mariadb-connector-c-3.0.9.ebuild                | 21 ++-------------------
 .../mariadb-connector-c-9999.ebuild                 | 17 +----------------
 2 files changed, 3 insertions(+), 35 deletions(-)
Comment 13 Leho Kraav (:macmaN @lkraav) 2019-03-15 19:09:42 UTC
Ah indeed, I could probably go for the default SQLite backend.
Comment 14 Arfrever Frehtes Taifersar Arahesis 2019-03-16 03:43:59 UTC
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36137d382667cf96e8fa52481d598d40e9bed861

commit 36137d382667cf96e8fa52481d598d40e9bed861
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-03-15 19:08:21 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-03-15 19:08:21 +0000

    profiles: Mask mysqlcompat USE on mariadb-connector-c
    
    And the one consumer package media-tv/kodi
Comment 15 Arfrever Frehtes Taifersar Arahesis 2019-03-16 03:54:26 UTC
(In reply to comment #14)
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=36137d382667cf96e8fa52481d598d40e9bed861
> 
> commit 36137d382667cf96e8fa52481d598d40e9bed861
> Author:     Brian Evans <grknight@gentoo.org>
> AuthorDate: 2019-03-15 19:08:21 +0000
> Commit:     Brian Evans <grknight@gentoo.org>
> CommitDate: 2019-03-15 19:08:21 +0000
> 
>     profiles: Mask mysqlcompat USE on mariadb-connector-c
>     
>     And the one consumer package media-tv/kodi


You have added "media-tv/kodi mariadb" entry in package.use.mask.
However the dependency and actual usage of USE flag does not look problematic in media-tv/kodi-18.* ebuilds and newer (9999):

kodi-17.6-r10.ebuild:   mariadb? ( dev-db/mariadb-connector-c:=[mysqlcompat] )
kodi-17.6-r11.ebuild:   mariadb? ( dev-db/mariadb-connector-c:=[mysqlcompat] )
kodi-17.6-r6.ebuild:            mariadb? ( dev-db/mariadb-connector-c:=[mysqlcompat] )
kodi-17.6-r7.ebuild:    mariadb? ( dev-db/mariadb-connector-c:=[mysqlcompat] )
kodi-17.6-r8.ebuild:    mariadb? ( dev-db/mariadb-connector-c:=[mysqlcompat] )
kodi-17.6-r9.ebuild:    mariadb? ( dev-db/mariadb-connector-c:=[mysqlcompat] )
kodi-18.0.ebuild:       mariadb? ( dev-db/mariadb-connector-c:= )
kodi-18.0_rc2.ebuild:   mariadb? ( dev-db/mariadb-connector-c:= )
kodi-18.0_rc3.ebuild:   mariadb? ( dev-db/mariadb-connector-c:= )
kodi-18.0_rc4.ebuild:   mariadb? ( dev-db/mariadb-connector-c:= )
kodi-18.0_rc5.ebuild:   mariadb? ( dev-db/mariadb-connector-c:= )
kodi-18.1.ebuild:       mariadb? ( dev-db/mariadb-connector-c:= )
kodi-18.1_rc1.ebuild:   mariadb? ( dev-db/mariadb-connector-c:= )
kodi-9999.ebuild:       mariadb? ( dev-db/mariadb-connector-c:= )


In most media-tv/kodi-17.* ebuilds:

if use mysql || use mariadb ; then
    mycmakeargs+=( -DENABLE_MYSQLCLIENT="yes" )
else
    mycmakeargs+=( -DENABLE_MYSQLCLIENT="no" )
fi


In media-tv/kodi-18.* ebuilds:

-DENABLE_MARIADBCLIENT=$(usex mariadb)
-DENABLE_MYSQLCLIENT=$(usex mysql)


So entry in package.use.mask probably should be changed to:
=media-tv/kodi-17* mariadb
Comment 16 Larry the Git Cow gentoo-dev 2019-03-16 14:09:03 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=423db2ac2f4b0c5fd3e5a8bd34aa4449eca769bf

commit 423db2ac2f4b0c5fd3e5a8bd34aa4449eca769bf
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2019-03-16 14:05:26 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2019-03-16 14:08:55 +0000

    profiles: Tighten up the kodi mariadb USE mask
    
    Bug: https://bugs.gentoo.org/show_bug.cgi?id=668560
    
    Signed-off-by: Brian Evans <grknight@gentoo.org>

 profiles/base/package.use.mask | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 17 Arfrever Frehtes Taifersar Arahesis 2021-05-12 21:59:03 UTC
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a81979e66468006181677f2ac9e5b2bdf5d3704

commit 3a81979e66468006181677f2ac9e5b2bdf5d3704
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-04-01 21:23:14 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-04-01 21:23:14 +0000

    dev-db/mariadb-connector-c: drop old