# synth: understanding dependencies



## daudo (Mar 7, 2016)

Hi,

so far, ports-mgmt/synth has been doing extremely well with all special wishes I had so far 

Unfortunately, now as I try to update deskutils/tine20 to a more recent version, I have a hard time understanding how runtime vs. buildtime dependencies are taken into consideration (if that is the problem at all).

My problem is that the tine20 package created by synth insists that it wants databases/mysql56-client instead of the databases/mariadb100-client which happens to be already installed on my target system. mariadb100-client is a drop-in replacement for mysql56-client. When I check the package's +COMPACT_MANIFEST file, it indeed has a hard requirement for mysql56-client

On the other hand, when I manually build and install the tine20 port on the build machine, the mariadb100-client package installed there seems to be sufficient.

Any pointers where I might be wrong?


----------



## marino (Mar 8, 2016)

I'd guess you didn't use /usr/local/etc/synth/LiveSystem-make.conf to set your database requirements.  Check the man page for [profile]-make.conf


----------



## daudo (Mar 8, 2016)

probably I've not been clear enough about my problem, so maybe this is a bit more to the point:


```
% cd /usr/ports/desktutils/tine20
% make all-depends-list | grep -i mysql
/usr/ports/databases/php56-pdo_mysql
/usr/ports/databases/php56-mysql
%
% make all-depends-list | grep -i mariadb
/usr/ports/databases/mariadb100-client
```
But the tine20 package created by ports-mgmt/synth has a runtime depdendency for mysql56-client in its MANIFEST:


```
"mysql
56-client":{"origin":"databases/mysql56-client","version":"5.6.27"}
```

So my question is why does the tine20 package created by synth have a runtime dependency for mysql56-client?


----------



## marino (Mar 8, 2016)

look at your logic thinking it should should depend on mariadb: "Because it's installed on my system".
1) Synth builds ports how the ports say they should be built, not based on what the local host has installed
2) The reason it works "live" is because the ports framework is using the live system - and something in the system is telling the port to use mariadb, probably your /etc/make.conf or maybe bsd.databases.mk found it.
3) that stuff doesn't exist on the clean sandbox, so it's building it per specification, e.g. with mysql

if you want to override the defaults, you either have to set port options to define database versions in the profiles's make.conf.
I'm not familiar with either port, or using maria db, but I assuming using mariadb means setting that specification in make.conf normally.

tldr; you didn't confirm your profile build requirements completely (e.g. if you are missing LiveSystem-make.conf that's probably your problem, you didn't create it or you did and it's missing mariadb stuff)


----------



## daudo (Mar 8, 2016)

thanks, got that now - still have a couple of things to learn


----------



## marino (Mar 8, 2016)

okay, look here:
https://svnweb.freebsd.org/ports/head/Mk/bsd.database.mk?revision=408822&view=markup

line 114 shows that the framework detects mariadb when it's already installed.

my guess is that you need:
MYSQL_DEFAULT=10.0m
or
MYSQL_DEFAULT=10.1m
in the profiles's /etc/make.conf


----------



## daudo (Mar 8, 2016)

thanks again John, I already figured that part out.

As it seems, there has been a proposal to streamline mysql dependencies in the past, but apparently it came never into effect:
http://lists.freebsd.org/pipermail/freebsd-ports/2012-September/078016.html
http://lists.freebsd.org/pipermail/freebsd-ports/2012-September/078016.html

Given the fact, that there are 3 ports providing "mysql" (MySQL, MariaDB, percona), the proposal might have been a good idea, however.


----------



## kpa (Mar 8, 2016)

marino@ said:


> okay, look here:
> https://svnweb.freebsd.org/ports/head/Mk/bsd.database.mk?revision=408822&view=markup
> 
> line 114 shows that the framework detects mariadb when it's already installed.
> ...



It's probably opening a can of worms but I think such constructs shouldn't be there. The selection of preferred versions should never be influenced by what is installed on the host.


----------



## marino (Mar 8, 2016)

I will not disagree but I understand why it exists.  It's certainly not the only example of that in Mk/ or ports in general.


----------

