Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mariadb: 10.3.15 -> 10.3.17 #63355

Merged
merged 9 commits into from Aug 2, 2019
Merged

mariadb: 10.3.15 -> 10.3.17 #63355

merged 9 commits into from Aug 2, 2019

Conversation

Izorkin
Copy link
Contributor

@Izorkin Izorkin commented Jun 17, 2019

Motivation for this change

Update MariaDB to 10.3.16
Changelog - https://mariadb.com/kb/en/library/mariadb-10316-changelog/

Move mariadb_config and mysql_config to $dev output.
Move mysql binary to mysql.client

Fixed mysql_config output
before PR

Usage: ./result/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/include/mysql -I/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/include/mysql/mysql]
        --include        [-I/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/include/mysql -I/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/include/mysql/mysql]
        --libs           [-L/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/lib/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --libs_r         [-L/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/lib/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --plugindir      [/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/lib/mysql/plugin]
        --socket         [/run/mysqld/mysqld.sock]
        --port           [3306]
        --version        [10.3.15]
        --libmysqld-libs [-L/home/home/works/src-nix/nixpkgs/result/lib/mysql  -lmysqld]
        --variable=VAR   VAR is one of:
                pkgincludedir [/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/include/mysql]
                pkglibdir     [/home/home/works/src-nix/nixpkgs/result/lib/mysql]
                plugindir     [/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/lib/mysql/plugin]

After:

Usage: ./result-dev/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/nix/store/w9569b5rpvnma3iz55il9y6hwbpi2sgq-mariadb-client-10.3.16-dev/include/mysql -I/nix/store/w9569b5rpvnma3iz55il9y6hwbpi2sgq-mariadb-client-10.3.16-dev/include/mysql/mysql]
        --include        [-I/nix/store/w9569b5rpvnma3iz55il9y6hwbpi2sgq-mariadb-client-10.3.16-dev/include/mysql -I/nix/store/w9569b5rpvnma3iz55il9y6hwbpi2sgq-mariadb-client-10.3.16-dev/include/mysql/mysql]
        --libs           [-L/nix/store/w9569b5rpvnma3iz55il9y6hwbpi2sgq-mariadb-client-10.3.16-dev/lib/mysql/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --libs_r         [-L/nix/store/w9569b5rpvnma3iz55il9y6hwbpi2sgq-mariadb-client-10.3.16-dev/lib/mysql/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto]
        --plugindir      [/nix/store/w9569b5rpvnma3iz55il9y6hwbpi2sgq-mariadb-client-10.3.16-dev/lib/mysql/plugin]
        --socket         [/run/mysqld/mysqld.sock]
        --port           [3306]
        --version        [10.3.16]
        --libmysqld-libs [-L/home/home/works/src-nix/nixpkgs/result-dev/lib/mysql  -lmysqld]
        --variable=VAR   VAR is one of:
                pkgincludedir [/home/home/works/src-nix/nixpkgs/result-dev/include/mysql]
                pkglibdir     [/home/home/works/src-nix/nixpkgs/result-dev/lib/mysql]
                plugindir     [/nix/store/w9569b5rpvnma3iz55il9y6hwbpi2sgq-mariadb-client-10.3.16-dev/lib/mysql/plugin]
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 17, 2019

@GrahamcOfBorg build mariadb.client mariadb.server
@GrahamcOfBorg test mysql mysqlBackup

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 17, 2019

@GrahamcOfBorg build mariadb.client mariadb.server
@GrahamcOfBorg test mysql mysqlBackup

@Izorkin Izorkin force-pushed the mariadb-10.3 branch 3 times, most recently from 78652c3 to 8626e15 Compare June 20, 2019 21:48
@matthewbauer
Copy link
Member

Looks okay, but I want to make sure x86_64-darwin builds.

@GrahamcOfBorg build mariadb.client mariadb.server

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 21, 2019

@matthewbauer need upgrade MariaDB to version 10.4.6 - current stable release?

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 21, 2019

Do you need these binaries:

  • mysql_client_test
  • mytop (not worked)
  • mysqltest

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 21, 2019

@GrahamcOfBorg build mariadb.client mariadb.server
@GrahamcOfBorg test mysql mysqlBackup

@Izorkin
Copy link
Contributor Author

Izorkin commented Jul 2, 2019

added release notes

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 1, 2019

@GrahamcOfBorg build mariadb.client mariadb.server

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 1, 2019

@GrahamcOfBorg build mariadb.connector-c_3_1

3 similar comments
@Mic92
Copy link
Member

Mic92 commented Aug 1, 2019

@GrahamcOfBorg build mariadb.connector-c_3_1

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 2, 2019

@GrahamcOfBorg build mariadb.connector-c_3_1

@Mic92
Copy link
Member

Mic92 commented Aug 2, 2019

@GrahamcOfBorg build mariadb.connector-c_3_1

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 2, 2019

@GrahamcOfBorg build mariadb.connector-c_3_1 mariadb.client mariadb.server

1 similar comment
@Mic92
Copy link
Member

Mic92 commented Aug 2, 2019

@GrahamcOfBorg build mariadb.connector-c_3_1 mariadb.client mariadb.server

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 2, 2019

@GrahamcOfBorg build mariadb.connector-c_3_1

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 2, 2019

@GrahamcOfBorg build mariadb.client

1 similar comment
@Mic92
Copy link
Member

Mic92 commented Aug 2, 2019

@GrahamcOfBorg build mariadb.client

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 2, 2019

@GrahamcOfBorg build mariadb.client mariadb.server

1 similar comment
@Mic92
Copy link
Member

Mic92 commented Aug 2, 2019

@GrahamcOfBorg build mariadb.client mariadb.server

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 2, 2019

@GrahamcOfBorg build mariadb.client mariadb.server

1 similar comment
@Mic92
Copy link
Member

Mic92 commented Aug 2, 2019

@GrahamcOfBorg build mariadb.client mariadb.server

@Mic92 Mic92 merged commit c740bbf into NixOS:master Aug 2, 2019
@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 2, 2019

Thanks!

@Izorkin Izorkin deleted the mariadb-10.3 branch August 2, 2019 13:55
@orivej
Copy link
Contributor

orivej commented Aug 15, 2019

Why did you move libmysqlclient.so from lib to lib/mysql? It seems wrong.

-#define INCLUDE "-I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@ -I@CMAKE_INSTALL_PREFIX@/@INSTALL_INCLUDEDIR@/mysql"
-#define LIBS "-L@CMAKE_INSTALL_PREFIX@/@INSTALL_LIBDIR@/ -lmariadb"
+#define INCLUDE "-I@CMAKE_INSTALL_PREFIX_DEV@/@INSTALL_INCLUDEDIR@ -I@CMAKE_INSTALL_PREFIX_DEV@/@INSTALL_INCLUDEDIR@/mysql"
+#define LIBS "-L@CMAKE_INSTALL_PREFIX_DEV@/@INSTALL_LIBDIR@/ -lmariadb"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes mariadb_config --libs list the directory with static libraries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But how should it be?
Now mariadb.connector-c is used instead of mariadb.client.dev

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 15, 2019

Why did you move libmysqlclient.so from lib to lib/mysql? It seems wrong.

In package mariadb.connector-c file libmysqlclient.so located in lib/mysql/

ls -lah ./result/lib/mysql/ | grep libmysqlclient.so 
lrwxrwxrwx 31 root root   13 янв  1  1970 libmysqlclient.so -> libmariadb.so

Made similarly here.
Or is it wrong?

@orivej
Copy link
Contributor

orivej commented Aug 15, 2019

I guess that connector-c default libdir is lib/mariadb while client default is lib to prevent file conflicts between their packages in traditional distros. Libraries in lib are more useful because they can be used without configuration.

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 15, 2019

@orivej use this patch?

diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index 7d34dd8d63b..d2935e0a936 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -68,7 +68,7 @@ common = rec { # attributes common to both builds
     "-DINSTALL_DOCDIR=share/doc/mysql"
     "-DINSTALL_DOCREADMEDIR=share/doc/mysql"
     "-DINSTALL_INCLUDEDIR=include/mysql"
-    "-DINSTALL_LIBDIR=lib/mysql"
+    "-DINSTALL_LIBDIR=lib"
     "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
     "-DINSTALL_INFODIR=share/mysql/docs"
     "-DINSTALL_MANDIR=share/man"
@@ -97,7 +97,7 @@ common = rec { # attributes common to both builds
   postInstall = ''
     rm "$out"/lib/mysql/plugin/daemon_example.ini
     mkdir -p "$dev"/bin && mv "$out"/bin/{mariadb_config,mysql_config} "$dev"/bin
-    mkdir -p "$dev"/lib/mysql && mv "$out"/lib/mysql/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} "$dev"/lib/mysql
+    mkdir -p "$dev"/lib/ && mv "$out"/lib/{libmariadbclient.a,libmysqlclient.a,libmysqlclient_r.a,libmysqlservices.a} "$dev"/lib
     mkdir -p "$dev"/lib/mysql/plugin && mv "$out"/lib/mysql/plugin/{caching_sha2_password.so,dialog.so,mysql_clear_password.so,sha256_password.so} "$dev"/lib/mysql/plugin
   '';

@@ -136,14 +136,13 @@ client = stdenv.mkDerivation (common // {
       -DCMAKE_INSTALL_PREFIX_DEV=$dev"
   '';

-  postInstall =  common.postInstall + ''
+  postInstall = common.postInstall + ''
     rm -r "$out"/share/doc
     rm "$out"/bin/{mysqltest,mytop,wsrep_sst_rsync_wan}
-    libmysqlclient_path=$(readlink -f $out/lib/mysql/libmysqlclient${libExt})
-    rm "$out"/lib/mysql/{libmariadb${libExt},libmysqlclient${libExt},libmysqlclient_r${libExt}}
-    mv "$libmysqlclient_path" "$out"/lib/mysql/libmysqlclient${libExt}
-    ln -sv libmysqlclient${libExt} "$out"/lib/mysql/libmysqlclient_r${libExt}
-
+    libmysqlclient_path=$(readlink -f $out/lib/libmysqlclient${libExt})
+    rm "$out"/lib/{libmariadb${libExt},libmysqlclient${libExt},libmysqlclient_r${libExt}}
+    mv "$libmysqlclient_path" "$out"/lib/libmysqlclient${libExt}
+    ln -sv libmysqlclient${libExt} "$out"/lib/libmysqlclient_r${libExt}
   '';
 });

@@ -166,7 +165,6 @@ server = stdenv.mkDerivation (common // {

   cmakeFlags = common.cmakeFlags ++ [
     "-DMYSQL_DATADIR=/var/lib/mysql"
-    "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
     "-DENABLED_LOCAL_INFILE=OFF"
     "-DWITH_READLINE=ON"
     "-DWITH_EXTRA_CHARSETS=all"
@@ -196,7 +194,7 @@ server = stdenv.mkDerivation (common // {
     chmod +x "$out"/bin/wsrep_sst_common
     rm "$out"/bin/mysql_client_test
     rm -r "$out"/data # Don't need testing data
-    rm "$out"/lib/mysql/{libmysqlclient${libExt},libmysqlclient_r${libExt}}
+    rm "$out"/lib/{libmysqlclient${libExt},libmysqlclient_r${libExt}}
     mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql
   '' + optionalString withoutClient ''
     ${ # We don't build with GSSAPI on Darwin

@orivej
Copy link
Contributor

orivej commented Aug 15, 2019

mariadb (and mysql) defines a set of install layouts: standalone, rpm, deb, svr4: https://github.com/MariaDB/server/blob/ae4b9b76/cmake/install_layout.cmake#L76 . We configure it as standalone, which is meant for read-writable single directory installations, but then override standalone defaults towards deb, which is closer to what we need in nixpkgs. deb installs libs in lib and plugins in lib/mysql/plugin: https://github.com/MariaDB/server/blob/ae4b9b76/cmake/install_layout.cmake#L177-L178 .

I suppose that it would be easier for us to switch the base layout to deb, but meanwhile its fine to tweak standalone to be more like deb and use lib and lib/mysql/plugin.

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 15, 2019

@orivej updated patch

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 15, 2019

@orivej create new PR with this patch?

@Izorkin Izorkin mentioned this pull request Sep 12, 2019
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants