Providing a mysql connector extension on Linux that works independently of system mysql library versions - a pipe dream ?

Enrico Weigelt enrico.weigelt at vnc.biz
Sat Mar 31 07:19:04 PDT 2012


Hi,

> As some of you may (or may not) know, I have been attempting to
> provide the native mysql connector extension via the Extensions website.

Not that I want to demotivate you, but what for ?

AFAIK is it already built-in, but can be enabled/disabled at compile time.
So it's clearly the scope of the distros to package that.

nekrad at excalibur:~/libreoffice/core$ ./configure --help | grep mysql
  --enable-ext-mysql-connector
  --with-system-mysql     Use MySQL libraries already on system, for building
                          the mysql_config executable is not in PATH, use
  --with-libmysql-path    Use Connector/C (libmysql) installation for building
                          Usage:     --with-libmysql-path=<absolute path to
  --with-system-mysql-cppconn


> - second, the connector code is, from what I understand, currently
> designed to use system provided mysql libs which is fine for building
> one's own connector, since everything gets pulled (well the
> libmysqlcppconn/libmysqlclient16 essentially) in at component load
> time
> - this also makes for a much smaller extension because those
> libraries
> are not included in the extension, but linked to (or at least that is
> what it appears to be like to me when I compare the Oracle connector,
> 4
> Mb, and the one I build myself 997kb).

About 1MB for just a bit glue code ? What does that thing to which
makes it so fat ?

> Now, the killer is that such an extension is not portable, i.e. it
> will only run on an identical OS that already has identical revision
> numbers of libmysqlcppconn and libmysqlclient16 libraries.

Yes, of course. As it always has been in GNU world. There never has
been anything like an reliable global ABI between different distros.
And that's a really good thing, as it allows individual distros to
have their own build and version management. 

That's why building and packaging is entirely the distro's job.
Ignore that fact, and you bring yourself into big trouble.

> This means that it is virtually pointless providing the extension
> I build for Linux at present,

It is, anyways. It always had been so. This is a fundamental design
decision.

The really great thing in GNU/Linux world is, that we have lots of
different distros, we have the concept of distros as an own layer,
which provide proper package management, so that individual application
projects do not need to (and, quite frankly, *SHOULD NOT*) hack up
strange installation and update programs all on their own.

> I would like, if that is at all possible, to have a way to build the
> connector so that I can just stick it up there and have any Linux OS
> user install it and have it work (notwithstanding the arch requirement
> of course). 

The whole idea is pointless. Let the distros do the building/packaging.
That's exactly what distros are for.

Actually, when I've got some spare time, I'll completely drop the whole
installation program stuff from the tree in my branches.

> Of course, as I put it in the subject line, this may well be
> a pipe dream, in which case I'm just going to stop providing them,
> there's no way I'm gonna spend my life building a connector for each
> and every conceivable platform.

Right. Why should you even intend to ? Leave that to the right folks,
the distros.

> The distribs do provide their own connectors, but these are linked to
> the "stable" version of LO which they provide at any given time, i.e.
> at
> least 2 points behind the main version release on the whole. For
> example, I tried the following with Bodhi Linux, none of which worked
> :

Of course, you need to build them for matching versions and ABIs, 
on the right distro. That's one of the many, many fundamental problems
of shared-library based plugins.

> - the Bodhi Linux distrib provided mysql connector (valid for 3.3.2
> only
> !!) - this did not install/work with the Deb download of LO 3.5.1.2)

Trying to mix up binary packages from different distros is a really
funny idea. It wont work.

> Perhaps there is some switch I can use that will force the mysql
> client libraries to be packaged inside the extension, like the AOOo
> one did ?

Maybe try the bundled mysql version, which I already removed in my branches.

> Hints and practical tips welcome.

Yes. One serious tip: always package for the right distro and never
try to mix binary packages between distros.


cu


More information about the LibreOffice mailing list