Bug 259121 - databases/tdbc has fixed dependency on mysql client 5.7
Summary: databases/tdbc has fixed dependency on mysql client 5.7
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-tcltk (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-13 01:18 UTC by Peter Dean
Modified: 2021-10-19 09:32 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (tcltk)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Dean 2021-10-13 01:18:26 UTC

    
Comment 1 Pietro Cerutti freebsd_committer freebsd_triage 2021-10-13 10:30:26 UTC
Sorry I'm not sure I understand what problem you are reporting.
Comment 2 Peter Dean 2021-10-17 08:43:11 UTC
I have mariadb-server installed as part of my nextcloud installation.  I also run tclhttpd server which responds to network links from google earth by querying a postgresql database.  To do that it needs the tdbc postgresql driver only.  But the tdbc pkg tries to install mysql-client.  It can only do that by uninstalling mariadb-client thus breaking my nextcloud.  I'm somewhat of a newbie deciding to switch to freebsd from arch for complex reasons.  On arch, tdbc is included in the tcl package and has no installation dependency on any database client.  Obviously you need to install the client for the database you want to access.
I found that I could install the tdbc port without mysql client by modifying the mysql_uses in the makefile. But the broken pkg comes back when I do 'pkg upgrade'.  
What is my best and easiest solution?
Comment 3 Peter Dean 2021-10-18 04:39:27 UTC
--- Makefile.orig	2021-10-17 06:43:19.803773000 +1000
+++ Makefile	2021-10-17 06:44:52.853493000 +1000
@@ -36,7 +36,7 @@
 
 # MySQL
 MYSQL_VARS=		MODULES+=tdbcmysql
-MYSQL_USES=		mysql:client
+MYSQL_USES=		mysql
 MYSQL_DISTFILES=	${PORTNAME}mysql${PORTVERSION}${EXTRACT_SUFX}
 
 # ODBC


make install
pkg lock tdbc

but it would be better if you made the change.  Why force people to install mysql-client, they simply can if they need it.
Comment 4 Pietro Cerutti freebsd_committer freebsd_triage 2021-10-18 07:46:58 UTC
You can configure tdbc with the drivers that you need with `make config`. Of course, the binary package from the FreeBSD repositories has a default config, which is all the backends enabled, so if you pick your own, you'll need to build your port from sources.

I guess we could split the port into per-backend subpackages or slave ports, tdbc-sqlite3, tdbc-mysql, tdbc-postgresql, tdbc-odbc. I might try and find the time to do that, but I don't think that's particularly urgent given the OPTIONs described above. You can read more about that in the handbook: https://docs.freebsd.org/en/books/porters-handbook/makefiles/#makefile-options
Comment 5 Peter Dean 2021-10-18 21:12:37 UTC
Just change mysql:client to mysql in default config and I'd be happy.  The rest is unnecessarily complex.  Have a look at the tcl PKGBUILD for arch linux. 
https://github.com/archlinux/svntogit-packages/blob/packages/tcl/trunk/PKGBUILD
Comment 6 Pietro Cerutti freebsd_committer freebsd_triage 2021-10-19 07:37:53 UTC
(In reply to Peter Dean from comment #5)
>> Just change mysql:client to mysql in default config and I'd be happy.  

That doesn't make any difference. What makes you think it does?

>> Have a look at the tcl PKGBUILD for arch linux. 
https://github.com/archlinux/svntogit-packages/blob/packages/tcl/trunk/PKGBUILD

what about it?
Comment 7 Peter Dean 2021-10-19 08:10:58 UTC
>> Just change mysql:client to mysql in default config and I'd be happy.  

>That doesn't make any difference. What makes you think it does?

because I did it.

>> Have a look at the tcl PKGBUILD for arch linux. 
https://github.com/archlinux/svntogit-packages/blob/packages/tcl/trunk/PKGBUILD

>what about it?

tdbc is included in the main tcl install. simple.
It should not be the responsibility of tdbc to install database clients. It isn't on any linux distro. You are probably aware that tdbc compiles fine without any database clients installed.  It uses it's own header files.  
If an application needs tdbc and a database client it should be that application's responsibility to install both tcl and the client.
Imagine my surprise when I tried to run my application that's been running fine on linux, to find I had to install tdbc separately.  I can't see the reasoning.
Comment 8 Pietro Cerutti freebsd_committer freebsd_triage 2021-10-19 08:25:49 UTC
We tend to make sure a port depends on any package you need to *use* the port. We differentiate between build dependencies and run dependencies.

Following your reasoning, a package for an interpreted language to wrap the functionality of a C library shouldn't depend on the C library because it can be built (i.e., packaged) without. Should p5-Redis depend on Redis? We think it should, and that's how we organize run-time dependencies. Similarly, it makes sense for tdbc (when built with the MYSQL option) to depend on the mysql client library.

USES= mysql
and
USES= mysql:client

do the same thing. Please explain what you are seeing that would suggest otherwise.
Comment 9 Pietro Cerutti freebsd_committer freebsd_triage 2021-10-19 09:32:08 UTC
>> To do that it needs the tdbc postgresql driver only.  But the tdbc pkg tries to install mysql-client.

I have answered this question by saying that you can configure tdbc with the subset of backend drivers you need.