Bug 76620 - Instructions for compiling LibreOffice with MySQL connector are not updated with changes in the 4.2 development cycle
Summary: Instructions for compiling LibreOffice with MySQL connector are not updated w...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha1
Hardware: x86-64 (AMD64) macOS (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-26 07:14 UTC by Alex Thurgood
Modified: 2014-08-15 12:53 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2014-03-26 07:14:22 UTC
Some time during 4.2 development, the code for configuring the mysql connector build got changed with the result that the build of the mysql connector fails at the configuration stage if one uses the following switches on OSX :

--enable-ext-mariadb-connector
--with-system-mariadb
--enable-bundle-mariadb

The unhelpful error message which appears is to be found in configure.ac :
AC_MSG_ERROR([libmariadb is known to be broken as of 2013-10; use libmysqlclient])

which is the result of the test(s) failing on OSX.

The problematic test code appears to be somewhere in here :


if test "$ENABLE_MARIADBC" = "TRUE"; then

    SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MARIADBC"

    dnl ===================================================================
    dnl Check for system MariaDB
    dnl ===================================================================
    AC_MSG_CHECKING([which MariaDB to use])
    if test "$with_system_mariadb" = "yes"; then
        AC_MSG_RESULT([external])
        SYSTEM_MARIADB=TRUE
        #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
        if test -z "$MARIADBCONFIG"; then
            AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
            if test -z "$MARIADBCONFIG"; then
                #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL package.])
                AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
            fi
        fi
        AC_MSG_CHECKING([MariaDB version])
        MARIADB_VERSION=`$MARIADBCONFIG --version`
        MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
        if test "$MARIADB_MAJOR" -ge "5"; then
            AC_MSG_RESULT([OK])
        else
            AC_MSG_ERROR([too old, use 5.0.x or later])
        fi
        AC_MSG_CHECKING([for MariaDB Client library])
        MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
        if test "$COM_GCC_IS_CLANG" = TRUE; then
            MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
        fi
        MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
        dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
        dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
        dnl linux32:
        if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
            MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
            MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
                | sed -e 's|/lib64/|/lib/|')
        fi
        AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
        AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
        if test "$enable_bundle_mariadb" = "yes"; then
            AC_MSG_RESULT([yes])
            BUNDLE_MARIADB=TRUE
            LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\+-l/\n/g' | grep -E '(mysqlclient|mariadb)')
            if test "$_os" = "Darwin"; then
                LIBMARIADB=${LIBMARIADB}.dylib
            elif test "$_os" = "WINNT"; then
                LIBMARIADB=${LIBMARIADB}.dll
            else
                LIBMARIADB=${LIBMARIADB}.so
            fi
            LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
            AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
            if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
                AC_MSG_RESULT([found.])
                PathFormat "$LIBMARIADB_PATH"
                LIBMARIADB_PATH="$formatted_path"
            else
                AC_MSG_ERROR([not found.])
            fi
        else
            AC_MSG_RESULT([no])
            BUNDLE_MARIADB=
        fi
    else
        AC_MSG_RESULT([internal])
        AC_MSG_ERROR([libmariadb is known to be broken as of 2013-10; use libmysqlclient])
        SYSTEM_MARIADB=
        MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb/include"
        MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadblib"
        BUILD_TYPE="$BUILD_TYPE MARIADB"
    fi

    AC_SUBST(SYSTEM_MARIADB)
    AC_SUBST(MARIADB_CFLAGS)
    AC_SUBST(MARIADB_LIBS)
    AC_SUBST(LIBMARIADB)
    AC_SUBST(LIBMARIADB_PATH)
    AC_SUBST(BUNDLE_MARIADB)



 Additionally, if the alternative configure switches are used :
--with-system-mysql-cppconn=/path-to-lib-mysqlcppconn/
--with-system-mariadb=/path-to-libmysql/

They appear to be overridden or ignored by the --enable-ext-mariadb-connector switch.




Alex
Comment 1 Alex Thurgood 2014-03-26 07:17:42 UTC
Adding Lionel to CC, I know you don't have a Mac so I'm not expecting you to fix it, just a heads up, as this seems to have been forgotten. The fact of the matter is that this connector now only builds on Linux as far as I can tell, and only the Linux distribs provide the connector with their releases.


