Bug 195856 - bsd.database.mk DEFAULT_MYSQL_VER being clobbered...
Summary: bsd.database.mk DEFAULT_MYSQL_VER being clobbered...
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-10 17:01 UTC by Sean Chittenden
Modified: 2014-12-14 23:46 UTC (History)
0 users

See Also:


Attachments
bsd.database.mk patch against r374417 (674 bytes, patch)
2014-12-10 17:01 UTC, Sean Chittenden
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Chittenden freebsd_committer freebsd_triage 2014-12-10 17:01:23 UTC
Created attachment 150434 [details]
bsd.database.mk patch against r374417

When building ports via poudriere, it's possible to specify default versions of MySQL (or PostgreSQL), however when including default values, we see runtime dependencies still linking against the system default.  For example, if we specify 5.6, we have a runtime dependency on MySQL 5.5.

DEFAULT_VERSIONS=       pgsql=9.4 mysql=56p

This happens because _MYSQL_VER is overridden unconditionally based on the version information found in `${LOCALBASE}/bin/mysql --version`.  Because we run with an internally modified version of MySQL, we have two options:

1) Patch the MySQL version string
2) Teach ports to honor the default version when specified

We think option #2 is the more correct approach.  The attached patch fixes our package environment so that runtime dependencies are correct.

```
Index: Mk/bsd.database.mk
===================================================================
--- Mk/bsd.database.mk	(revision 374417)
+++ Mk/bsd.database.mk	(working copy)
@@ -116,6 +116,7 @@
 MYSQL100m_LIBVER=	18

 # Setting/finding MySQL version we want.
+.if !defined(DEFAULT_MYSQL_VER)
 .if exists(${LOCALBASE}/bin/mysql)
 _MYSQL!=	${LOCALBASE}/bin/mysql --version | ${SED} -e 's/.*Distrib \([0-9]\{1,2\}\)\.\([0-9]*\).*/\1\2/'
 _PERCONA!=	${LOCALBASE}/bin/mysql --version | ${GREP} Percona | wc -l
@@ -129,6 +130,7 @@
 _MYSQL_VER=	${_MYSQL}
 .endif
 .endif
+.endif

 .if defined(WANT_MYSQL_VER)
 .if defined(WITH_MYSQL_VER) && ${WITH_MYSQL_VER} != ${WANT_MYSQL_VER}
```
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2014-12-14 23:44:16 UTC
The patch doesn't work:
MYSQL_DEFAULT is always defined so DEFAULT_MYSQL_VER too.

Also this behavior is intended to prevent installation of conflicting versions of mysql when one version is already installed.

Since you use a patched version of MySQL, you should patch the version string too.