Alex
Comment 2 Alex Thurgood 2014-03-26 07:20:52 UTC
Adding other mysql/Base users as a heads up.
Comment 3 Lionel Elie Mamane 2014-03-26 09:10:12 UTC
(In reply to comment #0)
> Some time during 4.2 development, the code for configuring the mysql
> connector build got changed with the result that the build of the mysql
> connector fails at the configuration stage if one uses the following
> switches on OSX :

> --enable-ext-mariadb-connector
> --with-system-mariadb
> --enable-bundle-mariadb

> The unhelpful error message which appears is to be found in configure.ac :
> AC_MSG_ERROR([libmariadb is known to be broken as of 2013-10; use
> libmysqlclient])

I added that error message. This error message should definitely *not* appear if --with-system-mariadb is used. Reading configure.ac, I don't understand how it can. If it appears and --with-system-mariadb is used, then please show me the output of ./autogen.sh (in particular the line "checking which MariaDB to use"), all arguments passed to it, the files autogen.lastrun and autogen.input and config.log.

>  Additionally, if the alternative configure switches are used :
> --with-system-mysql-cppconn=/path-to-lib-mysqlcppconn/
> --with-system-mariadb=/path-to-libmysql/

> They appear to be overridden or ignored by the
> --enable-ext-mariadb-connector switch.

That, too, should definitely not happen. I suspect something in autogen.lastrun, autogen.input or some --with-distro=FOO setting.
Comment 4 Alex Thurgood 2014-03-26 10:58:01 UTC
Testing with:

--with-ant-home=/Volumes/HD1/Shared/Repos/LO/packages/apache-ant-1.9.2
--without-junit
--enable-64-bit
--with-extra-buildid
--enable-vlc
--enable-ext-nlpsolver
--enable-ext-google-docs
--enable-ext-languagetool
--enable-ext-diagram
--enable-ext-typo
--enable-ext-validator
--enable-ext-watch-window
--enable-extra-template
--enable-extra-gallery
--enable-ext-wiki-publisher
--enable-extension-integration
--with-lang=fr
--with-help
--enable-epm
--with-package-format=dmg
--with-system-mariadb
--with-system-mysql-cppconn
--enable-ext-mariadb-connector


gives :

checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... external
checking for mysql_config... no
configure: error: mysql_config is missing. Install MySQL client library development package.
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 248.
Comment 5 Alex Thurgood 2014-03-26 10:59:50 UTC
Testing with:

--with-ant-home=/Volumes/HD1/Shared/Repos/LO/packages/apache-ant-1.9.2
--without-junit
--enable-64-bit
--with-extra-buildid
--enable-vlc
--enable-ext-nlpsolver
--enable-ext-google-docs
--enable-ext-languagetool
--enable-ext-diagram
--enable-ext-typo
--enable-ext-validator
--enable-ext-watch-window
--enable-extra-template
--enable-extra-gallery
--enable-ext-wiki-publisher
--enable-extension-integration
--with-lang=fr
--with-help
--enable-epm
--with-package-format=dmg
--with-system-mariadb=/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/
--with-system-mysql-cppconn=/Shared/Repos/LO/packages/mysql-connector-c++-1.1.3-osx10.7-x86-64bit/
--enable-ext-mariadb-connector

gives :


checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... internal
configure: error: libmariadb is known to be broken as of 2013-10; use libmysqlclient
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 248.
make: *** [/Volumes/HD1/Shared/Repos/LO/core/config_host.mk] Error 2
Comment 6 Alex Thurgood 2014-03-26 11:02:07 UTC
Testing with:

--with-ant-home=/Volumes/HD1/Shared/Repos/LO/packages/apache-ant-1.9.2
--without-junit
--enable-64-bit
--with-extra-buildid
--enable-vlc
--enable-ext-nlpsolver
--enable-ext-google-docs
--enable-ext-languagetool
--enable-ext-diagram
--enable-ext-typo
--enable-ext-validator
--enable-ext-watch-window
--enable-extra-template
--enable-extra-gallery
--enable-ext-wiki-publisher
--enable-extension-integration
--with-lang=fr
--with-help
--enable-epm
--with-package-format=dmg
--enable-ext-mariadb-connector

gives :

checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... internal
configure: error: libmariadb is known to be broken as of 2013-10; use libmysqlclient
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 248.
Comment 7 Alex Thurgood 2014-03-26 11:04:37 UTC
Testing with:

--with-ant-home=/Volumes/HD1/Shared/Repos/LO/packages/apache-ant-1.9.2
--without-junit
--enable-64-bit
--with-extra-buildid
--enable-vlc
--enable-ext-nlpsolver
--enable-ext-google-docs
--enable-ext-languagetool
--enable-ext-diagram
--enable-ext-typo
--enable-ext-validator
--enable-ext-watch-window
--enable-extra-template
--enable-extra-gallery
--enable-ext-wiki-publisher
--enable-extension-integration
--with-lang=fr
--with-help
--enable-epm
--with-package-format=dmg
--with-system-mysql-cppconn=/Shared/Repos/LO/packages/mysql-connector-c++-1.1.3-osx10.7-x86-64bit/
--enable-ext-mariadb-connector


gives:

checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... internal
configure: error: libmariadb is known to be broken as of 2013-10; use libmysqlclient
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 248.
make: *** [/Volumes/HD1/Shared/Repos/LO/core/config_host.mk] Error 2
Comment 8 Alex Thurgood 2014-03-26 11:06:29 UTC
Testing with:

--with-ant-home=/Volumes/HD1/Shared/Repos/LO/packages/apache-ant-1.9.2
--without-junit
--enable-64-bit
--with-extra-buildid
--enable-vlc
--enable-ext-nlpsolver
--enable-ext-google-docs
--enable-ext-languagetool
--enable-ext-diagram
--enable-ext-typo
--enable-ext-validator
--enable-ext-watch-window
--enable-extra-template
--enable-extra-gallery
--enable-ext-wiki-publisher
--enable-extension-integration
--with-lang=fr
--with-help
--enable-epm
--with-package-format=dmg
--with-system-mariadb=/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/
--enable-ext-mariadb-connector


gives:

checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... internal
configure: error: libmariadb is known to be broken as of 2013-10; use libmysqlclient
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 248.
make: *** [/Volumes/HD1/Shared/Repos/LO/core/config_host.mk] Error 2
Comment 9 Lionel Elie Mamane 2014-03-26 11:07:15 UTC
(In reply to comment #4)
> Testing with:
 
> --with-system-mariadb
> --with-system-mysql-cppconn
> --enable-ext-mariadb-connector

> gives :

> checking whether to build the MariaDB/MySQL Connector extension... yes
> checking which MariaDB to use... external
> checking for mysql_config... no
> configure: error: mysql_config is missing. Install MySQL client library
> development package.
> Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line
> 248.

mysql_config is not in the PATH. Either extend the PATH to add the directory where mysql_config is, or set the MARIADBCONFIG environment variable (example path, don't know if it is the right one on your system):

export MARIADBCONFIG=/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/bin/
./autogen.sh
Comment 10 Lionel Elie Mamane 2014-03-26 11:23:05 UTC
(In reply to comment #5)
> Testing with:

> --with-system-mariadb=/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-
> osx10.7-x86_64/

That syntax is not recognised. You can do:

--with-system-mariadb
--without-system-mariadb
--with-system-mariadb=yes
--with-system-mariadb=no

but not put a path there. There used to be --with-libmariadb-path do do what you want, but it was removed. Hmm... It looks like one would have to set

export CPPFLAGS="-I/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/include" LDFLAGS="-L/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/lib"

or something like that...

> --with-system-mysql-cppconn=/Shared/Repos/LO/packages/mysql-connector-c++-1.
> 1.3-osx10.7-x86-64bit/

Same thing, except there never was a --with-mysql-cppconn-path, so this never worked.

> --enable-ext-mariadb-connector

> gives :
> 
> 
> checking whether to build the MariaDB/MySQL Connector extension... yes
> checking which MariaDB to use... internal

As you see, the --with-system-mariadb is not recognised and it tries to use the internal libmariadb, which is too buggy so I disabled that possibility. You can use:

 --with-system-mariadb
 --without-system-mysql-cppconn

by the way.
Comment 11 Alex Thurgood 2014-03-26 11:35:38 UTC
(In reply to comment #9)
> (In reply to comment #4)


> mysql_config is not in the PATH. Either extend the PATH to add the directory
> where mysql_config is, or set the MARIADBCONFIG environment variable
> (example path, don't know if it is the right one on your system):
> 
> export
> MARIADBCONFIG=/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-
> x86_64/bin/
> ./autogen.sh

OK, so tried :

export MARIADBCONFIG=/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/bin/

this is where mysql_config is to be found

result:

checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... internal
configure: error: libmariadb is known to be broken as of 2013-10; use libmysqlclient
Comment 12 Alex Thurgood 2014-03-26 11:40:39 UTC
(In reply to comment #10)

Tried this :

export MARIADBCONFIG=/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/bin/
export CPPFLAGS="-I/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/include" LDFLAGS="-L/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/lib"

--enable-ext-mariadb-connector


result:

checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... internal
configure: error: libmariadb is known to be broken as of 2013-10; use libmysqlclient
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 248.
Comment 13 Alex Thurgood 2014-03-26 12:02:01 UTC

OK, I'm finally getting somewhere:

--enable-ext-mariadb-connector
--with-system-mariadb

and

export MARIADBCONFIG="/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/bin/mysql_config"

at least enable me to start the build !

checking which MariaDB to use... external
checking MariaDB version... OK
checking for MariaDB Client library... includes '-I/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/include', libraries '-L/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/lib -lmysqlclient_r'
checking whether to bundle the MySQL/MariaDB client library... no
checking MySQL Connector/C++... internal
Comment 14 Alex Thurgood 2014-03-26 12:09:16 UTC
Hmmm,

Now it fails at:

[build PAT] mysqlcppconn
[build CFG] mysql
1 out of 2 hunks FAILED -- saving rejects to file driver/mysql_metadata.cpp.rej
Patch FAILED: /Volumes/HD1/Shared/Repos/LO/core/external/mysqlcppconn/patches/retrieve_grants.patch.1
make[1]: *** [/Volumes/HD1/Shared/Repos/LO/core/workdir/UnpackedTarball/mysqlcppconn.done] Error 1
make[1]: *** Waiting for unfinished jobs....
Comment 15 Julien Nabet 2014-03-26 12:19:31 UTC
Since few combinations seem to work, IMHO configure.ac should indicate clearly what combinations are OK.
I can't read my autogen.input right now (because not at home) but I remember I had also struggled with this and hopefully Lionel was there to help.
So I think increasing the importance of this tracker should be OK. If I'm wrong, don't hesitate to put back initial values.
Comment 16 Alex Thurgood 2014-03-26 12:34:10 UTC
I'm surprised that on OSX, you have to specify the absolute file path to mysql_config in the export - surely this was not the intention ?
Comment 17 Alex Thurgood 2014-03-26 12:43:44 UTC
(In reply to comment #14)
> Hmmm,
> 
> Now it fails at:
> 
> [build PAT] mysqlcppconn
> [build CFG] mysql
> 1 out of 2 hunks FAILED -- saving rejects to file
> driver/mysql_metadata.cpp.rej
> Patch FAILED:
> /Volumes/HD1/Shared/Repos/LO/core/external/mysqlcppconn/patches/
> retrieve_grants.patch.1
> make[1]: ***
> [/Volumes/HD1/Shared/Repos/LO/core/workdir/UnpackedTarball/mysqlcppconn.
> done] Error 1
> make[1]: *** Waiting for unfinished jobs....

mysql_metadata.cpp.rej


***************
*** 3633,3644 ****
- 	sql::SQLString strAllPrivs("ALTER, DELETE, DROP, INDEX, INSERT, LOCK TABLES, SELECT, UPDATE");
  
  	sql::SQLString cQuote(getIdentifierQuoteString());
  
  	while (rs->next() ) {
  		sql::SQLString aGrant = rs->getString(1);
  		aGrant = aGrant.replace(0, 6, "");
  
  		size_t pos = aGrant.find("ALL PRIVILEGES");
  
  		if (pos != sql::SQLString::npos) {
  			aGrant = aGrant.replace(pos, sizeof("ALL PRIVILEGES") - 1, strAllPrivs);
--- 3633,3646 ----
+ 	sql::SQLString strAllPrivs("SELECT, INSERT, UPDATE, DELETE, CREATE, DROPT, GRANT, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER");
  
  	sql::SQLString cQuote(getIdentifierQuoteString());
+ 	size_t posIsGrantable = sql::SQLString::npos;
  
  	while (rs->next() ) {
  		sql::SQLString aGrant = rs->getString(1);
  		aGrant = aGrant.replace(0, 6, "");
  
  		size_t pos = aGrant.find("ALL PRIVILEGES");
+ 		posIsGrantable = aGrant.find("WITH GRANT OPTION");
  
  		if (pos != sql::SQLString::npos) {
  			aGrant = aGrant.replace(pos, sizeof("ALL PRIVILEGES") - 1, strAllPrivs);
Comment 18 Lionel Elie Mamane 2014-03-26 12:47:50 UTC
(In reply to comment #16)
> I'm surprised that on OSX, you have to specify the absolute file path to
> mysql_config in the export

Yes, that's the correct use of the MARIADBCONFIG environment variable. It should contain the executable, including file name, not only the directory. Sorry for the mixup in my previous instructions. Alternatively, one can also add the directory where it is to the PATH environment variable.

It could be useful to reintroduce --with-libmariadb-path ; not sure why it was removed.
Comment 19 Lionel Elie Mamane 2014-03-26 12:49:34 UTC
(In reply to comment #15)
> Since few combinations seem to work, IMHO configure.ac should indicate
> clearly what combinations are OK.

Sigh... mysqlc/README was not updated it seems.

I don't think the problem is one of "combinations", just what is available / makes sense on the OS one is compiling on.
Comment 20 Lionel Elie Mamane 2014-03-26 12:53:16 UTC
(In reply to comment #14)
> Hmmm,
> 
> Now it fails at:
> 
> [build PAT] mysqlcppconn
> [build CFG] mysql
> 1 out of 2 hunks FAILED -- saving rejects to file
> driver/mysql_metadata.cpp.rej
> Patch FAILED:
> /Volumes/HD1/Shared/Repos/LO/core/external/mysqlcppconn/patches/
> retrieve_grants.patch.1
> make[1]: ***
> [/Volumes/HD1/Shared/Repos/LO/core/workdir/UnpackedTarball/mysqlcppconn.
> done] Error 1
> make[1]: *** Waiting for unfinished jobs....

@julien: this patch is yours I believe? If the patch application fails, it probably fails on all platforms...

@alex: this patch is *not* in LibreOffice 4.2, but this bug is marked as a version 4.2 bug.

I'd suggest:

 1) This bug becomes "instructions for compiling LibreOffice with MySQL
    connector are not updated with changes in the 4.2 development cycle".

 2) The issue of the patch not applying IN MASTER become a separate bug.
Comment 21 Julien Nabet 2014-03-26 13:14:34 UTC
(In reply to comment #20)
> @julien: this patch is yours I believe? If the patch application fails, it
> probably fails on all platforms...
I'll revert this patch tonight (after my day time job).
Feel free to do it if you prefer this to be done quickly.
Comment 22 Alex Thurgood 2014-03-26 13:55:52 UTC
(In reply to comment #20)


> I'd suggest:
> 
>  1) This bug becomes "instructions for compiling LibreOffice with MySQL
>     connector are not updated with changes in the 4.2 development cycle".

Agreed, will change title


> 
>  2) The issue of the patch not applying IN MASTER become a separate bug.

Will do

Thanks for your help, I felt I was running around in circles !

Alex
Comment 23 Lionel Elie Mamane 2014-03-26 14:01:47 UTC
(In reply to comment #21)
> (In reply to comment #20)
> > @julien: this patch is yours I believe? If the patch application fails, it
> > probably fails on all platforms...
> I'll revert this patch tonight (after my day time job).

Feel free to fix the patch instead ;)
Comment 24 Julien Nabet 2014-03-26 16:09:04 UTC
(In reply to comment #23)
> Feel free to fix the patch instead ;)
It doesn't worth it since it's not Mariadb part.
Comment 25 Alex Thurgood 2014-08-08 14:31:42 UTC
Changed componenet, as bug is extension related.

For as long as it remains impossible for me to build the connector on OSX, this will remain relevant.
Comment 26 Lionel Elie Mamane 2014-08-08 15:18:09 UTC
(In reply to comment #25)
> For as long as it remains impossible for me to build the connector on OSX,
> this will remain relevant.

I reread the bug log, and you were "blocked" by the retrieve_grants.patch not applying, but that patch has long been removed. Retry with

--enable-ext-mariadb-connector
--with-system-mariadb

export MARIADBCONFIG="/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/bin/mysql_config"

(correcting the path if it changed)

Let me know of any error you get.
Comment 27 Lionel Elie Mamane 2014-08-08 15:31:30 UTC
To solve the "Unable to load the libmysqlcppconn.dylib library" error, try to add to the build:

--enable-bundle-mariadb
Comment 28 Alex Thurgood 2014-08-08 15:47:08 UTC
(In reply to comment #27)
> To solve the "Unable to load the libmysqlcppconn.dylib library" error, try
> to add to the build:
> 
> --enable-bundle-mariadb

The reason I don't add that switch is because otherwise I ge this configure failure :

checking for MariaDB Client library... includes '-I/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/include', libraries '-L/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/lib -lmysqlclient_r'
checking whether to bundle the MySQL/MariaDB client library... yes
checking for lib-L/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/lib -lmysqlclient_r.dylib in /Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/lib... configure: error: not found.
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 2
Comment 29 Alex Thurgood 2014-08-08 15:54:14 UTC
(In reply to comment #28)
> (In reply to comment #27)
> > To solve the "Unable to load the libmysqlcppconn.dylib library" error, try
> > to add to the build:
> > 
> > --enable-bundle-mariadb
> 
> The reason I don't add that switch is because otherwise I ge this configure
> failure :
> 
> checking for MariaDB Client library... includes
> '-I/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-
> x86_64/include', libraries
> '-L/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-
> x86_64/lib -lmysqlclient_r'
> checking whether to bundle the MySQL/MariaDB client library... yes
> checking for
> lib-L/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-
> x86_64/lib -lmysqlclient_r.dylib in
> /Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/
> lib... configure: error: not found.
> Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line
> 2

I actually raised this on irc months ago in the hope of evoking some interest to no avail :-)
Comment 30 Alex Thurgood 2014-08-08 16:06:36 UTC
Found this :

http://bugs.mysql.com/bug.php?id=61243

but don't know whether related, although it sounds similar, and if so won't be fixed until 5.7.4 release ?
Comment 31 Alex Thurgood 2014-08-08 16:20:54 UTC
Googled around, and only thing I could find was the possible lack of symlink, but on my system, it is already there :


sudo ls -an /usr/local/mysql/lib/

drwxr-xr-x  12 0  0        408  1 aoû 17:48 .
drwxr-xr-x  17 0  0        578  1 aoû 17:48 ..
-rwxr-xr-x   1 0  0    4276096 18 jul 18:10 libmysqlclient.18.dylib
-rw-r--r--   1 0  0    9788288 18 jul 18:03 libmysqlclient.a
lrwxr-xr-x   1 0  0         23  1 aoû 17:48 libmysqlclient.dylib -> libmysqlclient.18.dylib
lrwxr-xr-x   1 0  0         23  1 aoû 17:48 libmysqlclient_r.18.dylib -> libmysqlclient.18.dylib
lrwxr-xr-x   1 0  0         16  1 aoû 17:48 libmysqlclient_r.a -> libmysqlclient.a
lrwxr-xr-x   1 0  0         20  1 aoû 17:48 libmysqlclient_r.dylib -> libmysqlclient.dylib
-rw-r--r--   1 0  0  152646856 18 jul 17:56 libmysqld-debug.a
-rw-r--r--   1 0  0  146883320 18 jul 18:03 libmysqld.a
-rw-r--r--   1 0  0      13664 18 jul 18:03 libmysqlservices.a
drwxr-xr-x  17 0  0        578 18 jul 18:10 plugin
Comment 32 Alex Thurgood 2014-08-11 15:23:50 UTC
OK, so am retrying compilation after make clean of my output tree and have configured the following :

export MARIADBCONFIG="/usr/local/mysql-5.6.20-osx10.8-x86_64/bin/mysql_config"
export CPPFLAGS="-I/usr/local/mysql-5.6.20-osx10.8-x86_64/include/" LDFLAGS="-L/usr/local/mysql-5.6.20-osx10.8-x86_64/lib/"

--enable-ext-mariadb-connector
--with-system-mariadb

Building fails at :
missing header for unified diff at line 31 of patch
/bin/sh: line 0: cd: ../../workdir/GenCxxObject/UnpackedTarball/mysqlcppconn: No such file or directory
make[1]: *** [mysqlcppconn_configure] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [build] Error 2
Comment 33 Lionel Elie Mamane 2014-08-11 15:29:55 UTC
(In reply to comment #32)
> /bin/sh: line 0: cd:
> ../../workdir/GenCxxObject/UnpackedTarball/mysqlcppconn: No such file or
> directory

Fixed in

commit 213e1f9f85b5edb266607a29f5b02e36904d1070
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Mon Aug 11 16:27:14 2014 +0200

I've updated the instructions in

commit 0816b00d06eceee3e601177bce1c61e367bbabee
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Mon Aug 11 15:47:13 2014 +0200

    update mysqlc README


so closing this bug.
Comment 34 Lionel Elie Mamane 2014-08-11 15:32:23 UTC
Since

commit 35836d2494d67d129f305e2294fc60fed062c9c7
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Mon Aug 11 13:03:27 2014 +0200

    switch internal mariadb client to version 2
    
    and reenable it: hopefully the worst bugs are fixed now


--without-system-mariadb should work now. (--enable/disable-bundle-mariadb has no influence when --without-system-mariadb; it only has an effect when --with-system-mariadb)
Comment 35 Alex Thurgood 2014-08-11 16:05:26 UTC
(In reply to comment #34)
> Since
> 
> commit 35836d2494d67d129f305e2294fc60fed062c9c7
> Author: Lionel Elie Mamane <lionel@mamane.lu>
> Date:   Mon Aug 11 13:03:27 2014 +0200
> 
>     switch internal mariadb client to version 2
>     
>     and reenable it: hopefully the worst bugs are fixed now
> 
> 
> --without-system-mariadb should work now. (--enable/disable-bundle-mariadb
> has no influence when --without-system-mariadb; it only has an effect when
> --with-system-mariadb)

OK, will try a normal build, and if that doesn't work, using --without-system-mariadb

Thnx
Comment 36 Alex Thurgood 2014-08-11 16:17:07 UTC
Hmm, after fresh pull :

--enable-ext-mariadb-connector
--with-system-mariadb
--enable-bundle-mariadb

gives

checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... external
checking for mariadb_config... no
checking for mysql_config... no
configure: error: mariadb_config and mysql_config are missing. Install MariaDB or MySQL development package.
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 258.
make: *** [/Volumes/HD1/Shared/Repos/LO/core/config_host.mk] Error 2

Shouldn't it be using the internal mariadb ?
Comment 37 Lionel Elie Mamane 2014-08-11 16:23:24 UTC
(In reply to comment #36)
> Hmm, after fresh pull :
> 
> --enable-ext-mariadb-connector
> --with-system-mariadb
> --enable-bundle-mariadb
> 
> gives
> 
> checking whether to build the MariaDB/MySQL Connector extension... yes
> checking which MariaDB to use... external
> checking for mariadb_config... no
> checking for mysql_config... no
> configure: error: mariadb_config and mysql_config are missing. Install
> MariaDB or MySQL development package.
> Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line
> 258.
> make: *** [/Volumes/HD1/Shared/Repos/LO/core/config_host.mk] Error 2
> 
> Shouldn't it be using the internal mariadb ?

You asked for external mariadb, since you passed "--with-system-mariadb". In that case, you need to point it to the mariadb_config or mysql_config with something like
export MARIADBCONFIG="/Volumes/HD1/Shared/Repos/LO/packages/mysql-connector-c-6.1.2-osx10.7-x86_64/bin/mysql_config"

If you want to use internal mariadb client library, then use "--without-system-mariadb"
Comment 38 Alex Thurgood 2014-08-11 16:30:36 UTC
Forget that last comment - braindead

--with-system-mariadb means that the builder has the libs and mysql_config somewhere on machine 

--without-system-mariadb means that the tarball gets downloaded and built
Comment 39 Alex Thurgood 2014-08-11 16:54:29 UTC
Still not working :

--enable-ext-mariadb-connector
--with-system-mariadb
--enable-bundle-mariadb

export MARIADBCONFIG="/usr/local/mysql-5.6.20-osx10.8-x86_64/bin/mysql_config"
export CPPFLAGS="-I/usr/local/mysql-5.6.20-osx10.8-x86_64/include/" LDFLAGS="-L/usr/local/mysql-5.6.20-osx10.8-x86_64/lib/"

checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... external
checking for mariadb_config... /usr/local/mysql-5.6.20-osx10.8-x86_64/bin/mysql_config
checking MariaDB version... OK
checking for MariaDB Client library... includes '-I/usr/local/mysql-5.6.20-osx10.8-x86_64/include  -Os -g -fno-strict-aliasing -arch x86_64', libraries '-L/usr/local/mysql-5.6.20-osx10.8-x86_64/lib  -lmysqlclient_r'
checking whether to bundle the MySQL/MariaDB client library... yes
checking for lib-L/usr/local/mysql-5.6.20-osx10.8-x86_64/lib  -lmysqlclient_r.dylib in /usr/local/mysql-5.6.20-osx10.8-x86_64/lib... configure: error: not found.
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 258.
Comment 40 Alex Thurgood 2014-08-11 17:01:50 UTC
If I remove 

--enable-bundle-mariadb

configure completes and the build commences
Comment 41 Lionel Elie Mamane 2014-08-12 02:52:58 UTC
(In reply to comment #39)
> Still not working :

> --enable-ext-mariadb-connector
> --with-system-mariadb
> --enable-bundle-mariadb

> export
> MARIADBCONFIG="/usr/local/mysql-5.6.20-osx10.8-x86_64/bin/mysql_config"
> export CPPFLAGS="-I/usr/local/mysql-5.6.20-osx10.8-x86_64/include/"
> LDFLAGS="-L/usr/local/mysql-5.6.20-osx10.8-x86_64/lib/"

> checking whether to bundle the MySQL/MariaDB client library... yes
> checking for lib-L/usr/local/mysql-5.6.20-osx10.8-x86_64/lib 
> -lmysqlclient_r.dylib in /usr/local/mysql-5.6.20-osx10.8-x86_64/lib...
> configure: error: not found.
> Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line
> 258.

Should be fixed in

commit 41e4a607b00f446eeaebf8f59c957a1a580c9517
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Tue Aug 12 04:25:40 2014 +0200

    \+ is a GNU sed extension - not available on MacOS X
Comment 42 Alex Thurgood 2014-08-12 10:31:21 UTC
Still not happening when I use the bundle switch

--enable-ext-mariadb-connector
--with-system-mariadb
--enable-bundle-mariadb

export MARIADBCONFIG="/usr/local/mysql-5.6.20-osx10.8-x86_64/bin/mysql_config"
export CPPFLAGS="-I/usr/local/mysql-5.6.20-osx10.8-x86_64/include/" LDFLAGS="-L/usr/local/mysql-5.6.20-osx10.8-x86_64/lib/"



checking whether to build the MariaDB/MySQL Connector extension... yes
checking which MariaDB to use... external
checking for mariadb_config... /usr/local/mysql-5.6.20-osx10.8-x86_64/bin/mysql_config
checking MariaDB version... OK
checking for MariaDB Client library... includes '-I/usr/local/mysql-5.6.20-osx10.8-x86_64/include  -Os -g -fno-strict-aliasing -arch x86_64', libraries '-L/usr/local/mysql-5.6.20-osx10.8-x86_64/lib  -lmysqlclient_r'
checking whether to bundle the MySQL/MariaDB client library... yes
checking for lib-L/usr/local/mysql-5.6.20-osx10.8-x86_64/libnmysqlclient_r.dylib in /usr/local/mysql-5.6.20-osx10.8-x86_64/lib... configure: error: not found.
Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line 258.
make: *** [/Volumes/HD1/Shared/Repos/LO/core/config_host.mk] Error 2
Comment 43 Lionel Elie Mamane 2014-08-12 11:34:38 UTC
(In reply to comment #42)
> Still not happening when I use the bundle switch
> checking for
> lib-L/usr/local/mysql-5.6.20-osx10.8-x86_64/libnmysqlclient_r.dylib in
> /usr/local/mysql-5.6.20-osx10.8-x86_64/lib... configure: error: not found.
> Error running configure at /Volumes/HD1/Shared/Repos/LO/core/autogen.sh line
> 258.
> make: *** [/Volumes/HD1/Shared/Repos/LO/core/config_host.mk] Error 2

<sigh> this has been fixed by

commit 382ad7386698ec994e7fe0bdd4f6f0cbaeacefa0
Author: Lionel Elie Mamane <lionel@mamane.lu>
Date:   Tue Aug 12 13:32:09 2014 +0200

     in replacement is *also* a GNU sed extension - not available on MacOS X
    
    Change-Id: Ic4efe84ba6e6d0e36b520957bc56d24e14161966


I hope that's the last problem... at least with this sed expression
Comment 44 Alex Thurgood 2014-08-12 12:25:28 UTC
That seems to have sorted out the configure steps at least, thanks !
Comment 45 Julien Nabet 2014-08-15 12:53:23 UTC
On MacOs 10.9.4 with master sources updated today, I've got this:
[build SRS] svx/source/src/app.src
Undefined symbols for architecture x86_64:
  "_hash_key", referenced from:
      _hashcmp in libmariadblib.a(hash.o)
      _hash_rec_mask in libmariadblib.a(hash.o)
     (maybe you meant: _ma_get_hash_key)
  "_iconv", referenced from:
      _mariadb_convert_string in libmariadblib.a(my_charset.o)
[build UIX] filter/impswfdialog
  "_iconv_close", referenced from:
      _mariadb_convert_string in libmariadblib.a(my_charset.o)
  "_iconv_open", referenced from:
      _mariadb_convert_string in libmariadblib.a(my_charset.o)
  "_rec_hashnr", referenced from:
      _hash_insert in libmariadblib.a(hash.o)
      _hash_delete in libmariadblib.a(hash.o)
      _hash_update in libmariadblib.a(hash.o)
ld: symbol(s) not found for architecture x86_64
[build UIX] filter/pdfgeneralpage
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [/Users/julien/lo/core/workdir/LinkTarget/Library/libmysqlcppconn.dylib] Error 1

I did 'make clean && make postprocess.clean && ./g pull r && ./autogen.sh && make'

Here's my autogen.input:
-enable-64-bit
--with-system-odbc
--enable-werror
--enable-debug
--enable-dbgutil
--enable-crashdump
--enable-dependency-tracking
--enable-online-update
--enable-ext-mariadb-connector
--without-system-mariadb
--enable-bundle-mariadb
--with-lang=ALL
--without-junit
--with-myspell-dicts

Should I create a new bugtracker or did I miss something?