All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster
@ 2015-07-09 16:21 Sylvain Raybaud
  2015-07-09 16:21 ` [Buildroot] [PATCH 1/7 v2] check: new package Sylvain Raybaud
                   ` (6 more replies)
  0 siblings, 7 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-09 16:21 UTC (permalink / raw)
  To: buildroot

Add MariaDB Galera Cluster as an alternative implementation of MySQL, inside package/mysql.
Also add galera which is needed for running a cluster and check on which galera depends.
Introduce a few other modifications to busybox.config and libaio.mk necessary to make this work.

Changes v1 -> v2:
 - Fixed check Config.in (suggested by Yann E. Morin)
 - Fixed check hash file (suggested by Yann E. Morin)
 - Changed check dependency from pgkconf to host-pkgconf (suggested by Yann E. Morin)
 - Fixed check license (suggested by Yann E. Morin)
 - Leave CHECK_INSTALL_STAGING and CHECK_INSTALL_TARGET to their default values (suggested by Yann E. Morin)
 - Explain why we need to build host-libaio in commit log (suggested by Yann E. Morin)
 - Add information about the impact on busybox binary size induced by patching busybox.config (suggested by Thomas Petazzoni)
 - Change commit titles (suggested by Thomas Petazzoni)
 - Remove duplicated block in package/galera/galera.mk

Sylvain Raybaud (7):
  check: new package
  libaio: add host variant
  galera: new package
  pkg-cmake: add PKG_CONFIG_* variables to help cmake find host packages
  busybox: adjust configuration to add fancy options to the sleep applet
  mysql: move patches into a version-specific subdirectory
  mysql: add mariadb galera cluster variant

 package/Config.in                                  |   2 +
 package/busybox/busybox.config                     |   4 +-
 package/check/Config.in                            |   7 +
 package/check/check.hash                           |   2 +
 package/check/check.mk                             |  17 ++
 package/galera/Config.in                           |   9 +
 ...lera-01-fix_sconstruct_for-crosscompiling.patch |  52 +++++
 package/galera/galera.hash                         |   2 +
 package/galera/galera.mk                           |  49 ++++
 package/libaio/libaio.mk                           |   1 +
 .../mariadb-galera-01-fix_xtradb_cmakelist.patch   |  27 +++
 .../mariadb-galera-02-fix_innodb_cmakelist.patch   | 251 +++++++++++++++++++++
 package/mysql/{ => 5.1}/0000-ac_cache_check.patch  |   0
 .../{ => 5.1}/0001-configure-ps-cache-check.patch  |   0
 .../{ => 5.1}/0002-use-new-readline-iface.patch    |   0
 .../0003-ac_stack_direction-is-unset.patch         |   0
 .../0004-Fix-gen_lex_hash-execution.patch          |   0
 .../0005-bison_3_breaks_mysql_server_build.patch   |   0
 .../{ => 5.1}/0006-no-force-static-build.patch     |   0
 package/mysql/Config.in                            |  43 +++-
 package/mysql/mariadb-galera-cluster.cnf           | 204 +++++++++++++++++
 package/mysql/mysql.hash                           |   2 +
 package/mysql/mysql.mk                             | 216 +++++++++++++++---
 package/pkg-cmake.mk                               |   2 +
 24 files changed, 852 insertions(+), 38 deletions(-)
 create mode 100644 package/check/Config.in
 create mode 100644 package/check/check.hash
 create mode 100644 package/check/check.mk
 create mode 100644 package/galera/Config.in
 create mode 100644 package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
 create mode 100644 package/galera/galera.hash
 create mode 100644 package/galera/galera.mk
 create mode 100644 package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
 create mode 100644 package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
 rename package/mysql/{ => 5.1}/0000-ac_cache_check.patch (100%)
 rename package/mysql/{ => 5.1}/0001-configure-ps-cache-check.patch (100%)
 rename package/mysql/{ => 5.1}/0002-use-new-readline-iface.patch (100%)
 rename package/mysql/{ => 5.1}/0003-ac_stack_direction-is-unset.patch (100%)
 rename package/mysql/{ => 5.1}/0004-Fix-gen_lex_hash-execution.patch (100%)
 rename package/mysql/{ => 5.1}/0005-bison_3_breaks_mysql_server_build.patch (100%)
 rename package/mysql/{ => 5.1}/0006-no-force-static-build.patch (100%)
 create mode 100644 package/mysql/mariadb-galera-cluster.cnf

-- 
1.9.1

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 1/7 v2] check: new package
  2015-07-09 16:21 [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster Sylvain Raybaud
@ 2015-07-09 16:21 ` Sylvain Raybaud
  2015-07-10 23:06   ` Yann E. MORIN
  2015-07-09 16:21 ` [Buildroot] [PATCH 2/7 v2] libaio: add host variant Sylvain Raybaud
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-09 16:21 UTC (permalink / raw)
  To: buildroot

Add package check: a unit test library.

Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
---

Changes v1 -> v2:
 - Fixed Config.in (suggested by Yann E. Morin)
 - Fixed hash file (suggested by Yann E. Morin)
 - Changed dependency from pgkconf to host-pkgconf (suggested by Yann E. Morin)
 - Fixed license (suggested by Yann E. Morin)
 - Leave CHECK_INSTALL_STAGING and CHECK_INSTALL_TARGET to their default values (suggested by Yann E. Morin)

 package/Config.in        |  1 +
 package/check/Config.in  |  7 +++++++
 package/check/check.hash |  2 ++
 package/check/check.mk   | 17 +++++++++++++++++
 4 files changed, 27 insertions(+)
 create mode 100644 package/check/Config.in
 create mode 100644 package/check/check.hash
 create mode 100644 package/check/check.mk

diff --git a/package/Config.in b/package/Config.in
index 13a7e74..72ec372 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1014,6 +1014,7 @@ menu "Other"
 	source "package/atf/Config.in"
 	source "package/bdwgc/Config.in"
 	source "package/boost/Config.in"
+	source "package/check/Config.in"
 	source "package/clapack/Config.in"
 	source "package/classpath/Config.in"
 	source "package/cppcms/Config.in"
diff --git a/package/check/Config.in b/package/check/Config.in
new file mode 100644
index 0000000..4bdb4c8
--- /dev/null
+++ b/package/check/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_CHECK
+	bool "check"
+	select BR2_PACKAGE_LIBTOOL
+	select BR2_PACKAGE_PKGCONF
+	help
+	  Unit testing framework for C
+	  http://check.sourceforge.net/
diff --git a/package/check/check.hash b/package/check/check.hash
new file mode 100644
index 0000000..8ade191
--- /dev/null
+++ b/package/check/check.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha1	4b79e2d485d014ddb438e322b64235347d57b0ff	check-0.9.14.tar.gz
diff --git a/package/check/check.mk b/package/check/check.mk
new file mode 100644
index 0000000..83fd4fb
--- /dev/null
+++ b/package/check/check.mk
@@ -0,0 +1,17 @@
+################################################################################
+#
+# check
+#
+################################################################################
+
+CHECK_VERSION = 0.9.14
+CHECK_SOURCE = check-$(CHECK_VERSION).tar.gz
+CHECK_SITE = http://downloads.sourceforge.net/project/check/check/$(CHECK_VERSION)/
+
+CHECK_DEPENDENCIES = libtool host-pkgconf
+
+CHECK_LICENSE =  LGPLv2.1+
+CHECK_LICENSE_FILES = COPYING.LESSER
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 2/7 v2] libaio: add host variant
  2015-07-09 16:21 [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster Sylvain Raybaud
  2015-07-09 16:21 ` [Buildroot] [PATCH 1/7 v2] check: new package Sylvain Raybaud
@ 2015-07-09 16:21 ` Sylvain Raybaud
  2015-07-10 22:30   ` Yann E. MORIN
  2015-07-10 23:00   ` Thomas Petazzoni
  2015-07-09 16:21 ` [Buildroot] [PATCH 3/7 v2] galera: new package Sylvain Raybaud
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-09 16:21 UTC (permalink / raw)
  To: buildroot

host-libaio is needed to build host-mysql in its mariadb variant which is needed to build the target variant of mariadb.

Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
---
Changes v1 -> v2:
  Explain why we need to build host-libaio in commit log (suggested by Yann E. Morin)

 package/libaio/libaio.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/libaio/libaio.mk b/package/libaio/libaio.mk
index 53ad7eb..55e2cc7 100644
--- a/package/libaio/libaio.mk
+++ b/package/libaio/libaio.mk
@@ -24,3 +24,4 @@ define LIBAIO_INSTALL_TARGET_CMDS
 endef
 
 $(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 3/7 v2] galera: new package
  2015-07-09 16:21 [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster Sylvain Raybaud
  2015-07-09 16:21 ` [Buildroot] [PATCH 1/7 v2] check: new package Sylvain Raybaud
  2015-07-09 16:21 ` [Buildroot] [PATCH 2/7 v2] libaio: add host variant Sylvain Raybaud
@ 2015-07-09 16:21 ` Sylvain Raybaud
  2015-07-09 21:29   ` Samuel Martin
  2015-07-09 16:21 ` [Buildroot] [PATCH 4/7 v2] pkg-cmake: add PKG_CONFIG_* variables to help cmake find host packages Sylvain Raybaud
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-09 16:21 UTC (permalink / raw)
  To: buildroot

Add package galera: wsrep provider for MySQL and MariaDB galera cluster.

Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
---
Changes v1 -> v2:
 - Remove duplicated block in package/galera/galera.mk

 package/Config.in                                  |  1 +
 package/galera/Config.in                           |  9 ++++
 ...lera-01-fix_sconstruct_for-crosscompiling.patch | 52 ++++++++++++++++++++++
 package/galera/galera.hash                         |  2 +
 package/galera/galera.mk                           | 49 ++++++++++++++++++++
 5 files changed, 113 insertions(+)
 create mode 100644 package/galera/Config.in
 create mode 100644 package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
 create mode 100644 package/galera/galera.hash
 create mode 100644 package/galera/galera.mk

diff --git a/package/Config.in b/package/Config.in
index 72ec372..b15d026 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -740,6 +740,7 @@ menu "Database"
 	source "package/cppdb/Config.in"
 	source "package/gdbm/Config.in"
 	source "package/leveldb/Config.in"
+	source "package/galera/Config.in"
 	source "package/mysql/Config.in"
 	source "package/postgresql/Config.in"
 	source "package/redis/Config.in"
diff --git a/package/galera/Config.in b/package/galera/Config.in
new file mode 100644
index 0000000..4c50427
--- /dev/null
+++ b/package/galera/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_GALERA
+	bool "galera"
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_CHECK
+	help
+	  Galera WSREP provider
+	  http://galeracluster.com/
diff --git a/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch b/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
new file mode 100644
index 0000000..25c9d59
--- /dev/null
+++ b/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
@@ -0,0 +1,52 @@
+Fix cross compilation
+
+--- a/SConstruct	2015-05-28 12:23:41.027461788 +0200
++++ b/SConstruct	2015-07-02 11:27:55.763337287 +0200
+@@ -15,18 +15,17 @@
+ ####################################################################
+ 
+ import os
+-import platform
+ import string
+ 
+-sysname = os.uname()[0].lower()
+-machine = platform.machine()
+-bits = platform.architecture()[0]
++sysname = "linux"
++machine = os.environ['BR2_ARCH']
++bits = os.environ['BR2_x86']
+ print 'Host: ' + sysname + ' ' + machine + ' ' + bits
+ 
+ x86 = 0
+-if bits == '32bit':
++if bits == '32':
+     x86 = 32
+-elif bits == '64bit':
++elif bits == '64':
+     x86 = 64
+ 
+ 
+@@ -240,6 +239,15 @@
+ #
+ env.Append(LINKFLAGS = link_arch)
+ 
++# Cross-compilation
++
++if 'CROSS' in os.environ:
++        cross = os.environ['CROSS']
++        env.Append(CROSS = cross)
++        env.Replace(CC = cross + 'gcc')
++        env.Replace(CXX = cross + 'g++')
++        env.Replace(LD = cross + 'ld')
++
+ #
+ # Check required headers and libraries (autoconf functionality)
+ #
+@@ -405,7 +413,7 @@
+
+ # these will be used only with our softaware
+ if strict_build_flags == 1:
+-    conf.env.Append(CPPFLAGS = ' -Werror')
++    conf.env.Append(CPPFLAGS = ' -Werror -Wno-error=uninitialized -Wno-error=pedantic')
+     conf.env.Append(CCFLAGS  = ' -pedantic')
+     conf.env.Append(CXXFLAGS = ' -Weffc++ -Wold-style-cast')
diff --git a/package/galera/galera.hash b/package/galera/galera.hash
new file mode 100644
index 0000000..d3872e1
--- /dev/null
+++ b/package/galera/galera.hash
@@ -0,0 +1,2 @@
+# From http://releases.galeracluster.com/source/galera-3-25.3.10.tar.gz
+sha1   03f69fa87dc14fa4d793e7afab601e285c570809	galera-3-25.3.10.tar.gz
diff --git a/package/galera/galera.mk b/package/galera/galera.mk
new file mode 100644
index 0000000..f9bf0d0
--- /dev/null
+++ b/package/galera/galera.mk
@@ -0,0 +1,49 @@
+################################################################################
+#
+# galera
+#
+################################################################################
+
+GALERA_VERSION = 3-25.3.10
+GALERA_SOURCE = galera-$(GALERA_VERSION).tar.gz
+GALERA_SITE = http://releases.galeracluster.com/source/
+
+GALERA_INSTALL_STAGING = NO
+GALERA_INSTALL_TARGET = YES
+
+GALERA_DEPENDENCIES = boost openssl check host-scons
+
+GALERA_LIBNAME = libgalera_smm.so
+
+GALERA_SCONS_ENV = $(TARGET_CONFIGURE_OPTS) BR2_ARCH=$(BR2_ARCH)
+ifeq ($(BR2_x86_64),y)
+GALERA_SCONS_ENV += BR2_x86=64
+else ifeq ($(BR2_i386),y)
+GALERA_SCONS_ENV += BR2_x86=32
+else
+GALERA_SCONS_ENV += BR2_x86=0
+endif
+
+GALERA_SCONS_OPTS = \
+	arch=$(BR2_ARCH) \
+	prefix=/usr \
+	extra_sysroot=$(STAGING_DIR) \
+	tests=0
+
+define GALERA_BUILD_CMDS
+        cd $(@D) && \
+	  $(GALERA_SCONS_ENV) \
+	  CROSS=$(TARGET_CROSS) \
+	  $(SCONS) \
+	  $(GALERA_SCONS_OPTS)
+endef
+
+define GALERA_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 644 $(@D)/$(GALERA_LIBNAME) $(TARGET_DIR)/usr/lib/$(GALERA_LIBNAME)
+endef
+
+GALERA_LICENSE = GPLv2
+GALERA_LICENSE_FILES = LICENSE COPYING
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 4/7 v2] pkg-cmake: add PKG_CONFIG_* variables to help cmake find host packages
  2015-07-09 16:21 [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster Sylvain Raybaud
                   ` (2 preceding siblings ...)
  2015-07-09 16:21 ` [Buildroot] [PATCH 3/7 v2] galera: new package Sylvain Raybaud
@ 2015-07-09 16:21 ` Sylvain Raybaud
  2015-07-10 22:47   ` Samuel Martin
  2015-07-09 16:21 ` [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet Sylvain Raybaud
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-09 16:21 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
---
 package/pkg-cmake.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index f17a883..a757a2b 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -111,6 +111,8 @@ define $(2)_CONFIGURE_CMDS
 	cd $$($$(PKG)_BUILDDIR) && \
 	rm -f CMakeCache.txt && \
 	PATH=$$(BR_PATH) \
+	PKG_CONFIG_PATH='$$(HOST_DIR)/usr/lib/pkgconfig' \
+	PKG_CONFIG_SYSROOT_DIR='$$(HOST_DIR)' \
 	$$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
 		-DCMAKE_INSTALL_SO_NO_EXE=0 \
 		-DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet
  2015-07-09 16:21 [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster Sylvain Raybaud
                   ` (3 preceding siblings ...)
  2015-07-09 16:21 ` [Buildroot] [PATCH 4/7 v2] pkg-cmake: add PKG_CONFIG_* variables to help cmake find host packages Sylvain Raybaud
@ 2015-07-09 16:21 ` Sylvain Raybaud
  2015-07-10 22:48   ` Samuel Martin
  2015-07-10 22:58   ` Thomas Petazzoni
  2015-07-09 16:22 ` [Buildroot] [PATCH 6/7 v2] mysql: move patches into a version-specific subdirectory Sylvain Raybaud
  2015-07-09 16:22 ` [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant Sylvain Raybaud
  6 siblings, 2 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-09 16:21 UTC (permalink / raw)
  To: buildroot

Set CONFIGURE_FEATURE_FANCY_SLEEP and CONFIG_FEATURE_FLOAT_SLEEP so that sleep accept floating point arguments.
This add 492 bytes to the busybox binary compiled for arm or 2748 bytes when compiled for i386.

Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
---
Changes v1 -> v2:
 - Add information about the impact on busybox binary size induced by patching busybox.config (suggested by Thomas Petazzoni)

 package/busybox/busybox.config | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/busybox/busybox.config b/package/busybox/busybox.config
index 9d930d1..8d1d80a 100644
--- a/package/busybox/busybox.config
+++ b/package/busybox/busybox.config
@@ -273,8 +273,8 @@ CONFIG_SHA256SUM=y
 CONFIG_SHA512SUM=y
 CONFIG_SHA3SUM=y
 CONFIG_SLEEP=y
-# CONFIG_FEATURE_FANCY_SLEEP is not set
-# CONFIG_FEATURE_FLOAT_SLEEP is not set
+CONFIG_FEATURE_FANCY_SLEEP=y
+CONFIG_FEATURE_FLOAT_SLEEP=y
 CONFIG_SORT=y
 CONFIG_FEATURE_SORT_BIG=y
 # CONFIG_SPLIT is not set
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 6/7 v2] mysql: move patches into a version-specific subdirectory
  2015-07-09 16:21 [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster Sylvain Raybaud
                   ` (4 preceding siblings ...)
  2015-07-09 16:21 ` [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet Sylvain Raybaud
@ 2015-07-09 16:22 ` Sylvain Raybaud
  2015-07-09 16:22 ` [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant Sylvain Raybaud
  6 siblings, 0 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-09 16:22 UTC (permalink / raw)
  To: buildroot

This will make possible to apply a different set of patches for mysql and mariadb variants.

Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
---
 package/mysql/{ => 5.1}/0000-ac_cache_check.patch                    | 0
 package/mysql/{ => 5.1}/0001-configure-ps-cache-check.patch          | 0
 package/mysql/{ => 5.1}/0002-use-new-readline-iface.patch            | 0
 package/mysql/{ => 5.1}/0003-ac_stack_direction-is-unset.patch       | 0
 package/mysql/{ => 5.1}/0004-Fix-gen_lex_hash-execution.patch        | 0
 package/mysql/{ => 5.1}/0005-bison_3_breaks_mysql_server_build.patch | 0
 package/mysql/{ => 5.1}/0006-no-force-static-build.patch             | 0
 7 files changed, 0 insertions(+), 0 deletions(-)
 rename package/mysql/{ => 5.1}/0000-ac_cache_check.patch (100%)
 rename package/mysql/{ => 5.1}/0001-configure-ps-cache-check.patch (100%)
 rename package/mysql/{ => 5.1}/0002-use-new-readline-iface.patch (100%)
 rename package/mysql/{ => 5.1}/0003-ac_stack_direction-is-unset.patch (100%)
 rename package/mysql/{ => 5.1}/0004-Fix-gen_lex_hash-execution.patch (100%)
 rename package/mysql/{ => 5.1}/0005-bison_3_breaks_mysql_server_build.patch (100%)
 rename package/mysql/{ => 5.1}/0006-no-force-static-build.patch (100%)

diff --git a/package/mysql/0000-ac_cache_check.patch b/package/mysql/5.1/0000-ac_cache_check.patch
similarity index 100%
rename from package/mysql/0000-ac_cache_check.patch
rename to package/mysql/5.1/0000-ac_cache_check.patch
diff --git a/package/mysql/0001-configure-ps-cache-check.patch b/package/mysql/5.1/0001-configure-ps-cache-check.patch
similarity index 100%
rename from package/mysql/0001-configure-ps-cache-check.patch
rename to package/mysql/5.1/0001-configure-ps-cache-check.patch
diff --git a/package/mysql/0002-use-new-readline-iface.patch b/package/mysql/5.1/0002-use-new-readline-iface.patch
similarity index 100%
rename from package/mysql/0002-use-new-readline-iface.patch
rename to package/mysql/5.1/0002-use-new-readline-iface.patch
diff --git a/package/mysql/0003-ac_stack_direction-is-unset.patch b/package/mysql/5.1/0003-ac_stack_direction-is-unset.patch
similarity index 100%
rename from package/mysql/0003-ac_stack_direction-is-unset.patch
rename to package/mysql/5.1/0003-ac_stack_direction-is-unset.patch
diff --git a/package/mysql/0004-Fix-gen_lex_hash-execution.patch b/package/mysql/5.1/0004-Fix-gen_lex_hash-execution.patch
similarity index 100%
rename from package/mysql/0004-Fix-gen_lex_hash-execution.patch
rename to package/mysql/5.1/0004-Fix-gen_lex_hash-execution.patch
diff --git a/package/mysql/0005-bison_3_breaks_mysql_server_build.patch b/package/mysql/5.1/0005-bison_3_breaks_mysql_server_build.patch
similarity index 100%
rename from package/mysql/0005-bison_3_breaks_mysql_server_build.patch
rename to package/mysql/5.1/0005-bison_3_breaks_mysql_server_build.patch
diff --git a/package/mysql/0006-no-force-static-build.patch b/package/mysql/5.1/0006-no-force-static-build.patch
similarity index 100%
rename from package/mysql/0006-no-force-static-build.patch
rename to package/mysql/5.1/0006-no-force-static-build.patch
-- 
1.9.1

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-07-09 16:21 [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster Sylvain Raybaud
                   ` (5 preceding siblings ...)
  2015-07-09 16:22 ` [Buildroot] [PATCH 6/7 v2] mysql: move patches into a version-specific subdirectory Sylvain Raybaud
@ 2015-07-09 16:22 ` Sylvain Raybaud
  2015-07-09 21:56   ` Samuel Martin
  6 siblings, 1 reply; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-09 16:22 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
---
 .../mariadb-galera-01-fix_xtradb_cmakelist.patch   |  27 +++
 .../mariadb-galera-02-fix_innodb_cmakelist.patch   | 251 +++++++++++++++++++++
 package/mysql/Config.in                            |  43 +++-
 package/mysql/mariadb-galera-cluster.cnf           | 204 +++++++++++++++++
 package/mysql/mysql.hash                           |   2 +
 package/mysql/mysql.mk                             | 216 +++++++++++++++---
 6 files changed, 707 insertions(+), 36 deletions(-)
 create mode 100644 package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
 create mode 100644 package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
 create mode 100644 package/mysql/mariadb-galera-cluster.cnf

diff --git a/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch b/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
new file mode 100644
index 0000000..83eac77
--- /dev/null
+++ b/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
@@ -0,0 +1,27 @@
+Do not perform test if the build is not requested anyway. The test may fail,
+preventing building the whole package.
+
+--- a/storage/xtradb/CMakeLists.txt	2014-10-30 16:24:33.160188627 +0100
++++ b/storage/xtradb/CMakeLists.txt	2014-10-30 16:25:09.060188829 +0100
+@@ -470,12 +470,13 @@
+   SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
+ ENDIF()
+ 
+-IF(XTRADB_OK)
+-  MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
+-    DEFAULT
+-    RECOMPILE_FOR_EMBEDDED
+-    LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
+-ELSE()
+-  MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
++IF(NOT WITHOUT_XTRADB)
++  IF(XTRADB_OK)
++    MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
++      DEFAULT
++      RECOMPILE_FOR_EMBEDDED
++      LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
++  ELSE()
++    MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
++  ENDIF()
+ ENDIF()
+-
diff --git a/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
new file mode 100644
index 0000000..1ddec5d
--- /dev/null
+++ b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
@@ -0,0 +1,251 @@
+Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS in order to be
+cross-compile friendly.
+In buildroot another solution (maybe better, maybe not) could be to use
+BR2_ARCH_HAS_ATOMICS in order to determine the value of HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
+and likes.
+
+--- a/storage/innobase/CMakeLists.txt	2014-11-07 17:05:48.853208487 +0100
++++ b/storage/innobase/CMakeLists.txt	2014-11-07 17:11:38.061217839 +0100
+@@ -58,100 +58,99 @@
+ 
+ IF(NOT MSVC)
+ # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
+-IF(NOT CMAKE_CROSSCOMPILING)
+-  # workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686
+-  IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
+-     CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3")
+-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
+-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
+-  ENDIF()
+-  CHECK_C_SOURCE_RUNS(
+-  "
+-  int main()
+-  {
+-    long	x;
+-    long	y;
+-    long	res;
+-
+-    x = 10;
+-    y = 123;
+-    res = __sync_bool_compare_and_swap(&x, x, y);
+-    if (!res || x != y) {
+-      return(1);
+-    }
+-
+-    x = 10;
+-    y = 123;
+-    res = __sync_bool_compare_and_swap(&x, x + 1, y);
+-    if (res || x != 10) {
+-      return(1);
+-    }
+-    x = 10;
+-    y = 123;
+-    res = __sync_add_and_fetch(&x, y);
+-    if (res != 123 + 10 || x != 123 + 10) {
+-      return(1);
+-    }
+-    return(0);
+-  }"
+-  HAVE_IB_GCC_ATOMIC_BUILTINS
+-  )
+-  CHECK_C_SOURCE_RUNS(
+-  "
+-  int main()
+-  {
+-    long	res;
+-    char	c;
+-
+-    c = 10;
+-    res = __sync_lock_test_and_set(&c, 123);
+-    if (res != 10 || c != 123) {
+-      return(1);
+-    }
+-    return(0);
+-  }"
+-  HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
+-  )
+-  CHECK_C_SOURCE_RUNS(
+-  "#include<stdint.h>
+-  int main()
+-  {
+-    int64_t	x,y,res;
+-
+-    x = 10;
+-    y = 123;
+-    res = __sync_sub_and_fetch(&y, x);
+-    if (res != y || y != 113) {
+-      return(1);
+-    }
+-    res = __sync_add_and_fetch(&y, x);
+-    if (res != y || y != 123) {
+-      return(1);
+-    }
+-    return(0);
+-  }"
+-  HAVE_IB_GCC_ATOMIC_BUILTINS_64
+-  )
+-  CHECK_C_SOURCE_RUNS(
+-  "#include<stdint.h>
+-  int main()
+-  {
+-    __sync_synchronize();
+-    return(0);
+-  }"
+-  HAVE_IB_GCC_SYNC_SYNCHRONISE
+-  )
+-  CHECK_C_SOURCE_RUNS(
+-  "#include<stdint.h>
+-  int main()
+-  {
+-    __atomic_thread_fence(__ATOMIC_ACQUIRE);
+-    __atomic_thread_fence(__ATOMIC_RELEASE);
+-    return(0);
+-  }"
+-  HAVE_IB_GCC_ATOMIC_THREAD_FENCE
+-  )
+-ENDIF()
++
++# workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686
++IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
++   CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3")
++  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
++  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
++ENDIF()
++CHECK_C_SOURCE_COMPILES(
++"
++int main()
++{
++  long	x;
++  long	y;
++  long	res;
++
++  x = 10;
++  y = 123;
++  res = __sync_bool_compare_and_swap(&x, x, y);
++  if (!res || x != y) {
++    return(1);
++  }
++
++  x = 10;
++  y = 123;
++  res = __sync_bool_compare_and_swap(&x, x + 1, y);
++  if (res || x != 10) {
++    return(1);
++  }
++  x = 10;
++  y = 123;
++  res = __sync_add_and_fetch(&x, y);
++  if (res != 123 + 10 || x != 123 + 10) {
++    return(1);
++  }
++  return(0);
++}"
++HAVE_IB_GCC_ATOMIC_BUILTINS
++)
++CHECK_C_SOURCE_COMPILES(
++"
++int main()
++{
++  long	res;
++  char	c;
++
++  c = 10;
++  res = __sync_lock_test_and_set(&c, 123);
++  if (res != 10 || c != 123) {
++    return(1);
++  }
++  return(0);
++}"
++HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
++)
++CHECK_C_SOURCE_COMPILES(
++"#include<stdint.h>
++int main()
++{
++  int64_t	x,y,res;
++
++  x = 10;
++  y = 123;
++  res = __sync_sub_and_fetch(&y, x);
++  if (res != y || y != 113) {
++    return(1);
++  }
++  res = __sync_add_and_fetch(&y, x);
++  if (res != y || y != 123) {
++    return(1);
++  }
++  return(0);
++}"
++HAVE_IB_GCC_ATOMIC_BUILTINS_64
++)
++CHECK_C_SOURCE_COMPILES(
++"#include<stdint.h>
++int main()
++{
++  __sync_synchronize();
++  return(0);
++}"
++HAVE_IB_GCC_SYNC_SYNCHRONISE
++)
++CHECK_C_SOURCE_COMPILES(
++"#include<stdint.h>
++int main()
++{
++  __atomic_thread_fence(__ATOMIC_ACQUIRE);
++  __atomic_thread_fence(__ATOMIC_RELEASE);
++return(0);
++}"
++HAVE_IB_GCC_ATOMIC_THREAD_FENCE
++)
+ 
+ IF(HAVE_IB_GCC_ATOMIC_BUILTINS)
+  ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_BUILTINS=1)
+@@ -173,28 +172,26 @@
+  ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_THREAD_FENCE=1)
+ ENDIF()
+ 
+- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
+-IF(NOT CMAKE_CROSSCOMPILING)
+-  CHECK_C_SOURCE_RUNS(
+-  "
+-  #include <pthread.h>
+-  #include <string.h>
+-
+-  int main() {
+-    pthread_t       x1;
+-    pthread_t       x2;
+-    pthread_t       x3;
+-
+-    memset(&x1, 0x0, sizeof(x1));
+-    memset(&x2, 0x0, sizeof(x2));
+-    memset(&x3, 0x0, sizeof(x3));
+-
+-    __sync_bool_compare_and_swap(&x1, x2, x3);
+-
+-    return(0);
+-  }"
+-  HAVE_IB_ATOMIC_PTHREAD_T_GCC)
+-ENDIF()
++# either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
++CHECK_C_SOURCE_COMPILES(
++"
++#include <pthread.h>
++#include <string.h>
++
++int main() {
++  pthread_t       x1;
++  pthread_t       x2;
++  pthread_t       x3;
++
++  memset(&x1, 0x0, sizeof(x1));
++  memset(&x2, 0x0, sizeof(x2));
++  memset(&x3, 0x0, sizeof(x3));
++  __sync_bool_compare_and_swap(&x1, x2, x3);
++
++  return(0);
++}"
++HAVE_IB_ATOMIC_PTHREAD_T_GCC)
++
+ IF(HAVE_IB_ATOMIC_PTHREAD_T_GCC)
+   ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1)
+ ENDIF()
diff --git a/package/mysql/Config.in b/package/mysql/Config.in
index 7133892..a1a2d23 100644
--- a/package/mysql/Config.in
+++ b/package/mysql/Config.in
@@ -1,8 +1,17 @@
 config BR2_PACKAGE_MYSQL
+	bool "mysql"
+
+if BR2_PACKAGE_MYSQL
+choice
+	prompt "MySQL database system implementation"
+	default MYSQL_MYSQL
+
+config MYSQL_MYSQL
 	bool "MySQL"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
 	select BR2_PACKAGE_NCURSES
 	select BR2_PACKAGE_READLINE
 	help
@@ -10,7 +19,35 @@ config BR2_PACKAGE_MYSQL
 
 	  http://www.mysql.com/
 
-if BR2_PACKAGE_MYSQL
+config MYSQL_MARIADB_GALERA
+	bool "mariadb-galera"
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_LIBAIO
+	select BR2_PACKAGE_LIBTOOL
+	select BR2_PACKAGE_GALERA
+	select BR2_PACKAGE_BASH # runtime dependency only
+	select BR2_PACKAGE_LSOF # runtime dependency only
+	select BR2_PACKAGE_PROCPS_NG # runtime dependency only
+	select BR2_PACKAGE_FINDUTILS # runtime dependency only
+	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
+	depends on BR2_TOOLCHAIN_BUILDROOT_GLIBC || BR2_PACKAGE_EGLIBC # spawn()
+	help
+	  MariaDB Galera Cluster.
+	  https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-cluster
+
+endchoice
+
+endif
+
+comment "MySQL needs a toolchain w/ C++, threads"
+depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
+
+comment "MariaDB needs an (e)glibc toolchain"
+depends on !BR2_TOOLCHAIN_BUILDROOT_GLIBC && !BR2_PACKAGE_EGLIBC # spawn()
+
+if MYSQL_MYSQL
 
 config BR2_PACKAGE_MYSQL_SERVER
 	bool "MySQL server"
@@ -18,7 +55,3 @@ config BR2_PACKAGE_MYSQL_SERVER
 	  Install the MySQL server on the target.
 
 endif
-
-comment "MySQL needs a toolchain w/ C++, threads"
-	depends on BR2_USE_MMU
-	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/mysql/mariadb-galera-cluster.cnf b/package/mysql/mariadb-galera-cluster.cnf
new file mode 100644
index 0000000..c3eddaa
--- /dev/null
+++ b/package/mysql/mariadb-galera-cluster.cnf
@@ -0,0 +1,204 @@
+# MariaDB database server configuration file.
+#
+# You can copy this file to one of:
+# - "/etc/mysql/my.cnf" to set global options,
+# - "~/.my.cnf" to set user-specific options.
+# 
+# One can use all long options that the program supports.
+# Run program with --help to get a list of available options and with
+# --print-defaults to see which it would actually understand and use.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# This will be passed to all mysql clients
+# It has been reported that passwords should be enclosed with ticks/quotes
+# escpecially if they contain "#" chars...
+# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
+[client]
+port		= 3306
+socket		= /tmp/mysql.sock
+
+# Here is entries for some specific programs
+# The following values assume you have at least 32M ram
+
+# This was formally known as [safe_mysqld]. Both versions are currently parsed.
+[mysqld_safe]
+socket		= /tmp/mysql.sock
+nice		= 0
+
+[mysqld]
+#
+# * Basic Settings
+#
+user		= mysql
+pid-file	= /tmp/mysql.pid
+socket		= /tmp/mysql.sock
+port		= 3306
+basedir		= /usr
+datadir		= /var/lib/mysql
+tmpdir		= /tmp
+lc_messages_dir	= /usr/share/
+lc_messages	= en_US
+skip-external-locking
+
+# Don't use DNS as it may not be available
+skip-host-cache
+skip-name-resolve
+
+#
+# Instead of skip-networking the default is now to listen only on
+# localhost which is more compatible and is not less secure.
+#bind-address		= 127.0.0.1
+#
+# * Fine Tuning
+#
+max_connections		= 100
+connect_timeout		= 5
+wait_timeout		= 600
+max_allowed_packet	= 16M
+thread_cache_size       = 128
+sort_buffer_size	= 4M
+bulk_insert_buffer_size	= 16M
+tmp_table_size		= 32M
+max_heap_table_size	= 32M
+#
+# * MyISAM
+#
+# This replaces the startup script and checks MyISAM tables if needed
+# the first time they are touched. On error, make copy and try a repair.
+myisam_recover          = BACKUP
+key_buffer_size		= 64M
+#open-files-limit	= 2000
+table_open_cache	= 400
+myisam_sort_buffer_size	= 64M
+concurrent_insert	= 2
+read_buffer_size	= 2M
+read_rnd_buffer_size	= 1M
+#
+# * Query Cache Configuration
+#
+# Cache only tiny result sets, so we can fit more in the query cache.
+query_cache_limit		= 128K
+query_cache_size		= 16M
+# for more write intensive setups, set to DEMAND or OFF
+#query_cache_type		= DEMAND
+#
+# * Logging and Replication
+#
+# Both location gets rotated by the cronjob.
+# Be aware that this log type is a performance killer.
+# As of 5.1 you can enable the log at runtime!
+#general_log_file        = /var/lib/mysql/mysql.log
+#general_log             = 1
+#
+# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
+#
+# we do want to know about network errors and such
+log_warnings		= 2
+#
+# Enable the slow query log to see queries with especially long duration
+#slow_query_log[={0|1}]
+slow_query_log_file	= /var/lib/mysql/mariadb-slow.log
+long_query_time = 10
+#log_slow_rate_limit	= 1000
+log_slow_verbosity	= query_plan
+
+#log-queries-not-using-indexes
+#log_slow_admin_statements
+#
+# The following can be used as easy to replay backup logs or for replication.
+# note: if you are setting up a replication slave, see README.Debian about
+#       other settings you may need to change.
+#server-id		= 1
+#report_host		= master1
+#auto_increment_increment = 2
+#auto_increment_offset	= 1
+log_bin			= /var/lib/mysql/mariadb-bin
+log_bin_index		= /var/lib/mysql/mariadb-bin.index
+# not fab for performance, but safer
+#sync_binlog		= 1
+expire_logs_days	= 10
+max_binlog_size         = 100M
+# slaves
+#relay_log		= /var/lib/mysql/relay-bin
+#relay_log_index	= /var/lib/mysql/relay-bin.index
+#relay_log_info_file	= /var/lib/mysql/relay-bin.info
+#log_slave_updates
+#read_only
+#
+# If applications support it, this stricter sql_mode prevents some
+# mistakes like inserting invalid dates etc.
+#sql_mode		= NO_ENGINE_SUBSTITUTION,TRADITIONAL
+#
+# * InnoDB
+#
+# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
+# Read the manual for more InnoDB related options. There are many!
+default_storage_engine	= InnoDB
+# you can't just change log file size, requires special procedure
+#innodb_log_file_size	= 50M
+innodb_buffer_pool_size	= 64M
+innodb_log_buffer_size	= 8M
+innodb_file_per_table	= 1
+innodb_open_files	= 400
+innodb_io_capacity	= 400
+innodb_flush_method	= O_DIRECT
+#
+# * Security Features
+#
+# Read the manual, too, if you want chroot!
+# chroot = /var/lib/mysql/
+#
+# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
+#
+# ssl-ca=/etc/mysql/cacert.pem
+# ssl-cert=/etc/mysql/server-cert.pem
+# ssl-key=/etc/mysql/server-key.pem
+
+#
+# * Galera-related settings
+#
+
+[galera]
+# Mandatory settings
+
+# use InnoDB instead of XtraDB
+ignore_builtin_innodb
+innodb_autoinc_lock_mode=2
+innodb_doublewrite=1
+
+plugin_load=innodb=ha_innodb.so
+plugin_dir=/usr/lib/plugin
+
+wsrep_provider=/usr/lib/libgalera_smm.so
+binlog_format=row
+default_storage_engine=InnoDB
+
+query_cache_size=0 # mandatory only for versions prior to 5.5.40-galera, 10.0.14-galera and 10.1.2
+wsrep_on=ON        # Enable wsrep replication
+#wsrep_cluster_name=
+#wsrep_cluster_address=
+wsrep_sst_method=rsync
+
+#
+# Optional setting
+#wsrep_slave_threads=1
+#innodb_flush_log_at_trx_commit=0
+
+[mysqldump]
+quick
+quote-names
+max_allowed_packet	= 16M
+
+[mysql]
+#no-auto-rehash	# faster start of mysql but no tab completition
+
+[isamchk]
+key_buffer		= 16M
+
+#
+# * IMPORTANT: Additional settings that can override those from this file!
+#   The files must end with '.cnf', otherwise they'll be ignored.
+#
+!includedir /etc/mysql/conf.d/
diff --git a/package/mysql/mysql.hash b/package/mysql/mysql.hash
index 84f3361..d9f3574 100644
--- a/package/mysql/mysql.hash
+++ b/package/mysql/mysql.hash
@@ -1,2 +1,4 @@
 # From https://downloads.mariadb.com/archives/mysql-5.1/mysql-5.1.73.tar.gz.md5
 md5	887f869bcc757957067b9198f707f32f	mysql-5.1.73.tar.gz
+# From: https://downloads.mariadb.org/interstitial/mariadb-galera-10.0.17/source/mariadb-galera-10.0.17.tar.gz
+sha1	 91b70d19fb687a58f0e40f50608071489743e54e	mariadb-galera-10.0.17.tar.gz
diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk
index 8718193..9abf50e 100644
--- a/package/mysql/mysql.mk
+++ b/package/mysql/mysql.mk
@@ -4,17 +4,24 @@
 #
 ################################################################################
 
-MYSQL_VERSION_MAJOR = 5.1
-MYSQL_VERSION = $(MYSQL_VERSION_MAJOR).73
-MYSQL_SOURCE = mysql-$(MYSQL_VERSION).tar.gz
-MYSQL_SITE = http://downloads.skysql.com/archives/mysql-$(MYSQL_VERSION_MAJOR)
-MYSQL_INSTALL_STAGING = YES
-MYSQL_DEPENDENCIES = readline ncurses
-MYSQL_AUTORECONF = YES
-MYSQL_LICENSE = GPLv2
-MYSQL_LICENSE_FILES = README COPYING
-
-MYSQL_CONF_ENV = \
+################################################################################
+#
+# mysql implementation
+#
+################################################################################
+
+
+MYSQL_MYSQL_VERSION_MAJOR = 5.1
+MYSQL_MYSQL_VERSION = $(MYSQL_MYSQL_VERSION_MAJOR).73
+MYSQL_MYSQL_SOURCE = mysql-$(MYSQL_MYSQL_VERSION).tar.gz
+MYSQL_MYSQL_SITE = http://downloads.skysql.com/archives/mysql-$(MYSQL_MYSQL_VERSION_MAJOR)
+MYSQL_MYSQL_INSTALL_STAGING = YES
+MYSQL_MYSQL_DEPENDENCIES = readline ncurses
+MYSQL_MYSQL_AUTORECONF = YES
+MYSQL_MYSQL_LICENSE = GPLv2
+MYSQL_MYSQL_LICENSE_FILES = README COPYING
+
+MYSQL_MYSQL_CONF_ENV = \
 	ac_cv_sys_restartable_syscalls=yes \
 	ac_cv_path_PS=/bin/ps \
 	ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null" \
@@ -23,7 +30,7 @@ MYSQL_CONF_ENV = \
 	ac_cv_have_decl_HAVE_IB_GCC_ATOMIC_BUILTINS=yes \
 	mysql_cv_new_rl_interface=yes
 
-MYSQL_CONF_OPTS = \
+MYSQL_MYSQL_CONF_OPTS = \
 	--without-ndb-binlog \
 	--without-docs \
 	--without-man \
@@ -34,22 +41,22 @@ MYSQL_CONF_OPTS = \
 	--disable-mysql-maintainer-mode
 
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
-MYSQL_DEPENDENCIES += openssl
+MYSQL_MYSQL_DEPENDENCIES += openssl
 endif
 
 ifeq ($(BR2_PACKAGE_ZLIB),y)
-MYSQL_DEPENDENCIES += zlib
+MYSQL_MYSQL_DEPENDENCIES += zlib
 endif
 
 ifeq ($(BR2_PACKAGE_MYSQL_SERVER),y)
-MYSQL_DEPENDENCIES += host-mysql host-bison
-HOST_MYSQL_DEPENDENCIES = host-zlib host-ncurses
+MYSQL_MYSQL_DEPENDENCIES += host-mysql host-bison
+HOST_MYSQL_MYSQL_DEPENDENCIES = host-zlib host-ncurses
 
-HOST_MYSQL_CONF_OPTS = \
+HOST_MYSQL_MYSQL_CONF_OPTS = \
 	--with-embedded-server \
 	--disable-mysql-maintainer-mode
 
-MYSQL_CONF_OPTS += \
+MYSQL_MYSQL_CONF_OPTS += \
 	--localstatedir=/var/mysql \
 	--with-atomic-ops=up \
 	--with-embedded-server \
@@ -69,12 +76,12 @@ MYSQL_CONF_OPTS += \
 # Debugging is only available for the server, so no need for
 # this if-block outside of the server if-block
 ifeq ($(BR2_ENABLE_DEBUG),y)
-MYSQL_CONF_OPTS += --with-debug=full
+MYSQL_MYSQL_CONF_OPTS += --with-debug=full
 else
-MYSQL_CONF_OPTS += --without-debug
+MYSQL_MYSQL_CONF_OPTS += --without-debug
 endif
 
-define HOST_MYSQL_BUILD_CMDS
+define HOST_MYSQL_MYSQL_BUILD_CMDS
 	$(MAKE) -C $(@D)/include my_config.h
 	$(MAKE) -C $(@D)/mysys libmysys.a
 	$(MAKE) -C $(@D)/strings libmystrings.a
@@ -84,41 +91,188 @@ define HOST_MYSQL_BUILD_CMDS
 	$(MAKE) -C $(@D)/sql gen_lex_hash
 endef
 
-define HOST_MYSQL_INSTALL_CMDS
+define HOST_MYSQL_MYSQL_INSTALL_CMDS
 	$(INSTALL) -m 0755  $(@D)/sql/gen_lex_hash  $(HOST_DIR)/usr/bin/
 endef
 
-define MYSQL_USERS
+define MYSQL_MYSQL_USERS
 	mysql -1 nogroup -1 * /var/mysql - - MySQL daemon
 endef
 
-define MYSQL_ADD_FOLDER
+define MYSQL_MYSQL_ADD_FOLDER
 	$(INSTALL) -d $(TARGET_DIR)/var/mysql
 endef
 
-MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER
+MYSQL_MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER
 
-define MYSQL_INSTALL_INIT_SYSV
+define MYSQL_MYSQL_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 0755 package/mysql/S97mysqld \
 		$(TARGET_DIR)/etc/init.d/S97mysqld
 endef
 
 else
-MYSQL_CONF_OPTS += \
+MYSQL_MYSQL_CONF_OPTS += \
 	--without-server
 endif
 
 
-define MYSQL_REMOVE_TEST_PROGS
+define MYSQL_MYSQL_REMOVE_TEST_PROGS
 	rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench
 endef
 
-define MYSQL_ADD_MYSQL_LIB_PATH
+define MYSQL_MYSQL_ADD_MYSQL_LIB_PATH
 	echo "/usr/lib/mysql" >> $(TARGET_DIR)/etc/ld.so.conf
 endef
 
-MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_REMOVE_TEST_PROGS
-MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_MYSQL_LIB_PATH
+MYSQL_MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_MYSQL_REMOVE_TEST_PROGS
+MYSQL_MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_MYSQL_ADD_MYSQL_LIB_PATH
+
+################################################################################
+#
+# mariadb galera cluster implementation
+#
+################################################################################
+
+# According to MariaDB galera cluster documentation these options must be passed
+# to CMake:
+MYSQL_MARIADB_GALERA_CLUSTER_OPTS += "-DWITH_WSREP=1"
+MYSQL_MARIADB_GALERA_CLUSTER_OPTS += "-DWITH_INNODB_DISALLOW_WRITES=1"
+
+# msgpack causes trouble when cross-compiling:
+MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DGRN_WITH_MESSAGE_PACK=no"
+
+# Mroonga needs libstemmer. Some work still needs to be done before it can be
+# included in buildroot. Disable it for now.
+MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DWITHOUT_MROONGA=1"
+
+# This value is determined automatically during straight compile by compiling
+# and running a test code. You cannot do that during cross-compile. However the 
+# stack grows downward in most if not all modern systems. The only exception I
+# am aware of is PA-RISC which is not supported by buildroot. Therefore it makes
+# sense to hardcode the value. If an arch is added the stack of which grows up
+# one should expect unpredictable behavior at run time.
+MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DSTACK_DIRECTION=-1"
+
+# XTRADB requires atomics intrinsic. MariaDB package tests for them by compiling
+# and running C code which is not possible when cross-compiling. It is probably
+# probably possible to use BR2_ARCH_HAS_ATOMIC_INTRINSICS instead of compiling
+# and running some test code but for now we will just disable XTRADB.
+MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DWITHOUT_XTRADB=1"
+
+# Jemalloc was added for TokuDB. Since its configure script seems somewhat broken
+# when it comes to cross-compilation we shall disable it and also disable TokuDB.
+MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DWITH_JEMALLOC=no -DWITHOUT_TOKUDB=1"
+
+MYSQL_MARIADB_GALERA_VERSION = 10.0.17
+MYSQL_MARIADB_GALERA_SOURCE = mariadb-galera-$(MYSQL_MARIADB_GALERA_VERSION).tar.gz
+MYSQL_MARIADB_GALERA_SITE = https://downloads.mariadb.org/interstitial/mariadb-galera-$(MYSQL_MARIADB_GALERA_VERSION)/source/
+
+# In order to cross-compile mariadb galera cluster one should first natively
+# build in order to use some of the generated executables. They are then
+# included by import_executables.cmake which is generated during the native
+# build. Therefore host-mariadb-galera needs to be added to mariadb galera
+# dependencies and
+# -DIMPORT_EXECUTABLES=$(BUILD_DIR)/host-mariadb-galera/import_executables.cmake
+# must be passed to cmake
+MYSQL_MARIADB_GALERA_TARGET_BUILD_IMPORT += "-DIMPORT_EXECUTABLES=$(HOST_MYSQL_DIR)/import_executables.cmake"
+
+
+MYSQL_MARIADB_GALERA_INSTALL_STAGING = NO
+MYSQL_MARIADB_GALERA_INSTALL_TARGET = YES
+
+MYSQL_MARIADB_GALERA_DEPENDENCIES = \
+	host-mysql \
+	ncurses \
+	openssl \
+	zlib \
+	libaio \
+	libtool \
+	galera
+
+MYSQL_MARIADB_GALERA_CONF_OPTS = $(MYSQL_MARIADB_GALERA_EXTRA_OPTS)
+MYSQL_MARIADB_GALERA_CONF_OPTS += $(MYSQL_MARIADB_GALERA_TARGET_BUILD_IMPORT)
+HOST_MYSQL_MARIADB_GALERA_CONF_OPTS = $(MYSQL_MARIADB_GALERA_EXTRA_OPTS)
+
+# Options specific to Galera cluster
+MYSQL_MARIADB_GALERA_CONF_OPTS += $(MYSQL_MARIADB_GALERA_CLUSTER_OPTS)
+HOST_MYSQL_MARIADB_GALERA_CONF_OPTS += $(MYSQL_MARIADB_GALERA_CLUSTER_OPTS)
+
+# Post install configuration
+
+define MYSQL_MARIADB_GALERA_USERS
+	mysql 1000 mysql 1000 * /var/lib/mysql - - MySQL Server
+endef
+
+define MYSQL_MARIADB_GALERA_INSTALL_CNF
+	mkdir -p $(TARGET_DIR)/etc/mysql/conf.d
+	install -m 644 package/mysql/mariadb-galera-cluster.cnf $(TARGET_DIR)/etc/mysql/my.cnf
+endef
+
+MYSQL_MARIADB_GALERA_POST_INSTALL_TARGET_HOOKS += MYSQL_MARIADB_GALERA_INSTALL_CNF
 
+define MYSQL_MARIADB_GALERA_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 $(@D)/support-files/mysql.server.sh \
+		$(TARGET_DIR)/etc/init.d/mysqld
+endef
+
+# generic options
+
+MYSQL_MARIADB_GALERA_AUTORECONF = NO
+MYSQL_MARIADB_GALERA_LICENSE = GPLv2
+MYSQL_MARIADB_GALERA_LICENSE_FILES = README COPYING COPYING.LESSER
+
+################################################################################
+#
+# meta package
+#
+################################################################################
+
+
+ifeq ($(MYSQL_MYSQL),y)
+	MYSQL_VERSION = $(MYSQL_MYSQL_VERSION)
+	MYSQL_SOURCE = $(MYSQL_MYSQL_SOURCE)
+	MYSQL_SITE = $(MYSQL_MYSQL_SITE)
+	MYSQL_INSTALL_STAGING = $(MYSQL_MYSQL_INSTALL_STAGING)
+	MYSQL_DEPENDENCIES = $(MYSQL_MYSQL_DEPENDENCIES)
+	MYSQL_AUTORECONF = $(MYSQL_MYSQL_AUTORECONF)
+	MYSQL_LICENSE = $(MYSQL_MYSQL_LICENSE)
+	MYSQL_LICENSE_FILES = $(MYSQL_MYSQL_LICENSE_FILES)
+	MYSQL_CONF_ENV = $(MYSQL_MYSQL_CONF_ENV)
+	MYSQL_CONF_OPTS = $(MYSQL_MYSQL_CONF_OPTS)
+
+	MYSQL_USERS = $(MYSQL_MYSQL_USERS)
+	MYSQL_POST_INSTALL_TARGET_HOOKS += $(MYSQL_MYSQL_POST_INSTALL_TARGET_HOOKS)
+
+	MYSQL_INSTALL_INIT_SYSV = $(MYSQL_MYSQL_INSTALL_INIT_SYSV)
+
+	HOST_MYSQL_DEPENDENCIES = $(HOST_MYSQL_MYSQL_DEPENDENCIES)
+	HOST_MYSQL_CONF_OPTS = $(HOST_MYSQL_MYSQL_CONF_OPTS)
+	HOST_MYSQL_BUILD_CMDS = $(HOST_MYSQL_MYSQL_BUILD_CMDS)
+	HOST_MYSQL_INSTALL_CMDS = $(HOST_MYSQL_MYSQL_INSTALL_CMDS)
+else ifeq ($(MYSQL_MARIADB_GALERA),y)
+	MYSQL_VERSION = $(MYSQL_MARIADB_GALERA_VERSION)
+	MYSQL_SOURCE = $(MYSQL_MARIADB_GALERA_SOURCE)
+	MYSQL_SITE = $(MYSQL_MARIADB_GALERA_SITE)
+	MYSQL_INSTALL_STAGING = $(MYSQL_MARIADB_GALERA_INSTALL_STAGING)
+	MYSQL_DEPENDENCIES = $(MYSQL_MARIADB_GALERA_DEPENDENCIES)
+	MYSQL_AUTORECONF = $(MYSQL_MARIADB_GALERA_AUTORECONF)
+	MYSQL_LICENSE = $(MYSQL_MARIADB_GALERA_LICENSE)
+	MYSQL_LICENSE_FILES = $(MYSQL_MARIADB_GALERA_LICENSE_FILES)
+	MYSQL_CONF_OPTS = $(MYSQL_MARIADB_GALERA_CONF_OPTS)
+
+	MYSQL_USERS = $(MYSQL_MARIADB_GALERA_USERS)
+	MYSQL_POST_INSTALL_TARGET_HOOKS += $(MYSQL_MARIADB_GALERA_POST_INSTALL_TARGET_HOOKS)
+
+	MYSQL_INSTALL_INIT_SYSV = $(MYSQL_MARIADB_GALERA_INSTALL_INIT_SYSV)
+
+	HOST_MYSQL_DEPENDENCIES = $(HOST_MYSQL_MARIADB_GALERA_DEPENDENCIES)
+	HOST_MYSQL_CONF_OPTS = $(HOST_MYSQL_MARIADB_GALERA_CONF_OPTS)
+endif
+
+ifeq ($(MYSQL_MYSQL),y)
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
+else ifeq ($(MYSQL_MARIADB_GALERA),y)
+$(eval $(host-cmake-package))
+$(eval $(cmake-package))
+endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 3/7 v2] galera: new package
  2015-07-09 16:21 ` [Buildroot] [PATCH 3/7 v2] galera: new package Sylvain Raybaud
@ 2015-07-09 21:29   ` Samuel Martin
  2015-07-09 21:53     ` Arnout Vandecappelle
  2015-08-21 13:39     ` Sylvain Raybaud
  0 siblings, 2 replies; 34+ messages in thread
From: Samuel Martin @ 2015-07-09 21:29 UTC (permalink / raw)
  To: buildroot

Hi Sylvain,

On Thu, Jul 9, 2015 at 6:21 PM, Sylvain Raybaud
<sylvain.raybaud@green-communications.fr> wrote:
> Add package galera: wsrep provider for MySQL and MariaDB galera cluster.
>
> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
> ---
> Changes v1 -> v2:
>  - Remove duplicated block in package/galera/galera.mk
>
>  package/Config.in                                  |  1 +
>  package/galera/Config.in                           |  9 ++++
>  ...lera-01-fix_sconstruct_for-crosscompiling.patch | 52 ++++++++++++++++++++++
>  package/galera/galera.hash                         |  2 +
>  package/galera/galera.mk                           | 49 ++++++++++++++++++++
>  5 files changed, 113 insertions(+)
>  create mode 100644 package/galera/Config.in
>  create mode 100644 package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
>  create mode 100644 package/galera/galera.hash
>  create mode 100644 package/galera/galera.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 72ec372..b15d026 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -740,6 +740,7 @@ menu "Database"
>         source "package/cppdb/Config.in"
>         source "package/gdbm/Config.in"
>         source "package/leveldb/Config.in"
> +       source "package/galera/Config.in"
>         source "package/mysql/Config.in"
>         source "package/postgresql/Config.in"
>         source "package/redis/Config.in"
> diff --git a/package/galera/Config.in b/package/galera/Config.in
> new file mode 100644
> index 0000000..4c50427
> --- /dev/null
> +++ b/package/galera/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_GALERA
> +       bool "galera"
> +       select BR2_PACKAGE_BOOST
> +       select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
> +       select BR2_PACKAGE_OPENSSL
> +       select BR2_PACKAGE_CHECK
> +       help
> +         Galera WSREP provider
> +         http://galeracluster.com/
> diff --git a/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch b/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
> new file mode 100644
> index 0000000..25c9d59
> --- /dev/null
> +++ b/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
> @@ -0,0 +1,52 @@
> +Fix cross compilation
> +
> +--- a/SConstruct       2015-05-28 12:23:41.027461788 +0200
> ++++ b/SConstruct       2015-07-02 11:27:55.763337287 +0200
> +@@ -15,18 +15,17 @@
> + ####################################################################
> +
> + import os
> +-import platform
> + import string
> +
> +-sysname = os.uname()[0].lower()
> +-machine = platform.machine()
> +-bits = platform.architecture()[0]
> ++sysname = "linux"
> ++machine = os.environ['BR2_ARCH']
> ++bits = os.environ['BR2_x86']
> + print 'Host: ' + sysname + ' ' + machine + ' ' + bits
> +
> + x86 = 0
> +-if bits == '32bit':
> ++if bits == '32':
> +     x86 = 32
> +-elif bits == '64bit':
> ++elif bits == '64':
> +     x86 = 64
> +
> +
> +@@ -240,6 +239,15 @@
> + #
> + env.Append(LINKFLAGS = link_arch)
> +
> ++# Cross-compilation
> ++
> ++if 'CROSS' in os.environ:
> ++        cross = os.environ['CROSS']
> ++        env.Append(CROSS = cross)
> ++        env.Replace(CC = cross + 'gcc')
> ++        env.Replace(CXX = cross + 'g++')
> ++        env.Replace(LD = cross + 'ld')
> ++
> + #
> + # Check required headers and libraries (autoconf functionality)
> + #
> +@@ -405,7 +413,7 @@
> +
> + # these will be used only with our softaware
> + if strict_build_flags == 1:
> +-    conf.env.Append(CPPFLAGS = ' -Werror')
> ++    conf.env.Append(CPPFLAGS = ' -Werror -Wno-error=uninitialized -Wno-error=pedantic')
Hum... -Werror is more a development flag than an integration one. It
should certainly be removed.

> +     conf.env.Append(CCFLAGS  = ' -pedantic')
> +     conf.env.Append(CXXFLAGS = ' -Weffc++ -Wold-style-cast')
> diff --git a/package/galera/galera.hash b/package/galera/galera.hash
> new file mode 100644
> index 0000000..d3872e1
> --- /dev/null
> +++ b/package/galera/galera.hash
> @@ -0,0 +1,2 @@
> +# From http://releases.galeracluster.com/source/galera-3-25.3.10.tar.gz
> +sha1   03f69fa87dc14fa4d793e7afab601e285c570809        galera-3-25.3.10.tar.gz
> diff --git a/package/galera/galera.mk b/package/galera/galera.mk
> new file mode 100644
> index 0000000..f9bf0d0
> --- /dev/null
> +++ b/package/galera/galera.mk
> @@ -0,0 +1,49 @@
> +################################################################################
> +#
> +# galera
> +#
> +################################################################################
> +
> +GALERA_VERSION = 3-25.3.10
> +GALERA_SOURCE = galera-$(GALERA_VERSION).tar.gz
> +GALERA_SITE = http://releases.galeracluster.com/source/
> +
> +GALERA_INSTALL_STAGING = NO
> +GALERA_INSTALL_TARGET = YES
> +
> +GALERA_DEPENDENCIES = boost openssl check host-scons
> +
> +GALERA_LIBNAME = libgalera_smm.so
> +
> +GALERA_SCONS_ENV = $(TARGET_CONFIGURE_OPTS) BR2_ARCH=$(BR2_ARCH)
> +ifeq ($(BR2_x86_64),y)
> +GALERA_SCONS_ENV += BR2_x86=64
BR2_ prefix is usually reserved for buildroot scope. Maybe this
variable could be rename GALERA_BITWISE instead of BR2_x86?

> +else ifeq ($(BR2_i386),y)
> +GALERA_SCONS_ENV += BR2_x86=32
> +else
> +GALERA_SCONS_ENV += BR2_x86=0
Hum... looks dubious!
Does this mean that galera is only available for x86 and x86_64 target?
Other architectures can also be available in 32bits and 64bits
(arm/aarch64, mips/mips64, etc).
Last thing, the variable BR2_ARCH_IS_64 is set when the bitwise is
64bit, whatever the CPU architecture, so prefer using it.

> +endif
> +
> +GALERA_SCONS_OPTS = \
> +       arch=$(BR2_ARCH) \
> +       prefix=/usr \
> +       extra_sysroot=$(STAGING_DIR) \
> +       tests=0
> +
> +define GALERA_BUILD_CMDS
> +        cd $(@D) && \
> +         $(GALERA_SCONS_ENV) \
> +         CROSS=$(TARGET_CROSS) \
CROSS=... can be appended to the GALERA_SCONS_ENV variable.

> +         $(SCONS) \
> +         $(GALERA_SCONS_OPTS)
> +endef
> +
> +define GALERA_INSTALL_TARGET_CMDS
> +       $(INSTALL) -m 644 $(@D)/$(GALERA_LIBNAME) $(TARGET_DIR)/usr/lib/$(GALERA_LIBNAME)
> +endef
> +
> +GALERA_LICENSE = GPLv2
> +GALERA_LICENSE_FILES = LICENSE COPYING
> +
> +$(eval $(generic-package))
> +$(eval $(host-generic-package))
Why a host-galera package?
Note that, as is, this host-galera package will build/install nothing
because of the generic infra used without any HOST_GALERA_*_CMDS
definition.

Regards,


-- 
Samuel

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 3/7 v2] galera: new package
  2015-07-09 21:29   ` Samuel Martin
@ 2015-07-09 21:53     ` Arnout Vandecappelle
  2015-08-21 13:20       ` Sylvain Raybaud
  2015-08-21 13:39     ` Sylvain Raybaud
  1 sibling, 1 reply; 34+ messages in thread
From: Arnout Vandecappelle @ 2015-07-09 21:53 UTC (permalink / raw)
  To: buildroot

On 07/09/15 23:29, Samuel Martin wrote:
> Hi Sylvain,
> 
> On Thu, Jul 9, 2015 at 6:21 PM, Sylvain Raybaud
> <sylvain.raybaud@green-communications.fr> wrote:
>> Add package galera: wsrep provider for MySQL and MariaDB galera cluster.
>>
>> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
>> ---
>> Changes v1 -> v2:
>>  - Remove duplicated block in package/galera/galera.mk
>>
>>  package/Config.in                                  |  1 +
>>  package/galera/Config.in                           |  9 ++++
>>  ...lera-01-fix_sconstruct_for-crosscompiling.patch | 52 ++++++++++++++++++++++
>>  package/galera/galera.hash                         |  2 +
>>  package/galera/galera.mk                           | 49 ++++++++++++++++++++
>>  5 files changed, 113 insertions(+)
>>  create mode 100644 package/galera/Config.in
>>  create mode 100644 package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
>>  create mode 100644 package/galera/galera.hash
>>  create mode 100644 package/galera/galera.mk
>>
>> diff --git a/package/Config.in b/package/Config.in
>> index 72ec372..b15d026 100644
>> --- a/package/Config.in
>> +++ b/package/Config.in
>> @@ -740,6 +740,7 @@ menu "Database"
>>         source "package/cppdb/Config.in"
>>         source "package/gdbm/Config.in"
>>         source "package/leveldb/Config.in"
>> +       source "package/galera/Config.in"
>>         source "package/mysql/Config.in"
>>         source "package/postgresql/Config.in"
>>         source "package/redis/Config.in"
>> diff --git a/package/galera/Config.in b/package/galera/Config.in
>> new file mode 100644
>> index 0000000..4c50427
>> --- /dev/null
>> +++ b/package/galera/Config.in
>> @@ -0,0 +1,9 @@
>> +config BR2_PACKAGE_GALERA
>> +       bool "galera"
>> +       select BR2_PACKAGE_BOOST
>> +       select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
>> +       select BR2_PACKAGE_OPENSSL
>> +       select BR2_PACKAGE_CHECK
>> +       help
>> +         Galera WSREP provider
>> +         http://galeracluster.com/
>> diff --git a/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch b/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
>> new file mode 100644
>> index 0000000..25c9d59
>> --- /dev/null
>> +++ b/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
>> @@ -0,0 +1,52 @@
>> +Fix cross compilation
>> +
>> +--- a/SConstruct       2015-05-28 12:23:41.027461788 +0200
>> ++++ b/SConstruct       2015-07-02 11:27:55.763337287 +0200
>> +@@ -15,18 +15,17 @@
>> + ####################################################################
>> +
>> + import os
>> +-import platform
>> + import string
>> +
>> +-sysname = os.uname()[0].lower()
>> +-machine = platform.machine()
>> +-bits = platform.architecture()[0]
>> ++sysname = "linux"
>> ++machine = os.environ['BR2_ARCH']
>> ++bits = os.environ['BR2_x86']
>> + print 'Host: ' + sysname + ' ' + machine + ' ' + bits
>> +
>> + x86 = 0
>> +-if bits == '32bit':
>> ++if bits == '32':
>> +     x86 = 32
>> +-elif bits == '64bit':
>> ++elif bits == '64':
>> +     x86 = 64
>> +
>> +
>> +@@ -240,6 +239,15 @@
>> + #
>> + env.Append(LINKFLAGS = link_arch)
>> +
>> ++# Cross-compilation
>> ++
>> ++if 'CROSS' in os.environ:
>> ++        cross = os.environ['CROSS']
>> ++        env.Append(CROSS = cross)
>> ++        env.Replace(CC = cross + 'gcc')
>> ++        env.Replace(CXX = cross + 'g++')

 This means ccache will not be used. We prefer to pass CC and CXX in the
environment (through TARGET_CONFIGURE_OPTS). I think that would even work out of
the box without any patch, no?

>> ++        env.Replace(LD = cross + 'ld')
>> ++
>> + #
>> + # Check required headers and libraries (autoconf functionality)
>> + #
>> +@@ -405,7 +413,7 @@
>> +
>> + # these will be used only with our softaware
>> + if strict_build_flags == 1:
>> +-    conf.env.Append(CPPFLAGS = ' -Werror')
>> ++    conf.env.Append(CPPFLAGS = ' -Werror -Wno-error=uninitialized -Wno-error=pedantic')
> Hum... -Werror is more a development flag than an integration one. It
> should certainly be removed.

 Better yet, make sure the strict_build_flags is not set.


 Regards,
 Arnout

[snip]


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-07-09 16:22 ` [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant Sylvain Raybaud
@ 2015-07-09 21:56   ` Samuel Martin
  2015-07-10  7:54     ` Thomas Petazzoni
                       ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Samuel Martin @ 2015-07-09 21:56 UTC (permalink / raw)
  To: buildroot

Hi Sylvain,

Here is a partial review (inlined).

But, overall, I feel like this implementation (essentially the *.mk
file) does not match the Buildroot way of doing things... :-/
Have you look at the virtual package infrastructure [1]?

On Thu, Jul 9, 2015 at 6:22 PM, Sylvain Raybaud
<sylvain.raybaud@green-communications.fr> wrote:
> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
> ---
>  .../mariadb-galera-01-fix_xtradb_cmakelist.patch   |  27 +++
>  .../mariadb-galera-02-fix_innodb_cmakelist.patch   | 251 +++++++++++++++++++++
>  package/mysql/Config.in                            |  43 +++-
>  package/mysql/mariadb-galera-cluster.cnf           | 204 +++++++++++++++++
>  package/mysql/mysql.hash                           |   2 +
>  package/mysql/mysql.mk                             | 216 +++++++++++++++---
>  6 files changed, 707 insertions(+), 36 deletions(-)
>  create mode 100644 package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
>  create mode 100644 package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>  create mode 100644 package/mysql/mariadb-galera-cluster.cnf
>
> diff --git a/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch b/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
> new file mode 100644
> index 0000000..83eac77
> --- /dev/null
> +++ b/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
> @@ -0,0 +1,27 @@
> +Do not perform test if the build is not requested anyway. The test may fail,
> +preventing building the whole package.
> +
The comment does not really reflect what is done in the patch:
- according to the comment: this change touch tests;
- AFAICS, this change disable a plugin.

Missing SoB line [2].

> +--- a/storage/xtradb/CMakeLists.txt    2014-10-30 16:24:33.160188627 +0100
> ++++ b/storage/xtradb/CMakeLists.txt    2014-10-30 16:25:09.060188829 +0100
> +@@ -470,12 +470,13 @@
> +   SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
> + ENDIF()
> +
> +-IF(XTRADB_OK)
> +-  MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
> +-    DEFAULT
> +-    RECOMPILE_FOR_EMBEDDED
> +-    LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
> +-ELSE()
> +-  MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
> ++IF(NOT WITHOUT_XTRADB)
Does this boolean come from an option? it could.

> ++  IF(XTRADB_OK)
> ++    MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE
> ++      DEFAULT
> ++      RECOMPILE_FOR_EMBEDDED
> ++      LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
> ++  ELSE()
> ++    MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this platform")
> ++  ENDIF()
> + ENDIF()
> +-
> diff --git a/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
> new file mode 100644
> index 0000000..1ddec5d
> --- /dev/null
> +++ b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
> @@ -0,0 +1,251 @@
> +Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS in order to be
> +cross-compile friendly.
> +In buildroot another solution (maybe better, maybe not) could be to use
> +BR2_ARCH_HAS_ATOMICS in order to determine the value of HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
> +and likes.
> +
Missing SoB line [2].

It makes sense to submit this patch upstream as well.

> +--- a/storage/innobase/CMakeLists.txt  2014-11-07 17:05:48.853208487 +0100
> ++++ b/storage/innobase/CMakeLists.txt  2014-11-07 17:11:38.061217839 +0100
> +@@ -58,100 +58,99 @@
> +
> + IF(NOT MSVC)
> + # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
> +-IF(NOT CMAKE_CROSSCOMPILING)
> +-  # workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686
> +-  IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
> +-     CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3")
> +-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
> +-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
> +-  ENDIF()
> +-  CHECK_C_SOURCE_RUNS(
> +-  "
> +-  int main()
> +-  {
> +-    long      x;
> +-    long      y;
> +-    long      res;
> +-
> +-    x = 10;
> +-    y = 123;
> +-    res = __sync_bool_compare_and_swap(&x, x, y);
> +-    if (!res || x != y) {
> +-      return(1);
> +-    }
> +-
> +-    x = 10;
> +-    y = 123;
> +-    res = __sync_bool_compare_and_swap(&x, x + 1, y);
> +-    if (res || x != 10) {
> +-      return(1);
> +-    }
> +-    x = 10;
> +-    y = 123;
> +-    res = __sync_add_and_fetch(&x, y);
> +-    if (res != 123 + 10 || x != 123 + 10) {
> +-      return(1);
> +-    }
> +-    return(0);
> +-  }"
> +-  HAVE_IB_GCC_ATOMIC_BUILTINS
> +-  )
> +-  CHECK_C_SOURCE_RUNS(
> +-  "
> +-  int main()
> +-  {
> +-    long      res;
> +-    char      c;
> +-
> +-    c = 10;
> +-    res = __sync_lock_test_and_set(&c, 123);
> +-    if (res != 10 || c != 123) {
> +-      return(1);
> +-    }
> +-    return(0);
> +-  }"
> +-  HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
> +-  )
> +-  CHECK_C_SOURCE_RUNS(
> +-  "#include<stdint.h>
> +-  int main()
> +-  {
> +-    int64_t   x,y,res;
> +-
> +-    x = 10;
> +-    y = 123;
> +-    res = __sync_sub_and_fetch(&y, x);
> +-    if (res != y || y != 113) {
> +-      return(1);
> +-    }
> +-    res = __sync_add_and_fetch(&y, x);
> +-    if (res != y || y != 123) {
> +-      return(1);
> +-    }
> +-    return(0);
> +-  }"
> +-  HAVE_IB_GCC_ATOMIC_BUILTINS_64
> +-  )
> +-  CHECK_C_SOURCE_RUNS(
> +-  "#include<stdint.h>
> +-  int main()
> +-  {
> +-    __sync_synchronize();
> +-    return(0);
> +-  }"
> +-  HAVE_IB_GCC_SYNC_SYNCHRONISE
> +-  )
> +-  CHECK_C_SOURCE_RUNS(
> +-  "#include<stdint.h>
> +-  int main()
> +-  {
> +-    __atomic_thread_fence(__ATOMIC_ACQUIRE);
> +-    __atomic_thread_fence(__ATOMIC_RELEASE);
> +-    return(0);
> +-  }"
> +-  HAVE_IB_GCC_ATOMIC_THREAD_FENCE
> +-  )
> +-ENDIF()
> ++
> ++# workaround for gcc 4.1.2 RHEL5/x86, gcc atomic ops only work under -march=i686
> ++IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
> ++   CMAKE_C_COMPILER_VERSION VERSION_LESS "4.1.3")
> ++  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
> ++  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
> ++ENDIF()
> ++CHECK_C_SOURCE_COMPILES(
> ++"
> ++int main()
> ++{
> ++  long        x;
> ++  long        y;
> ++  long        res;
> ++
> ++  x = 10;
> ++  y = 123;
> ++  res = __sync_bool_compare_and_swap(&x, x, y);
> ++  if (!res || x != y) {
> ++    return(1);
> ++  }
> ++
> ++  x = 10;
> ++  y = 123;
> ++  res = __sync_bool_compare_and_swap(&x, x + 1, y);
> ++  if (res || x != 10) {
> ++    return(1);
> ++  }
> ++  x = 10;
> ++  y = 123;
> ++  res = __sync_add_and_fetch(&x, y);
> ++  if (res != 123 + 10 || x != 123 + 10) {
> ++    return(1);
> ++  }
> ++  return(0);
> ++}"
> ++HAVE_IB_GCC_ATOMIC_BUILTINS
> ++)
> ++CHECK_C_SOURCE_COMPILES(
> ++"
> ++int main()
> ++{
> ++  long        res;
> ++  char        c;
> ++
> ++  c = 10;
> ++  res = __sync_lock_test_and_set(&c, 123);
> ++  if (res != 10 || c != 123) {
> ++    return(1);
> ++  }
> ++  return(0);
> ++}"
> ++HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE
> ++)
> ++CHECK_C_SOURCE_COMPILES(
> ++"#include<stdint.h>
> ++int main()
> ++{
> ++  int64_t     x,y,res;
> ++
> ++  x = 10;
> ++  y = 123;
> ++  res = __sync_sub_and_fetch(&y, x);
> ++  if (res != y || y != 113) {
> ++    return(1);
> ++  }
> ++  res = __sync_add_and_fetch(&y, x);
> ++  if (res != y || y != 123) {
> ++    return(1);
> ++  }
> ++  return(0);
> ++}"
> ++HAVE_IB_GCC_ATOMIC_BUILTINS_64
> ++)
> ++CHECK_C_SOURCE_COMPILES(
> ++"#include<stdint.h>
> ++int main()
> ++{
> ++  __sync_synchronize();
> ++  return(0);
> ++}"
> ++HAVE_IB_GCC_SYNC_SYNCHRONISE
> ++)
> ++CHECK_C_SOURCE_COMPILES(
> ++"#include<stdint.h>
> ++int main()
> ++{
> ++  __atomic_thread_fence(__ATOMIC_ACQUIRE);
> ++  __atomic_thread_fence(__ATOMIC_RELEASE);
> ++return(0);
> ++}"
> ++HAVE_IB_GCC_ATOMIC_THREAD_FENCE
> ++)
> +
> + IF(HAVE_IB_GCC_ATOMIC_BUILTINS)
> +  ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_BUILTINS=1)
> +@@ -173,28 +172,26 @@
> +  ADD_DEFINITIONS(-DHAVE_IB_GCC_ATOMIC_THREAD_FENCE=1)
> + ENDIF()
> +
> +- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
> +-IF(NOT CMAKE_CROSSCOMPILING)
> +-  CHECK_C_SOURCE_RUNS(
> +-  "
> +-  #include <pthread.h>
> +-  #include <string.h>
> +-
> +-  int main() {
> +-    pthread_t       x1;
> +-    pthread_t       x2;
> +-    pthread_t       x3;
> +-
> +-    memset(&x1, 0x0, sizeof(x1));
> +-    memset(&x2, 0x0, sizeof(x2));
> +-    memset(&x3, 0x0, sizeof(x3));
> +-
> +-    __sync_bool_compare_and_swap(&x1, x2, x3);
> +-
> +-    return(0);
> +-  }"
> +-  HAVE_IB_ATOMIC_PTHREAD_T_GCC)
> +-ENDIF()
> ++# either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
> ++CHECK_C_SOURCE_COMPILES(
> ++"
> ++#include <pthread.h>
> ++#include <string.h>
> ++
> ++int main() {
> ++  pthread_t       x1;
> ++  pthread_t       x2;
> ++  pthread_t       x3;
> ++
> ++  memset(&x1, 0x0, sizeof(x1));
> ++  memset(&x2, 0x0, sizeof(x2));
> ++  memset(&x3, 0x0, sizeof(x3));
> ++  __sync_bool_compare_and_swap(&x1, x2, x3);
> ++
> ++  return(0);
> ++}"
> ++HAVE_IB_ATOMIC_PTHREAD_T_GCC)
> ++
> + IF(HAVE_IB_ATOMIC_PTHREAD_T_GCC)
> +   ADD_DEFINITIONS(-DHAVE_IB_ATOMIC_PTHREAD_T_GCC=1)
> + ENDIF()
> diff --git a/package/mysql/Config.in b/package/mysql/Config.in
> index 7133892..a1a2d23 100644
> --- a/package/mysql/Config.in
> +++ b/package/mysql/Config.in
> @@ -1,8 +1,17 @@
>  config BR2_PACKAGE_MYSQL
> +       bool "mysql"
> +
> +if BR2_PACKAGE_MYSQL
> +choice
> +       prompt "MySQL database system implementation"
> +       default MYSQL_MYSQL
> +
> +config MYSQL_MYSQL
>         bool "MySQL"
>         depends on BR2_INSTALL_LIBSTDCPP
>         depends on BR2_USE_MMU # fork()
>         depends on BR2_TOOLCHAIN_HAS_THREADS
> +       depends on BR2_USE_MMU
duplicate, to be removed

>         select BR2_PACKAGE_NCURSES
>         select BR2_PACKAGE_READLINE
>         help
> @@ -10,7 +19,35 @@ config BR2_PACKAGE_MYSQL
>
>           http://www.mysql.com/
>
> -if BR2_PACKAGE_MYSQL
> +config MYSQL_MARIADB_GALERA
> +       bool "mariadb-galera"
> +       select BR2_PACKAGE_NCURSES
> +       select BR2_PACKAGE_OPENSSL
> +       select BR2_PACKAGE_ZLIB
> +       select BR2_PACKAGE_LIBAIO
> +       select BR2_PACKAGE_LIBTOOL
> +       select BR2_PACKAGE_GALERA
> +       select BR2_PACKAGE_BASH # runtime dependency only
> +       select BR2_PACKAGE_LSOF # runtime dependency only
> +       select BR2_PACKAGE_PROCPS_NG # runtime dependency only
> +       select BR2_PACKAGE_FINDUTILS # runtime dependency only
> +       select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
> +       depends on BR2_TOOLCHAIN_BUILDROOT_GLIBC || BR2_PACKAGE_EGLIBC # spawn()
Missing "depends on" for the selected packages [3].

> +       help
> +         MariaDB Galera Cluster.
> +         https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-cluster
> +
> +endchoice
> +
> +endif
> +
> +comment "MySQL needs a toolchain w/ C++, threads"
> +depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
Indent is wrong.
Missing: depends on BR2_USE_MMU
Move this comment in the choice.

> +
> +comment "MariaDB needs an (e)glibc toolchain"
> +depends on !BR2_TOOLCHAIN_BUILDROOT_GLIBC && !BR2_PACKAGE_EGLIBC # spawn()
Indent is wrong.
Move this comment in the choice.

> +
> +if MYSQL_MYSQL
>
>  config BR2_PACKAGE_MYSQL_SERVER
>         bool "MySQL server"
> @@ -18,7 +55,3 @@ config BR2_PACKAGE_MYSQL_SERVER
>           Install the MySQL server on the target.
>
>  endif
> -
> -comment "MySQL needs a toolchain w/ C++, threads"
> -       depends on BR2_USE_MMU
> -       depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS

---- end of this review ----

> diff --git a/package/mysql/mariadb-galera-cluster.cnf b/package/mysql/mariadb-galera-cluster.cnf
> new file mode 100644
> index 0000000..c3eddaa
> --- /dev/null
> +++ b/package/mysql/mariadb-galera-cluster.cnf
> @@ -0,0 +1,204 @@
> +# MariaDB database server configuration file.
> +#
> +# You can copy this file to one of:
> +# - "/etc/mysql/my.cnf" to set global options,
> +# - "~/.my.cnf" to set user-specific options.
> +#
> +# One can use all long options that the program supports.
> +# Run program with --help to get a list of available options and with
> +# --print-defaults to see which it would actually understand and use.
> +#
> +# For explanations see
> +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
> +
> +# This will be passed to all mysql clients
> +# It has been reported that passwords should be enclosed with ticks/quotes
> +# escpecially if they contain "#" chars...
> +# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
> +[client]
> +port           = 3306
> +socket         = /tmp/mysql.sock
> +
> +# Here is entries for some specific programs
> +# The following values assume you have at least 32M ram
> +
> +# This was formally known as [safe_mysqld]. Both versions are currently parsed.
> +[mysqld_safe]
> +socket         = /tmp/mysql.sock
> +nice           = 0
> +
> +[mysqld]
> +#
> +# * Basic Settings
> +#
> +user           = mysql
> +pid-file       = /tmp/mysql.pid
> +socket         = /tmp/mysql.sock
> +port           = 3306
> +basedir                = /usr
> +datadir                = /var/lib/mysql
> +tmpdir         = /tmp
> +lc_messages_dir        = /usr/share/
> +lc_messages    = en_US
> +skip-external-locking
> +
> +# Don't use DNS as it may not be available
> +skip-host-cache
> +skip-name-resolve
> +
> +#
> +# Instead of skip-networking the default is now to listen only on
> +# localhost which is more compatible and is not less secure.
> +#bind-address          = 127.0.0.1
> +#
> +# * Fine Tuning
> +#
> +max_connections                = 100
> +connect_timeout                = 5
> +wait_timeout           = 600
> +max_allowed_packet     = 16M
> +thread_cache_size       = 128
> +sort_buffer_size       = 4M
> +bulk_insert_buffer_size        = 16M
> +tmp_table_size         = 32M
> +max_heap_table_size    = 32M
> +#
> +# * MyISAM
> +#
> +# This replaces the startup script and checks MyISAM tables if needed
> +# the first time they are touched. On error, make copy and try a repair.
> +myisam_recover          = BACKUP
> +key_buffer_size                = 64M
> +#open-files-limit      = 2000
> +table_open_cache       = 400
> +myisam_sort_buffer_size        = 64M
> +concurrent_insert      = 2
> +read_buffer_size       = 2M
> +read_rnd_buffer_size   = 1M
> +#
> +# * Query Cache Configuration
> +#
> +# Cache only tiny result sets, so we can fit more in the query cache.
> +query_cache_limit              = 128K
> +query_cache_size               = 16M
> +# for more write intensive setups, set to DEMAND or OFF
> +#query_cache_type              = DEMAND
> +#
> +# * Logging and Replication
> +#
> +# Both location gets rotated by the cronjob.
> +# Be aware that this log type is a performance killer.
> +# As of 5.1 you can enable the log at runtime!
> +#general_log_file        = /var/lib/mysql/mysql.log
> +#general_log             = 1
> +#
> +# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
> +#
> +# we do want to know about network errors and such
> +log_warnings           = 2
> +#
> +# Enable the slow query log to see queries with especially long duration
> +#slow_query_log[={0|1}]
> +slow_query_log_file    = /var/lib/mysql/mariadb-slow.log
> +long_query_time = 10
> +#log_slow_rate_limit   = 1000
> +log_slow_verbosity     = query_plan
> +
> +#log-queries-not-using-indexes
> +#log_slow_admin_statements
> +#
> +# The following can be used as easy to replay backup logs or for replication.
> +# note: if you are setting up a replication slave, see README.Debian about
> +#       other settings you may need to change.
> +#server-id             = 1
> +#report_host           = master1
> +#auto_increment_increment = 2
> +#auto_increment_offset = 1
> +log_bin                        = /var/lib/mysql/mariadb-bin
> +log_bin_index          = /var/lib/mysql/mariadb-bin.index
> +# not fab for performance, but safer
> +#sync_binlog           = 1
> +expire_logs_days       = 10
> +max_binlog_size         = 100M
> +# slaves
> +#relay_log             = /var/lib/mysql/relay-bin
> +#relay_log_index       = /var/lib/mysql/relay-bin.index
> +#relay_log_info_file   = /var/lib/mysql/relay-bin.info
> +#log_slave_updates
> +#read_only
> +#
> +# If applications support it, this stricter sql_mode prevents some
> +# mistakes like inserting invalid dates etc.
> +#sql_mode              = NO_ENGINE_SUBSTITUTION,TRADITIONAL
> +#
> +# * InnoDB
> +#
> +# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
> +# Read the manual for more InnoDB related options. There are many!
> +default_storage_engine = InnoDB
> +# you can't just change log file size, requires special procedure
> +#innodb_log_file_size  = 50M
> +innodb_buffer_pool_size        = 64M
> +innodb_log_buffer_size = 8M
> +innodb_file_per_table  = 1
> +innodb_open_files      = 400
> +innodb_io_capacity     = 400
> +innodb_flush_method    = O_DIRECT
> +#
> +# * Security Features
> +#
> +# Read the manual, too, if you want chroot!
> +# chroot = /var/lib/mysql/
> +#
> +# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
> +#
> +# ssl-ca=/etc/mysql/cacert.pem
> +# ssl-cert=/etc/mysql/server-cert.pem
> +# ssl-key=/etc/mysql/server-key.pem
> +
> +#
> +# * Galera-related settings
> +#
> +
> +[galera]
> +# Mandatory settings
> +
> +# use InnoDB instead of XtraDB
> +ignore_builtin_innodb
> +innodb_autoinc_lock_mode=2
> +innodb_doublewrite=1
> +
> +plugin_load=innodb=ha_innodb.so
> +plugin_dir=/usr/lib/plugin
> +
> +wsrep_provider=/usr/lib/libgalera_smm.so
> +binlog_format=row
> +default_storage_engine=InnoDB
> +
> +query_cache_size=0 # mandatory only for versions prior to 5.5.40-galera, 10.0.14-galera and 10.1.2
> +wsrep_on=ON        # Enable wsrep replication
> +#wsrep_cluster_name=
> +#wsrep_cluster_address=
> +wsrep_sst_method=rsync
> +
> +#
> +# Optional setting
> +#wsrep_slave_threads=1
> +#innodb_flush_log_at_trx_commit=0
> +
> +[mysqldump]
> +quick
> +quote-names
> +max_allowed_packet     = 16M
> +
> +[mysql]
> +#no-auto-rehash        # faster start of mysql but no tab completition
> +
> +[isamchk]
> +key_buffer             = 16M
> +
> +#
> +# * IMPORTANT: Additional settings that can override those from this file!
> +#   The files must end with '.cnf', otherwise they'll be ignored.
> +#
> +!includedir /etc/mysql/conf.d/
> diff --git a/package/mysql/mysql.hash b/package/mysql/mysql.hash
> index 84f3361..d9f3574 100644
> --- a/package/mysql/mysql.hash
> +++ b/package/mysql/mysql.hash
> @@ -1,2 +1,4 @@
>  # From https://downloads.mariadb.com/archives/mysql-5.1/mysql-5.1.73.tar.gz.md5
>  md5    887f869bcc757957067b9198f707f32f        mysql-5.1.73.tar.gz
> +# From: https://downloads.mariadb.org/interstitial/mariadb-galera-10.0.17/source/mariadb-galera-10.0.17.tar.gz
> +sha1    91b70d19fb687a58f0e40f50608071489743e54e       mariadb-galera-10.0.17.tar.gz
> diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk
> index 8718193..9abf50e 100644
> --- a/package/mysql/mysql.mk
> +++ b/package/mysql/mysql.mk
> @@ -4,17 +4,24 @@
>  #
>  ################################################################################
>
> -MYSQL_VERSION_MAJOR = 5.1
> -MYSQL_VERSION = $(MYSQL_VERSION_MAJOR).73
> -MYSQL_SOURCE = mysql-$(MYSQL_VERSION).tar.gz
> -MYSQL_SITE = http://downloads.skysql.com/archives/mysql-$(MYSQL_VERSION_MAJOR)
> -MYSQL_INSTALL_STAGING = YES
> -MYSQL_DEPENDENCIES = readline ncurses
> -MYSQL_AUTORECONF = YES
> -MYSQL_LICENSE = GPLv2
> -MYSQL_LICENSE_FILES = README COPYING
> -
> -MYSQL_CONF_ENV = \
> +################################################################################
> +#
> +# mysql implementation
> +#
> +################################################################################
> +
> +
> +MYSQL_MYSQL_VERSION_MAJOR = 5.1
> +MYSQL_MYSQL_VERSION = $(MYSQL_MYSQL_VERSION_MAJOR).73
> +MYSQL_MYSQL_SOURCE = mysql-$(MYSQL_MYSQL_VERSION).tar.gz
> +MYSQL_MYSQL_SITE = http://downloads.skysql.com/archives/mysql-$(MYSQL_MYSQL_VERSION_MAJOR)
> +MYSQL_MYSQL_INSTALL_STAGING = YES
> +MYSQL_MYSQL_DEPENDENCIES = readline ncurses
> +MYSQL_MYSQL_AUTORECONF = YES
> +MYSQL_MYSQL_LICENSE = GPLv2
> +MYSQL_MYSQL_LICENSE_FILES = README COPYING
> +
> +MYSQL_MYSQL_CONF_ENV = \
>         ac_cv_sys_restartable_syscalls=yes \
>         ac_cv_path_PS=/bin/ps \
>         ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null" \
> @@ -23,7 +30,7 @@ MYSQL_CONF_ENV = \
>         ac_cv_have_decl_HAVE_IB_GCC_ATOMIC_BUILTINS=yes \
>         mysql_cv_new_rl_interface=yes
>
> -MYSQL_CONF_OPTS = \
> +MYSQL_MYSQL_CONF_OPTS = \
>         --without-ndb-binlog \
>         --without-docs \
>         --without-man \
> @@ -34,22 +41,22 @@ MYSQL_CONF_OPTS = \
>         --disable-mysql-maintainer-mode
>
>  ifeq ($(BR2_PACKAGE_OPENSSL),y)
> -MYSQL_DEPENDENCIES += openssl
> +MYSQL_MYSQL_DEPENDENCIES += openssl
>  endif
>
>  ifeq ($(BR2_PACKAGE_ZLIB),y)
> -MYSQL_DEPENDENCIES += zlib
> +MYSQL_MYSQL_DEPENDENCIES += zlib
>  endif
>
>  ifeq ($(BR2_PACKAGE_MYSQL_SERVER),y)
> -MYSQL_DEPENDENCIES += host-mysql host-bison
> -HOST_MYSQL_DEPENDENCIES = host-zlib host-ncurses
> +MYSQL_MYSQL_DEPENDENCIES += host-mysql host-bison
> +HOST_MYSQL_MYSQL_DEPENDENCIES = host-zlib host-ncurses
>
> -HOST_MYSQL_CONF_OPTS = \
> +HOST_MYSQL_MYSQL_CONF_OPTS = \
>         --with-embedded-server \
>         --disable-mysql-maintainer-mode
>
> -MYSQL_CONF_OPTS += \
> +MYSQL_MYSQL_CONF_OPTS += \
>         --localstatedir=/var/mysql \
>         --with-atomic-ops=up \
>         --with-embedded-server \
> @@ -69,12 +76,12 @@ MYSQL_CONF_OPTS += \
>  # Debugging is only available for the server, so no need for
>  # this if-block outside of the server if-block
>  ifeq ($(BR2_ENABLE_DEBUG),y)
> -MYSQL_CONF_OPTS += --with-debug=full
> +MYSQL_MYSQL_CONF_OPTS += --with-debug=full
>  else
> -MYSQL_CONF_OPTS += --without-debug
> +MYSQL_MYSQL_CONF_OPTS += --without-debug
>  endif
>
> -define HOST_MYSQL_BUILD_CMDS
> +define HOST_MYSQL_MYSQL_BUILD_CMDS
>         $(MAKE) -C $(@D)/include my_config.h
>         $(MAKE) -C $(@D)/mysys libmysys.a
>         $(MAKE) -C $(@D)/strings libmystrings.a
> @@ -84,41 +91,188 @@ define HOST_MYSQL_BUILD_CMDS
>         $(MAKE) -C $(@D)/sql gen_lex_hash
>  endef
>
> -define HOST_MYSQL_INSTALL_CMDS
> +define HOST_MYSQL_MYSQL_INSTALL_CMDS
>         $(INSTALL) -m 0755  $(@D)/sql/gen_lex_hash  $(HOST_DIR)/usr/bin/
>  endef
>
> -define MYSQL_USERS
> +define MYSQL_MYSQL_USERS
>         mysql -1 nogroup -1 * /var/mysql - - MySQL daemon
>  endef
>
> -define MYSQL_ADD_FOLDER
> +define MYSQL_MYSQL_ADD_FOLDER
>         $(INSTALL) -d $(TARGET_DIR)/var/mysql
>  endef
>
> -MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER
> +MYSQL_MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER
>
> -define MYSQL_INSTALL_INIT_SYSV
> +define MYSQL_MYSQL_INSTALL_INIT_SYSV
>         $(INSTALL) -D -m 0755 package/mysql/S97mysqld \
>                 $(TARGET_DIR)/etc/init.d/S97mysqld
>  endef
>
>  else
> -MYSQL_CONF_OPTS += \
> +MYSQL_MYSQL_CONF_OPTS += \
>         --without-server
>  endif
>
>
> -define MYSQL_REMOVE_TEST_PROGS
> +define MYSQL_MYSQL_REMOVE_TEST_PROGS
>         rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench
>  endef
>
> -define MYSQL_ADD_MYSQL_LIB_PATH
> +define MYSQL_MYSQL_ADD_MYSQL_LIB_PATH
>         echo "/usr/lib/mysql" >> $(TARGET_DIR)/etc/ld.so.conf
>  endef
>
> -MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_REMOVE_TEST_PROGS
> -MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_MYSQL_LIB_PATH
> +MYSQL_MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_MYSQL_REMOVE_TEST_PROGS
> +MYSQL_MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_MYSQL_ADD_MYSQL_LIB_PATH
> +
> +################################################################################
> +#
> +# mariadb galera cluster implementation
> +#
> +################################################################################
> +
> +# According to MariaDB galera cluster documentation these options must be passed
> +# to CMake:
> +MYSQL_MARIADB_GALERA_CLUSTER_OPTS += "-DWITH_WSREP=1"
> +MYSQL_MARIADB_GALERA_CLUSTER_OPTS += "-DWITH_INNODB_DISALLOW_WRITES=1"
> +
> +# msgpack causes trouble when cross-compiling:
> +MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DGRN_WITH_MESSAGE_PACK=no"
> +
> +# Mroonga needs libstemmer. Some work still needs to be done before it can be
> +# included in buildroot. Disable it for now.
> +MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DWITHOUT_MROONGA=1"
> +
> +# This value is determined automatically during straight compile by compiling
> +# and running a test code. You cannot do that during cross-compile. However the
> +# stack grows downward in most if not all modern systems. The only exception I
> +# am aware of is PA-RISC which is not supported by buildroot. Therefore it makes
> +# sense to hardcode the value. If an arch is added the stack of which grows up
> +# one should expect unpredictable behavior at run time.
> +MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DSTACK_DIRECTION=-1"
> +
> +# XTRADB requires atomics intrinsic. MariaDB package tests for them by compiling
> +# and running C code which is not possible when cross-compiling. It is probably
> +# probably possible to use BR2_ARCH_HAS_ATOMIC_INTRINSICS instead of compiling
> +# and running some test code but for now we will just disable XTRADB.
> +MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DWITHOUT_XTRADB=1"
> +
> +# Jemalloc was added for TokuDB. Since its configure script seems somewhat broken
> +# when it comes to cross-compilation we shall disable it and also disable TokuDB.
> +MYSQL_MARIADB_GALERA_EXTRA_OPTS += "-DWITH_JEMALLOC=no -DWITHOUT_TOKUDB=1"
> +
> +MYSQL_MARIADB_GALERA_VERSION = 10.0.17
> +MYSQL_MARIADB_GALERA_SOURCE = mariadb-galera-$(MYSQL_MARIADB_GALERA_VERSION).tar.gz
> +MYSQL_MARIADB_GALERA_SITE = https://downloads.mariadb.org/interstitial/mariadb-galera-$(MYSQL_MARIADB_GALERA_VERSION)/source/
> +
> +# In order to cross-compile mariadb galera cluster one should first natively
> +# build in order to use some of the generated executables. They are then
> +# included by import_executables.cmake which is generated during the native
> +# build. Therefore host-mariadb-galera needs to be added to mariadb galera
> +# dependencies and
> +# -DIMPORT_EXECUTABLES=$(BUILD_DIR)/host-mariadb-galera/import_executables.cmake
> +# must be passed to cmake
> +MYSQL_MARIADB_GALERA_TARGET_BUILD_IMPORT += "-DIMPORT_EXECUTABLES=$(HOST_MYSQL_DIR)/import_executables.cmake"
> +
> +
> +MYSQL_MARIADB_GALERA_INSTALL_STAGING = NO
> +MYSQL_MARIADB_GALERA_INSTALL_TARGET = YES
> +
> +MYSQL_MARIADB_GALERA_DEPENDENCIES = \
> +       host-mysql \
> +       ncurses \
> +       openssl \
> +       zlib \
> +       libaio \
> +       libtool \
> +       galera
> +
> +MYSQL_MARIADB_GALERA_CONF_OPTS = $(MYSQL_MARIADB_GALERA_EXTRA_OPTS)
> +MYSQL_MARIADB_GALERA_CONF_OPTS += $(MYSQL_MARIADB_GALERA_TARGET_BUILD_IMPORT)
> +HOST_MYSQL_MARIADB_GALERA_CONF_OPTS = $(MYSQL_MARIADB_GALERA_EXTRA_OPTS)
> +
> +# Options specific to Galera cluster
> +MYSQL_MARIADB_GALERA_CONF_OPTS += $(MYSQL_MARIADB_GALERA_CLUSTER_OPTS)
> +HOST_MYSQL_MARIADB_GALERA_CONF_OPTS += $(MYSQL_MARIADB_GALERA_CLUSTER_OPTS)
> +
> +# Post install configuration
> +
> +define MYSQL_MARIADB_GALERA_USERS
> +       mysql 1000 mysql 1000 * /var/lib/mysql - - MySQL Server
> +endef
> +
> +define MYSQL_MARIADB_GALERA_INSTALL_CNF
> +       mkdir -p $(TARGET_DIR)/etc/mysql/conf.d
> +       install -m 644 package/mysql/mariadb-galera-cluster.cnf $(TARGET_DIR)/etc/mysql/my.cnf
> +endef
> +
> +MYSQL_MARIADB_GALERA_POST_INSTALL_TARGET_HOOKS += MYSQL_MARIADB_GALERA_INSTALL_CNF
>
> +define MYSQL_MARIADB_GALERA_INSTALL_INIT_SYSV
> +       $(INSTALL) -D -m 0755 $(@D)/support-files/mysql.server.sh \
> +               $(TARGET_DIR)/etc/init.d/mysqld
> +endef
> +
> +# generic options
> +
> +MYSQL_MARIADB_GALERA_AUTORECONF = NO
> +MYSQL_MARIADB_GALERA_LICENSE = GPLv2
> +MYSQL_MARIADB_GALERA_LICENSE_FILES = README COPYING COPYING.LESSER
> +
> +################################################################################
> +#
> +# meta package
> +#
> +################################################################################
> +
> +
> +ifeq ($(MYSQL_MYSQL),y)
> +       MYSQL_VERSION = $(MYSQL_MYSQL_VERSION)
> +       MYSQL_SOURCE = $(MYSQL_MYSQL_SOURCE)
> +       MYSQL_SITE = $(MYSQL_MYSQL_SITE)
> +       MYSQL_INSTALL_STAGING = $(MYSQL_MYSQL_INSTALL_STAGING)
> +       MYSQL_DEPENDENCIES = $(MYSQL_MYSQL_DEPENDENCIES)
> +       MYSQL_AUTORECONF = $(MYSQL_MYSQL_AUTORECONF)
> +       MYSQL_LICENSE = $(MYSQL_MYSQL_LICENSE)
> +       MYSQL_LICENSE_FILES = $(MYSQL_MYSQL_LICENSE_FILES)
> +       MYSQL_CONF_ENV = $(MYSQL_MYSQL_CONF_ENV)
> +       MYSQL_CONF_OPTS = $(MYSQL_MYSQL_CONF_OPTS)
> +
> +       MYSQL_USERS = $(MYSQL_MYSQL_USERS)
> +       MYSQL_POST_INSTALL_TARGET_HOOKS += $(MYSQL_MYSQL_POST_INSTALL_TARGET_HOOKS)
> +
> +       MYSQL_INSTALL_INIT_SYSV = $(MYSQL_MYSQL_INSTALL_INIT_SYSV)
> +
> +       HOST_MYSQL_DEPENDENCIES = $(HOST_MYSQL_MYSQL_DEPENDENCIES)
> +       HOST_MYSQL_CONF_OPTS = $(HOST_MYSQL_MYSQL_CONF_OPTS)
> +       HOST_MYSQL_BUILD_CMDS = $(HOST_MYSQL_MYSQL_BUILD_CMDS)
> +       HOST_MYSQL_INSTALL_CMDS = $(HOST_MYSQL_MYSQL_INSTALL_CMDS)
> +else ifeq ($(MYSQL_MARIADB_GALERA),y)
> +       MYSQL_VERSION = $(MYSQL_MARIADB_GALERA_VERSION)
> +       MYSQL_SOURCE = $(MYSQL_MARIADB_GALERA_SOURCE)
> +       MYSQL_SITE = $(MYSQL_MARIADB_GALERA_SITE)
> +       MYSQL_INSTALL_STAGING = $(MYSQL_MARIADB_GALERA_INSTALL_STAGING)
> +       MYSQL_DEPENDENCIES = $(MYSQL_MARIADB_GALERA_DEPENDENCIES)
> +       MYSQL_AUTORECONF = $(MYSQL_MARIADB_GALERA_AUTORECONF)
> +       MYSQL_LICENSE = $(MYSQL_MARIADB_GALERA_LICENSE)
> +       MYSQL_LICENSE_FILES = $(MYSQL_MARIADB_GALERA_LICENSE_FILES)
> +       MYSQL_CONF_OPTS = $(MYSQL_MARIADB_GALERA_CONF_OPTS)
> +
> +       MYSQL_USERS = $(MYSQL_MARIADB_GALERA_USERS)
> +       MYSQL_POST_INSTALL_TARGET_HOOKS += $(MYSQL_MARIADB_GALERA_POST_INSTALL_TARGET_HOOKS)
> +
> +       MYSQL_INSTALL_INIT_SYSV = $(MYSQL_MARIADB_GALERA_INSTALL_INIT_SYSV)
> +
> +       HOST_MYSQL_DEPENDENCIES = $(HOST_MYSQL_MARIADB_GALERA_DEPENDENCIES)
> +       HOST_MYSQL_CONF_OPTS = $(HOST_MYSQL_MARIADB_GALERA_CONF_OPTS)
> +endif
> +
> +ifeq ($(MYSQL_MYSQL),y)
>  $(eval $(autotools-package))
>  $(eval $(host-autotools-package))
> +else ifeq ($(MYSQL_MARIADB_GALERA),y)
> +$(eval $(host-cmake-package))
> +$(eval $(cmake-package))
> +endif
> --
> 1.9.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot


[1] http://nightly.buildroot.org/manual.html#_infrastructure_for_virtual_packages
[2] http://nightly.buildroot.org/manual.html#_format_and_licensing_of_the_package_patches
[3] http://nightly.buildroot.org/manual.html#depends-on-vs-select

Regards,

-- 
Samuel

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-07-09 21:56   ` Samuel Martin
@ 2015-07-10  7:54     ` Thomas Petazzoni
  2015-08-07 13:44       ` Sylvain Raybaud
  2015-08-21  8:23     ` Sylvain Raybaud
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 34+ messages in thread
From: Thomas Petazzoni @ 2015-07-10  7:54 UTC (permalink / raw)
  To: buildroot

Dear Samuel Martin,

On Thu, 9 Jul 2015 23:56:25 +0200, Samuel Martin wrote:

> Here is a partial review (inlined).
> 
> But, overall, I feel like this implementation (essentially the *.mk
> file) does not match the Buildroot way of doing things... :-/
> Have you look at the virtual package infrastructure [1]?

Fully agreed. Using the same package for both MySQL and MariaDB would
make sense if their build system was similar. But it's completely
different, so it really needs to be two separate packages.

Then, if their client libraries are compatible, so that client
applications can use either MySQL or MariaDB with no change, then doing
a virtual package is indeed the right direction.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 2/7 v2] libaio: add host variant
  2015-07-09 16:21 ` [Buildroot] [PATCH 2/7 v2] libaio: add host variant Sylvain Raybaud
@ 2015-07-10 22:30   ` Yann E. MORIN
  2015-07-10 23:01     ` Yann E. MORIN
  2015-07-10 23:00   ` Thomas Petazzoni
  1 sibling, 1 reply; 34+ messages in thread
From: Yann E. MORIN @ 2015-07-10 22:30 UTC (permalink / raw)
  To: buildroot

Sylvain, All,

On 2015-07-09 18:21 +0200, Sylvain Raybaud spake thusly:
> host-libaio is needed to build host-mysql in its mariadb variant which is needed to build the target variant of mariadb.

Commit logs should be limited to ~80 chars. Otherwise:

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
> ---
> Changes v1 -> v2:
>   Explain why we need to build host-libaio in commit log (suggested by Yann E. Morin)
> 
>  package/libaio/libaio.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/libaio/libaio.mk b/package/libaio/libaio.mk
> index 53ad7eb..55e2cc7 100644
> --- a/package/libaio/libaio.mk
> +++ b/package/libaio/libaio.mk
> @@ -24,3 +24,4 @@ define LIBAIO_INSTALL_TARGET_CMDS
>  endef
>  
>  $(eval $(generic-package))
> +$(eval $(host-generic-package))
> -- 
> 1.9.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 4/7 v2] pkg-cmake: add PKG_CONFIG_* variables to help cmake find host packages
  2015-07-09 16:21 ` [Buildroot] [PATCH 4/7 v2] pkg-cmake: add PKG_CONFIG_* variables to help cmake find host packages Sylvain Raybaud
@ 2015-07-10 22:47   ` Samuel Martin
  0 siblings, 0 replies; 34+ messages in thread
From: Samuel Martin @ 2015-07-10 22:47 UTC (permalink / raw)
  To: buildroot

Hi Sylvain,

On Thu, Jul 9, 2015 at 6:21 PM, Sylvain Raybaud
<sylvain.raybaud@green-communications.fr> wrote:
> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
> ---
>  package/pkg-cmake.mk | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index f17a883..a757a2b 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -111,6 +111,8 @@ define $(2)_CONFIGURE_CMDS
>         cd $$($$(PKG)_BUILDDIR) && \
>         rm -f CMakeCache.txt && \
>         PATH=$$(BR_PATH) \
> +       PKG_CONFIG_PATH='$$(HOST_DIR)/usr/lib/pkgconfig' \
> +       PKG_CONFIG_SYSROOT_DIR='$$(HOST_DIR)' \
The PKG_CONFIG_SYSROOT_DIR is wrong.

Anyway, these settings should be set the same way they are for
host-autotools packages, see [1].

>         $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
>                 -DCMAKE_INSTALL_SO_NO_EXE=0 \
>                 -DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
> --
> 1.9.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

[1] http://git.buildroot.net/buildroot/tree/package/Makefile.in#n304

Regards,

-- 
Samuel

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet
  2015-07-09 16:21 ` [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet Sylvain Raybaud
@ 2015-07-10 22:48   ` Samuel Martin
  2015-07-10 22:58   ` Thomas Petazzoni
  1 sibling, 0 replies; 34+ messages in thread
From: Samuel Martin @ 2015-07-10 22:48 UTC (permalink / raw)
  To: buildroot

On Thu, Jul 9, 2015 at 6:21 PM, Sylvain Raybaud
<sylvain.raybaud@green-communications.fr> wrote:
> Set CONFIGURE_FEATURE_FANCY_SLEEP and CONFIG_FEATURE_FLOAT_SLEEP so that sleep accept floating point arguments.
> This add 492 bytes to the busybox binary compiled for arm or 2748 bytes when compiled for i386.
>
> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>

Regards,

-- 
Samuel

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet
  2015-07-09 16:21 ` [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet Sylvain Raybaud
  2015-07-10 22:48   ` Samuel Martin
@ 2015-07-10 22:58   ` Thomas Petazzoni
  2015-07-10 23:06     ` Sylvain Raybaud
  1 sibling, 1 reply; 34+ messages in thread
From: Thomas Petazzoni @ 2015-07-10 22:58 UTC (permalink / raw)
  To: buildroot

Dear Sylvain Raybaud,

On Thu,  9 Jul 2015 18:21:59 +0200, Sylvain Raybaud wrote:
> Set CONFIGURE_FEATURE_FANCY_SLEEP and CONFIG_FEATURE_FLOAT_SLEEP so that sleep accept floating point arguments.
> This add 492 bytes to the busybox binary compiled for arm or 2748 bytes when compiled for i386.
> 
> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
> ---
> Changes v1 -> v2:
>  - Add information about the impact on busybox binary size induced by patching busybox.config (suggested by Thomas Petazzoni)

Applied, thanks.

Next time, can you remember to wrap your commit log to ~72 columns?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 2/7 v2] libaio: add host variant
  2015-07-09 16:21 ` [Buildroot] [PATCH 2/7 v2] libaio: add host variant Sylvain Raybaud
  2015-07-10 22:30   ` Yann E. MORIN
@ 2015-07-10 23:00   ` Thomas Petazzoni
  1 sibling, 0 replies; 34+ messages in thread
From: Thomas Petazzoni @ 2015-07-10 23:00 UTC (permalink / raw)
  To: buildroot

Dear Sylvain Raybaud,

On Thu,  9 Jul 2015 18:21:56 +0200, Sylvain Raybaud wrote:
> host-libaio is needed to build host-mysql in its mariadb variant which is needed to build the target variant of mariadb.
> 
> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
> ---
> Changes v1 -> v2:
>   Explain why we need to build host-libaio in commit log (suggested by Yann E. Morin)
> 
>  package/libaio/libaio.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/libaio/libaio.mk b/package/libaio/libaio.mk
> index 53ad7eb..55e2cc7 100644
> --- a/package/libaio/libaio.mk
> +++ b/package/libaio/libaio.mk
> @@ -24,3 +24,4 @@ define LIBAIO_INSTALL_TARGET_CMDS
>  endef
>  
>  $(eval $(generic-package))
> +$(eval $(host-generic-package))

This does not build anything: for a generic package, if you don't
explicitly state what to do at configure/build/install time, then
nothing happens.

Can you rework that?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 2/7 v2] libaio: add host variant
  2015-07-10 22:30   ` Yann E. MORIN
@ 2015-07-10 23:01     ` Yann E. MORIN
  0 siblings, 0 replies; 34+ messages in thread
From: Yann E. MORIN @ 2015-07-10 23:01 UTC (permalink / raw)
  To: buildroot

Sylvain, All,

On 2015-07-11 00:30 +0200, Yann E. MORIN spake thusly:
> On 2015-07-09 18:21 +0200, Sylvain Raybaud spake thusly:
> > host-libaio is needed to build host-mysql in its mariadb variant which is needed to build the target variant of mariadb.
> 
> Commit logs should be limited to ~80 chars. Otherwise:
> 
> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

He, hold on...

Thomas just made me see the light: this is a generic package, so you
need to provide the _{CONFIGURE,BUILD,INSTALL}_CMDS !

Otherwise, nothing happens...

Sorry for the confusion... :-(

Regards,
Yann E. MORIN.

> Regards,
> Yann E. MORIN.
> 
> > Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
> > ---
> > Changes v1 -> v2:
> >   Explain why we need to build host-libaio in commit log (suggested by Yann E. Morin)
> > 
> >  package/libaio/libaio.mk | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/package/libaio/libaio.mk b/package/libaio/libaio.mk
> > index 53ad7eb..55e2cc7 100644
> > --- a/package/libaio/libaio.mk
> > +++ b/package/libaio/libaio.mk
> > @@ -24,3 +24,4 @@ define LIBAIO_INSTALL_TARGET_CMDS
> >  endef
> >  
> >  $(eval $(generic-package))
> > +$(eval $(host-generic-package))
> > -- 
> > 1.9.1
> > 
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> 
> -- 
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet
  2015-07-10 22:58   ` Thomas Petazzoni
@ 2015-07-10 23:06     ` Sylvain Raybaud
  0 siblings, 0 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-07-10 23:06 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas, Samuel, All,

On 11/07/2015 00:58, Thomas Petazzoni wrote:
> Dear Sylvain Raybaud,
> 
> On Thu,  9 Jul 2015 18:21:59 +0200, Sylvain Raybaud wrote:
>> Set CONFIGURE_FEATURE_FANCY_SLEEP and CONFIG_FEATURE_FLOAT_SLEEP
>> so that sleep accept floating point arguments. This add 492 bytes
>> to the busybox binary compiled for arm or 2748 bytes when
>> compiled for i386.
>> 
>> Signed-off-by: Sylvain Raybaud
>> <sylvain.raybaud@green-communications.fr> --- Changes v1 -> v2: -
>> Add information about the impact on busybox binary size induced
>> by patching busybox.config (suggested by Thomas Petazzoni)
> 
> Applied, thanks.
> 
> Next time, can you remember to wrap your commit log to ~72
> columns?
> 
> Thanks!

Sure thing. Thanks! Working on your other feedback now.

Cheers,

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJVoE/nAAoJEEkkwl4JtJ9yVagP/iyHKdM1OVj2tfbsnV4j/CjA
qyD1H+79pZuv7apDfudpVJum52qrSX6pSj08SAFfe7uerBaXp/rDYy3cj1zeSn3c
a+OTHW2/Fw4P5PNruA23QzXWdzEKXvIsURYH248OCTsZRWI+oA94EW9c3Ni/Qz3M
6hExosZprx0/FJqRZQerCj6qDoXSea45Q58CIgdnNOPyE84jdCmJ944jhSUDhsFv
U1t1m7FUzDuB0vXP5IP9jSyTuXafO0b30UijKlLKzghC9zZLaXVE30BlrMvJo8zL
+SP5aNo5MI5kMlW4AchxMgrir5siFnxPD+LR51Zj7cm+QYnnVD8RCJMORCkoc/es
16OpQzOY61cZnlcrvThzGptJQ3a10HcFD4yo68JMVpebp1hP0BjSupgCw4aWyr1T
WVy/QK/VimyOxkgrcPDVeLQCdzypCoPtRarb+eiaiCDIJ245IIWvwi9wNq2YHNbS
a27r1CaBdl31HN4a8a8QNqgGrJ+uvHDaeBS7Gyd0oUG2can1dh6Ht6+GeTKnhgdF
rLFW9DYSehvxTEvNwldYQ/wUUKJCvCzQd0K7K1S1dhG0p1h/XM5J+Lt7Y3LQoinc
k7kEHV+TvWGKUi9LLLMPtXtnWKqWqTk8bik1cwg4vdz21GLULwXzt/U2KtUsocmb
75D4p5oKYZm/swI0WrK7
=ig9O
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 1/7 v2] check: new package
  2015-07-09 16:21 ` [Buildroot] [PATCH 1/7 v2] check: new package Sylvain Raybaud
@ 2015-07-10 23:06   ` Yann E. MORIN
  0 siblings, 0 replies; 34+ messages in thread
From: Yann E. MORIN @ 2015-07-10 23:06 UTC (permalink / raw)
  To: buildroot

Sylvain, All,

On 2015-07-09 18:21 +0200, Sylvain Raybaud spake thusly:
> Add package check: a unit test library.
> 
> Signed-off-by: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
> ---
> 
> Changes v1 -> v2:
>  - Fixed Config.in (suggested by Yann E. Morin)
>  - Fixed hash file (suggested by Yann E. Morin)
>  - Changed dependency from pgkconf to host-pkgconf (suggested by Yann E. Morin)
>  - Fixed license (suggested by Yann E. Morin)
>  - Leave CHECK_INSTALL_STAGING and CHECK_INSTALL_TARGET to their default values (suggested by Yann E. Morin)

No, you should have kept staging, because it installs a library.

The rule is:
  - only executable: keep the defaults (target=Y, staging=N)
  - only installs static libs: target=N, staging=Y
  - install shared libs: target=Y, staging=Y

So, in your case, you want to keep the default for target, but also
instal in staging.

Regards,
Yann E. MORIN.

>  package/Config.in        |  1 +
>  package/check/Config.in  |  7 +++++++
>  package/check/check.hash |  2 ++
>  package/check/check.mk   | 17 +++++++++++++++++
>  4 files changed, 27 insertions(+)
>  create mode 100644 package/check/Config.in
>  create mode 100644 package/check/check.hash
>  create mode 100644 package/check/check.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index 13a7e74..72ec372 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1014,6 +1014,7 @@ menu "Other"
>  	source "package/atf/Config.in"
>  	source "package/bdwgc/Config.in"
>  	source "package/boost/Config.in"
> +	source "package/check/Config.in"
>  	source "package/clapack/Config.in"
>  	source "package/classpath/Config.in"
>  	source "package/cppcms/Config.in"
> diff --git a/package/check/Config.in b/package/check/Config.in
> new file mode 100644
> index 0000000..4bdb4c8
> --- /dev/null
> +++ b/package/check/Config.in
> @@ -0,0 +1,7 @@
> +config BR2_PACKAGE_CHECK
> +	bool "check"
> +	select BR2_PACKAGE_LIBTOOL
> +	select BR2_PACKAGE_PKGCONF
> +	help
> +	  Unit testing framework for C
> +	  http://check.sourceforge.net/
> diff --git a/package/check/check.hash b/package/check/check.hash
> new file mode 100644
> index 0000000..8ade191
> --- /dev/null
> +++ b/package/check/check.hash
> @@ -0,0 +1,2 @@
> +# Locally computed:
> +sha1	4b79e2d485d014ddb438e322b64235347d57b0ff	check-0.9.14.tar.gz
> diff --git a/package/check/check.mk b/package/check/check.mk
> new file mode 100644
> index 0000000..83fd4fb
> --- /dev/null
> +++ b/package/check/check.mk
> @@ -0,0 +1,17 @@
> +################################################################################
> +#
> +# check
> +#
> +################################################################################
> +
> +CHECK_VERSION = 0.9.14
> +CHECK_SOURCE = check-$(CHECK_VERSION).tar.gz
> +CHECK_SITE = http://downloads.sourceforge.net/project/check/check/$(CHECK_VERSION)/
> +
> +CHECK_DEPENDENCIES = libtool host-pkgconf
> +
> +CHECK_LICENSE =  LGPLv2.1+
> +CHECK_LICENSE_FILES = COPYING.LESSER
> +
> +$(eval $(autotools-package))
> +$(eval $(host-autotools-package))
> -- 
> 1.9.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-07-10  7:54     ` Thomas Petazzoni
@ 2015-08-07 13:44       ` Sylvain Raybaud
  2015-08-08  8:43         ` Thomas Petazzoni
  0 siblings, 1 reply; 34+ messages in thread
From: Sylvain Raybaud @ 2015-08-07 13:44 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas, Samuel, all

Back working on this after some time off. I've made some of the fixes
you suggested. I've got a question about this one.

On 10/07/2015 09:54, Thomas Petazzoni wrote:
> Dear Samuel Martin,
> 
> On Thu, 9 Jul 2015 23:56:25 +0200, Samuel Martin wrote:
> 
>> Here is a partial review (inlined).
>> 
>> But, overall, I feel like this implementation (essentially the
>> *.mk file) does not match the Buildroot way of doing things...
>> :-/ Have you look at the virtual package infrastructure [1]?
> 
> Fully agreed. Using the same package for both MySQL and MariaDB
> would make sense if their build system was similar. But it's
> completely different, so it really needs to be two separate
> packages.
> 
> Then, if their client libraries are compatible, so that client 
> applications can use either MySQL or MariaDB with no change, then
> doing a virtual package is indeed the right direction.
> 
> Best regards,
> 
> Thomas
> 

OK I can make a virtual package, that seems to make sense. However,
according to section 17.11.6, it seems that I'll have to patch all
packages that depend on mysql, because there is some special magic to
add in the depender's Config.in, am I right? Is this the way to go?

Cheers,

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJVxLZaAAoJEEkkwl4JtJ9ylCEP/Am9kDIzaEj8fEC+q9pfjq5s
Bxo80/MJrg7jgWGK/82/aaXShAhA0q9MDDB1vwIFKz+jsDiuHcuqWWzrXl0RhNpb
Rlwk+pcJFvBKXBHX0b7p+8etVneAdvlr0avWfkdfNKqo1ARXrpfyp0kmbIaAfjPc
PqgxXK7DlV7inJ6dtvA4ziJ9KAb90P4dG07xmogOfJhFLRujRapaVhEobyeoMdl+
CXUJEJakulxShHTmi7F6JYZyLx2XWsB/O1580I0PszrUniuQjPT7bDWYqX8yABki
pSVpGA20g8k10q3Y3GIE6cY37/YtuazPNIQUZI1WvTzkIrv28qGM73BFJQ6eSrz9
2tHCW0zSYDOZTgxSfjODxhCZJOIYqHKV2X4ZlAiOIAAGXpcOogy+ctGJkNVJF98e
mQsBf0Mb95WZYfJt4DbIGCsSIwFnEuzs6TM7PZBtO6/z6sRFJ7/11zmD9lnezJjD
dhYpXkfMwLTYNkpqJWoIW+KLvi9JenuGKkFW+9e9sumwjFfXSkakEIDWY+mkjUgE
izgNoMB4CBrkwry5H+OsE5VJi+OBsfhEyG8CbV36JZphXgAqNmBde485aRnFHbeb
CgkHklSg1PRYpuILO6CrbP6zjXbpAh/73CMJoL0Ym12ttD/7QcElQW8kiAHIN2P7
4NQVPFV3eMZPmXXofhbu
=2TBq
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-08-07 13:44       ` Sylvain Raybaud
@ 2015-08-08  8:43         ` Thomas Petazzoni
  2015-08-08 23:22           ` Yann E. MORIN
  2015-08-20 12:05           ` Sylvain Raybaud
  0 siblings, 2 replies; 34+ messages in thread
From: Thomas Petazzoni @ 2015-08-08  8:43 UTC (permalink / raw)
  To: buildroot

Dear Sylvain Raybaud,

On Fri, 07 Aug 2015 15:44:58 +0200, Sylvain Raybaud wrote:

> OK I can make a virtual package, that seems to make sense. However,
> according to section 17.11.6, it seems that I'll have to patch all
> packages that depend on mysql, because there is some special magic to
> add in the depender's Config.in, am I right? Is this the way to go?

We could do something like jpeg (virtual), libjpeg and jpeg-turbo. This
way, dependers can continue to do a "select BR2_PACKAGE_MYSQL", and
there is a "choice" in mysql/Config.in to choose between the original
MySQL or MariaDB. Of course the original MySQL package will have to be
renamed to some other name than mysql.

I think the mechanism where the package depending on the virtual
package do "depends on BR2_PACKAGE_HAS_<foo>" is very good for cases
like OpenGL and al. where we have potentially an arbitrary/unlimited
number of providers.

But for things like libjpeg/jpeg-turbo or mysql/mariadb, where we know
the choice will be limited to a few alternatives, it probably makes
sense to have something like libjpeg.

I've Cc'ed Yann, to get his opinion on the matter.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-08-08  8:43         ` Thomas Petazzoni
@ 2015-08-08 23:22           ` Yann E. MORIN
  2015-08-09  8:46             ` Thomas Petazzoni
  2015-08-22 22:21             ` Arnout Vandecappelle
  2015-08-20 12:05           ` Sylvain Raybaud
  1 sibling, 2 replies; 34+ messages in thread
From: Yann E. MORIN @ 2015-08-08 23:22 UTC (permalink / raw)
  To: buildroot

Thomas, Sylvain, All,

On 2015-08-08 10:43 +0200, Thomas Petazzoni spake thusly:
> On Fri, 07 Aug 2015 15:44:58 +0200, Sylvain Raybaud wrote:
> > OK I can make a virtual package, that seems to make sense. However,
> > according to section 17.11.6, it seems that I'll have to patch all
> > packages that depend on mysql, because there is some special magic to
> > add in the depender's Config.in, am I right? Is this the way to go?
> 
> We could do something like jpeg (virtual), libjpeg and jpeg-turbo. This
> way, dependers can continue to do a "select BR2_PACKAGE_MYSQL", and
> there is a "choice" in mysql/Config.in to choose between the original
> MySQL or MariaDB. Of course the original MySQL package will have to be
> renamed to some other name than mysql.
> 
> I think the mechanism where the package depending on the virtual
> package do "depends on BR2_PACKAGE_HAS_<foo>" is very good for cases
> like OpenGL and al. where we have potentially an arbitrary/unlimited
> number of providers.
> 
> But for things like libjpeg/jpeg-turbo or mysql/mariadb, where we know
> the choice will be limited to a few alternatives, it probably makes
> sense to have something like libjpeg.
> 
> I've Cc'ed Yann, to get his opinion on the matter.

Well, I never much liked the way the jpeg package has been done.

I do understand that it makes it just work great for users. However,
that was not the way virtual packages were supposed to work; it's
just a (bad) hack (which in fact predates the actual virtual package
infra, IIRC).

And it's a hack that prevents a br2-external from providing its own
jpeg implementation (e.g. one optimised to make use of a specific SoC
hardware, for example).

Now, the mariadb vs. mysql case might not be so problematic. We don't
much expect a myriad of alternate implementations to just pop-up over
the night, and even less hardware-specific implementations. But who
knows? That's probably what we originally thought about the jpeg case,
and now I see at least one reason why we should not have done it that
way... Maybe some vendors have specially-crafted mysql /forks/ tailored
to specific use-cases (but do we care?)...

So, I'd rather that we just handle virtual packages like is done for the
GL case rather than the jpeg case (which I consider broken...)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-08-08 23:22           ` Yann E. MORIN
@ 2015-08-09  8:46             ` Thomas Petazzoni
  2015-08-09 12:59               ` Yann E. MORIN
  2015-08-22 22:21             ` Arnout Vandecappelle
  1 sibling, 1 reply; 34+ messages in thread
From: Thomas Petazzoni @ 2015-08-09  8:46 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 9 Aug 2015 01:22:42 +0200, Yann E. MORIN wrote:

> Well, I never much liked the way the jpeg package has been done.
> 
> I do understand that it makes it just work great for users. However,
> that was not the way virtual packages were supposed to work; it's
> just a (bad) hack (which in fact predates the actual virtual package
> infra, IIRC).
> 
> And it's a hack that prevents a br2-external from providing its own
> jpeg implementation (e.g. one optimised to make use of a specific SoC
> hardware, for example).
> 
> Now, the mariadb vs. mysql case might not be so problematic. We don't
> much expect a myriad of alternate implementations to just pop-up over
> the night, and even less hardware-specific implementations. But who
> knows? That's probably what we originally thought about the jpeg case,
> and now I see at least one reason why we should not have done it that
> way... Maybe some vendors have specially-crafted mysql /forks/ tailored
> to specific use-cases (but do we care?)...

Well, if you take this as an argument, then *all* packages should be
virtual packages. I know a customer that has custom versions of dbus
and directfb, for example. Should they be virtual packages because of
that?

> So, I'd rather that we just handle virtual packages like is done for the
> GL case rather than the jpeg case (which I consider broken...)

Well, for MySQL, I'm still not sure. The main drawback of going all the
way to the standard virtual package mechanism is that you can no longer
"select" MySQL from any other package. You can only use a "depends on"
dependency.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-08-09  8:46             ` Thomas Petazzoni
@ 2015-08-09 12:59               ` Yann E. MORIN
  0 siblings, 0 replies; 34+ messages in thread
From: Yann E. MORIN @ 2015-08-09 12:59 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-08-09 10:46 +0200, Thomas Petazzoni spake thusly:
> On Sun, 9 Aug 2015 01:22:42 +0200, Yann E. MORIN wrote:
> > Well, I never much liked the way the jpeg package has been done.
> > 
> > I do understand that it makes it just work great for users. However,
> > that was not the way virtual packages were supposed to work; it's
> > just a (bad) hack (which in fact predates the actual virtual package
> > infra, IIRC).
> > 
> > And it's a hack that prevents a br2-external from providing its own
> > jpeg implementation (e.g. one optimised to make use of a specific SoC
> > hardware, for example).
> > 
> > Now, the mariadb vs. mysql case might not be so problematic. We don't
> > much expect a myriad of alternate implementations to just pop-up over
> > the night, and even less hardware-specific implementations. But who
> > knows? That's probably what we originally thought about the jpeg case,
> > and now I see at least one reason why we should not have done it that
> > way... Maybe some vendors have specially-crafted mysql /forks/ tailored
> > to specific use-cases (but do we care?)...
> 
> Well, if you take this as an argument, then *all* packages should be
> virtual packages.

Well, certainly not what I said.

> I know a customer that has custom versions of dbus
> and directfb, for example. Should they be virtual packages because of
> that?

"Custom versions" does not count (at least if I understand it has "with
local changes when compared to upstream", in which case they would just
have to use OVERRIDE_SRCDIR for those packages, and manage populating
those overrides externally to Buildroot).

What I am talking about is "alternate implementations", as clearly
illustrated by the GL case. GL is the most prominent example of such
alternate implementations; jpeg should also fall into this category.

Remember we had a case for adding an accelerated jpeg implementation,
specific to the freescale iMX CPUs a while back, for example.

> > So, I'd rather that we just handle virtual packages like is done for the
> > GL case rather than the jpeg case (which I consider broken...)
> 
> Well, for MySQL, I'm still not sure. The main drawback of going all the
> way to the standard virtual package mechanism is that you can no longer
> "select" MySQL from any other package. You can only use a "depends on"
> dependency.

Yes, I agree we have to draw a line somewhere.

I think the mysql vs. mariadb case would fall in the category "we do not
expect alternate implementations to pop up", and thus we can handle it
like is currently done for jpeg.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-08-08  8:43         ` Thomas Petazzoni
  2015-08-08 23:22           ` Yann E. MORIN
@ 2015-08-20 12:05           ` Sylvain Raybaud
  2015-08-20 12:32             ` Thomas Petazzoni
  1 sibling, 1 reply; 34+ messages in thread
From: Sylvain Raybaud @ 2015-08-20 12:05 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Thomas, Yann and all,

On 08/08/2015 10:43, Thomas Petazzoni wrote:
> Dear Sylvain Raybaud,
> 
> On Fri, 07 Aug 2015 15:44:58 +0200, Sylvain Raybaud wrote:
> 
>>> OK I can make a virtual package, that seems to make sense.
>>> However, according to section 17.11.6, it seems that I'll have
>>> to patch all packages that depend on mysql, because there is
>>> some special magic to add in the depender's Config.in, am I
>>> right? Is this the way to go?
> We could do something like jpeg (virtual), libjpeg and jpeg-turbo.
> This way, dependers can continue to do a "select
> BR2_PACKAGE_MYSQL", and there is a "choice" in mysql/Config.in to
> choose between the original MySQL or MariaDB.

Ok, I'm going that way.

Of course the original MySQL package will have to be
> renamed to some other name than mysql.

Does "original_mysql" sound good to you?

Cheers,

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJV1cJuAAoJEEkkwl4JtJ9y/UIP/RPchCfWHqMmHhPGE3OwJ44K
4MVLtB3uVTCXOSPktU2dJh/UgUZ231NitQRp3VYXMyPace+2q+wU8ckJUIW5A4tm
BFwBsIEXI0axLUZJkwGFRRm15VGIcBKnYbEXwVay3hYAb2veBY9N2eSGs44CsDjF
Y1boB7mWSf9wJV7JYR3YkwFeNJMYr1G31bKeCCxEEXFRr9Yx7PDZdQZgn5C6osXE
pKJXnX8abrQz8TVRux+o4brUzGuVDYlOo1vdbdB2AMmV81WLqLSQy1c5u+4fwvxT
/LPnI6HcHbjHs6UN47NtorOxkp4qQT1l8G/WDTsopUwlTA5DQRXu9QcNH4dy5JtB
x0/80iV7t3LvrcuNv2y9Pb3BCRq0MRebzzQkz7AIYWzYtwWODzTa3Sxkavkg0yoZ
6ZygDWNNAwE0LYZkAuQZW1UGot63gwJsaGjhi1DdbrcWdbGMviScT2lu/PgEnlS2
QoqFfiU1LF7swrGxSCDQ7zYWif/aUzE+Tk7IjbgUyEJFOJNLHHursRCZkAo67F7F
vln2gpQhavWrCVtq2kqtjJTrqh2r6l3UXmrPXgVFI75YD87FC3P88IcDxYQNJVz9
aoIgXNwXWDI3RRDMOk1Kn01P8k4ymFjyBH3g76j7xPCAL87Zqop0W2+fSH9UYOID
d2IfI5N1VsBbyLfeBy2L
=hT7W
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-08-20 12:05           ` Sylvain Raybaud
@ 2015-08-20 12:32             ` Thomas Petazzoni
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Petazzoni @ 2015-08-20 12:32 UTC (permalink / raw)
  To: buildroot

Dear Sylvain Raybaud,

On Thu, 20 Aug 2015 14:05:02 +0200, Sylvain Raybaud wrote:

> Of course the original MySQL package will have to be
> > renamed to some other name than mysql.
> 
> Does "original_mysql" sound good to you?

I'd rather suggest 'oracle-mysql'.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-07-09 21:56   ` Samuel Martin
  2015-07-10  7:54     ` Thomas Petazzoni
@ 2015-08-21  8:23     ` Sylvain Raybaud
  2015-08-26 21:45     ` Sylvain Raybaud
  2015-10-08 15:15     ` Sylvain Raybaud
  3 siblings, 0 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-08-21  8:23 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Samuel

Thanks for your review. Here are my replies to some points (also inlined).

On 09/07/2015 23:56, Samuel Martin wrote:
> Hi Sylvain,
> 
> Here is a partial review (inlined).
> 
> But, overall, I feel like this implementation (essentially the
> *.mk file) does not match the Buildroot way of doing things... :-/ 
> Have you look at the virtual package infrastructure [1]?

Considering your remark and the discussion that took place last week,
I repackaged the whole thing in the same way as jpeg.

> 
> On Thu, Jul 9, 2015 at 6:22 PM, Sylvain Raybaud

>> diff --git
>> a/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
>> b/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
>>
>> 
new file mode 100644
>> index 0000000..83eac77 --- /dev/null +++
>> b/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
>>
>> 
@@ -0,0 +1,27 @@
>> +Do not perform test if the build is not requested anyway. The
>> test may fail, +preventing building the whole package. +
> The comment does not really reflect what is done in the patch: -
> according to the comment: this change touch tests; - AFAICS, this
> change disable a plugin.

No, I just enclose some commands in:

IF(NOT WITHOUT_XTRADB)
[..]
ENDIF()

Meaning: "if building XtraDB plugin was not requested, do not care
about the result of the test". This patch does not disable XtraDB.
This is done via an option passed in mariadb-galera.mk

> [..]

>> ++IF(NOT WITHOUT_XTRADB)
> Does this boolean come from an option? it could.
> 

It does. There is the following line in mariadb-galera.mk:

MARIADB_GALERA_EXTRA_OPTS += "-DWITHOUT_XTRADB=1"


[..]

>> diff --git
>> a/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>> b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>>
>> 
new file mode 100644
>> index 0000000..1ddec5d --- /dev/null +++
>> b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>>
>> 
@@ -0,0 +1,251 @@
>> +Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS in
>> order to be +cross-compile friendly. +In buildroot another
>> solution (maybe better, maybe not) could be to use 
>> +BR2_ARCH_HAS_ATOMICS in order to determine the value of
>> HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE +and likes. +
> Missing SoB line [2].
> 
> It makes sense to submit this patch upstream as well.

Right. Does this mean we should wait for them to review this patch
before considering including it in buildroot?

> [..]
>> +config MYSQL_MARIADB_GALERA +       bool "mariadb-galera" +
>> select BR2_PACKAGE_NCURSES +       select BR2_PACKAGE_OPENSSL +
>> select BR2_PACKAGE_ZLIB +       select BR2_PACKAGE_LIBAIO +
>> select BR2_PACKAGE_LIBTOOL +       select BR2_PACKAGE_GALERA +
>> select BR2_PACKAGE_BASH # runtime dependency only +       select
>> BR2_PACKAGE_LSOF # runtime dependency only +       select
>> BR2_PACKAGE_PROCPS_NG # runtime dependency only +       select
>> BR2_PACKAGE_FINDUTILS # runtime dependency only +       select
>> BR2_PACKAGE_BUSYBOX_SHOW_OTHERS +       depends on
>> BR2_TOOLCHAIN_BUILDROOT_GLIBC || BR2_PACKAGE_EGLIBC # spawn()
> Missing "depends on" for the selected packages [3].
> 
>> +       help +         MariaDB Galera Cluster. +
>> https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-cluster 
>> + +endchoice + +endif + +comment "MySQL needs a toolchain w/ C++,
>> threads" +depends on !BR2_INSTALL_LIBSTDCPP ||
>> !BR2_TOOLCHAIN_HAS_THREADS
> Indent is wrong. Missing: depends on BR2_USE_MMU Move this comment
> in the choice.

I don't understand how to properly move this in the choice section.
However I modified Config.in when I made mysql a virtual package. Does
this remark still apply?

> 
>> + +comment "MariaDB needs an (e)glibc toolchain" +depends on
>> !BR2_TOOLCHAIN_BUILDROOT_GLIBC && !BR2_PACKAGE_EGLIBC # spawn()
> Indent is wrong. Move this comment in the choice.

Same question about moving the comment.

Thanks again!

Cheers,

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJV1uABAAoJEEkkwl4JtJ9yNCIP/ic8RsfhCdG56I3fH55KFDqi
ABnVSsYB3HP9vczjCfFzLQq3YbbTX1HMhB72L83OdyBoBmoUmEedXO9cOCcZw75q
Fer4OBgGhrl11uy3KvwH2E/nfGgVtjdiGSW0o+7mB041E/ix2E+SnlKwIQu9mTFS
4UZq7m7UpeWBQeMwRE3VpNnNCimpW+pcIXIjzMdbDMNfH5xAy6Da3OtJPay4vRBk
99PZ4Ly6wOcytRnTvuDOz2u8OMbb6GOshSTFyqDucenculWPada+fVa0QKWJlDMo
wFpLPv5HlcVKXcFZO8T+USK3GFnWgdjeJget1r8vXUUDzh/rEFD6VDCaYIC86dQN
pWHpqosPCUcd/d4q6hI1rutCO4w9djKmDDC8AFB2iPnwK7EuPV8AnWXE0RLMA+Rf
+CKoNG9D/yny3po37SouxajkIkg/3FOK/3cPVlTCEnMUiQtHh7Alcd6ll7CvTMEk
0gNA8Sia1vQ6B72O7ASJOfMCLQsOIiqXsODZhI9pFv2K5xGvap6E7LBShSuADE8o
qb7ig6wsTJnvdOBlDTyva7KPVQ4V/4nBQGT7njvsAtcwe46dNbYhIT2wRv7i7btW
5tBBy9HDZ8ex6AcM7pDaraU5gu6edEowRSTdZWLoM7SOBgNT8/USeRofVHBd4tgv
NMtaizcTJNxxjmiQSpwB
=UmBa
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 3/7 v2] galera: new package
  2015-07-09 21:53     ` Arnout Vandecappelle
@ 2015-08-21 13:20       ` Sylvain Raybaud
  0 siblings, 0 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-08-21 13:20 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Arnout,

On 09/07/2015 23:53, Arnout Vandecappelle wrote:
> On 07/09/15 23:29, Samuel Martin wrote:

>>> diff --git
>>> a/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
>>> b/package/galera/galera-01-fix_sconstruct_for-crosscompiling.patch
>>>
>>> 
[..]
>>> ++# Cross-compilation ++ ++if 'CROSS' in os.environ: ++
>>> cross = os.environ['CROSS'] ++        env.Append(CROSS =
>>> cross) ++        env.Replace(CC = cross + 'gcc') ++
>>> env.Replace(CXX = cross + 'g++')
> 
> This means ccache will not be used. We prefer to pass CC and CXX in
> the environment (through TARGET_CONFIGURE_OPTS). I think that would
> even work out of the box without any patch, no?

I think TARGET_CONFIGURE_OPTS was already added to scons environment,
see the lines below in galera.mk (from my patch):

+GALERA_SCONS_ENV = $(TARGET_CONFIGURE_OPTS) BR2_ARCH=$(BR2_ARCH)

[..]

+define GALERA_BUILD_CMDS
+        cd $(@D) && \
+	  $(GALERA_SCONS_ENV) \
+	  CROSS=$(TARGET_CROSS) \
+	  $(SCONS) \
+	  $(GALERA_SCONS_OPTS)
+endef

I'll make the other requested changes and test again, maybe the
problem was somewhere else.


>>> + # these will be used only with our softaware + if
>>> strict_build_flags == 1: +-    conf.env.Append(CPPFLAGS = '
>>> -Werror') ++    conf.env.Append(CPPFLAGS = ' -Werror
>>> -Wno-error=uninitialized -Wno-error=pedantic')
>> Hum... -Werror is more a development flag than an integration
>> one. It should certainly be removed.
> 
> Better yet, make sure the strict_build_flags is not set.
> 

Perfectly right.  I failed to notice that sctrict_build_flags=0 could
be passed to scons. Thanks.

Cheers,

Sylvain

> 
> Regards, Arnout
> 
> [snip]
> 
> 

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJV1yWKAAoJEEkkwl4JtJ9yCxkP/25RrYpGdZFJYehEuf3T/27R
ttvzToHlWrlOzhxG4qxNZ20YPoSejVkOFIfOzDBL0SdV7SclPxJC3rnQ/mHJGTB+
Ln0kJ0h/hgfpHi6575YmaQlGU5PQ64va9rrYa6fUbLvjZ7QHCiGm/d0+2s+R5zoX
Da459zUVZq1yjk6YYu5JDaDrp5NcINi+KWpyhpowg379B6BUr0mR7Q/eyA4G2bfL
7Z6Ivv6j9qHYRlOzBYMwHgLR4S+oRe4A3esVkXtfFsREUIHTcAunyS7OTi3uN2rT
oud6DKXNtPoTykQxOccGRVxToCZYVpDq3Jd6bEyyWk1EhfcpAt7DNLhCgZlbaqe+
K5FqBdaNjQQ1C4W4XN111rW7BYHXkN+sP+lgeGU+i1cgVGehzia1b36e3qZWAdHr
P45YuK5QDKNol7q4riOQ0Xldnp8XkaRew4L2H2w0E4RvoCzCCvpQ4yJo3SbGT1Kj
N4VmYR+TZx2bz0cTCrrwWo9ElAbqs9GM/QXM+moCDWlTCXIRPYCeUqK96wQM+nKJ
JzqHnY/iXnzhof9/66TJEBNXjaWtE+0cvLghjPLzt8i6IgJ55GvREbjAAyVcCWmb
xPRjDkcwGFA+N/iDrnKCmZbkv1vhn3jeMewNQn4V96zy7EIL6Gw7szvB5/daoUhq
ERLMQdGihjplRJLHrXHa
=f2vd
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 3/7 v2] galera: new package
  2015-07-09 21:29   ` Samuel Martin
  2015-07-09 21:53     ` Arnout Vandecappelle
@ 2015-08-21 13:39     ` Sylvain Raybaud
  1 sibling, 0 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-08-21 13:39 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Samuel

Again, thanks for this review. Inlined, my comments about some points:

On 09/07/2015 23:29, Samuel Martin wrote:
>> + + # these will be used only with our softaware + if
>> strict_build_flags == 1: +-    conf.env.Append(CPPFLAGS = '
>> -Werror') ++    conf.env.Append(CPPFLAGS = ' -Werror
>> -Wno-error=uninitialized -Wno-error=pedantic')
> Hum... -Werror is more a development flag than an integration one.
> It should certainly be removed.

Yep, as Arnout suggested I made sure strict_build_flags wasn't set.
Thanks for pointing this out.


>> +GALERA_SCONS_ENV = $(TARGET_CONFIGURE_OPTS)
>> BR2_ARCH=$(BR2_ARCH) +ifeq ($(BR2_x86_64),y) +GALERA_SCONS_ENV +=
>> BR2_x86=64
> BR2_ prefix is usually reserved for buildroot scope. Maybe this 
> variable could be rename GALERA_BITWISE instead of BR2_x86?

Done.

> 
>> +else ifeq ($(BR2_i386),y) +GALERA_SCONS_ENV += BR2_x86=32 +else 
>> +GALERA_SCONS_ENV += BR2_x86=0
> Hum... looks dubious! Does this mean that galera is only available
> for x86 and x86_64 target? Other architectures can also be
> available in 32bits and 64bits (arm/aarch64, mips/mips64, etc). 
> Last thing, the variable BR2_ARCH_IS_64 is set when the bitwise is 
> 64bit, whatever the CPU architecture, so prefer using it.

You're right, the logic was poor. I'm not aware of such restriction. I
rewrote it using BR2_ARCH_IS_64, thus eliminating the cases in which
BR2_x86 was not set.

>> + +define GALERA_BUILD_CMDS +        cd $(@D) && \ +
>> $(GALERA_SCONS_ENV) \ +         CROSS=$(TARGET_CROSS) \
> CROSS=... can be appended to the GALERA_SCONS_ENV variable.

If I understand Arnout's remark correctly, it shouldn't even be needed
because all the necessary information is already present in
TARGET_CONFIGURE_OPTS which should be passed in the environment of
scons. However, I think it was already the case (see the definition
and use of GALERA_SCONS_ENV in my original patch). I'll test again and
let you know.

>> +$(eval $(generic-package)) +$(eval $(host-generic-package))
> Why a host-galera package? Note that, as is, this host-galera
> package will build/install nothing because of the generic infra
> used without any HOST_GALERA_*_CMDS definition.

Right. I added this line for the sake of completeness without
realising it wasn't doing anything. I don't need it, so I removed it.

Cheers,

Sylvain

> 
> Regards,
> 
> 

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJV1yn5AAoJEEkkwl4JtJ9yA5UP/AoNuPuDByEKQ7SQ6TW5iujc
/980AigEbYtidC+HKc/eL7lWXEjD3L9gfi3G5jaVOEwDql4GftFmW6U7aoi/2bdf
GokEeY13EwFq2bK6kzEV2EX7m/R7rQVeFaWqZPqw+HxAYJ9mt/fyQYci0eTg1uEN
WpPV6Mci/wFQZUrTlnD/g6wmNbHu/d1/4uNJ+PJQ/lCM4owsgcAuNpamgxAJsQRh
zIsgqpAh3ZN2VteSf8v9bigLR9cUOdmcuQC+6C8FKUzlnHzJZO/KWOrIPk3DmF2N
erPG2zrjp77BtXK9Q38Tlxomwl2Udh7iNhMuiOlrCgcQCekFvRQmejjk8hD5fFec
HiS3eFDDVidsMvGMnu3lQ65H+gy4btFSgpxSD1iSlTD96/DNPR3IRBWBfnwP1D5U
3Hd8Q57/WTalm/0FoHvuAkDDmnOpWRcEtQRt4WNJoyEUfq5g8W7bhuIN75+ZO/Pv
VfpdJZDpalZj2l5Xv2S3onFEvaLUsm9J9jy40shtE9x3gk3OTzuHzxgZKzSlHAUv
xt9m734fhw6PrP4b63pGZvTP6E+RKP8a2V/v+9/3XjS8ZYGfIfr300XfS892naWE
XFbXNDT9T2sMJc/MSo670Xd7QH/s8n9r5COsfgSe3lJ5aDGpss8vgjPUC6GqohA+
M4towyyAL7e0qh1G0V5W
=ogdi
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-08-08 23:22           ` Yann E. MORIN
  2015-08-09  8:46             ` Thomas Petazzoni
@ 2015-08-22 22:21             ` Arnout Vandecappelle
  2015-08-24 10:14               ` Sylvain Raybaud
  1 sibling, 1 reply; 34+ messages in thread
From: Arnout Vandecappelle @ 2015-08-22 22:21 UTC (permalink / raw)
  To: buildroot

On 08/09/2015 01:22 AM, Yann E. MORIN wrote:
> Now, the mariadb vs. mysql case might not be so problematic. We don't
> much expect a myriad of alternate implementations to just pop-up over
> the night, 

 Well, actually... IIUC there are in fact two MariaDB implementations: the
cluster verion (Galera, added here) and the single-node version. Well, they
might actually be the same, but the download URLs are different.

 Sylvain, can you comment?


 That said, I don't see a big problem adding a third option to the choice
whenever the other mariadb is added.



> and even less hardware-specific implementations. But who
> knows? That's probably what we originally thought about the jpeg case,
> and now I see at least one reason why we should not have done it that
> way... Maybe some vendors have specially-crafted mysql /forks/ tailored
> to specific use-cases (but do we care?)...

 MariaDB already is a fork :-)


 BTW, regarding jpeg support in BR2_EXTERNAL, it could be supported but it gets
a bit complicated:

===== jpeg/Config.in =====
config BR2_PACKAGE_JPEG
	bool "jpeg support"

if BR2_PACKAGE_JPEG

choice
	prompt "jpeg variant"

config BR2_PACKAGE_LIBJPEG
	bool "jpeg"
	depends on !BR2_PACKAGE_EXTERNAL_JPEG_SELECTED
	select BR2_PACKAGE_HAS_JPEG

config BR2_PACKAGE_JPEG_TURBO
	bool "jpeg-turbo"
	depends on !BR2_PACKAGE_EXTERNAL_JPEG_SELECTED
	select BR2_PACKAGE_HAS_JPEG

# The following one will only be visible if we select an external JPEG library
# The other choices will vanish then.
config BR2_PACKAGE_EXTERNAL_JPEG
	bool "provided in BR2_EXTERNAL"
	depends on BR2_PACKAGE_EXTERNAL_JPEG_SELECTED
	select BR2_PACKAGE_HAS_JPEG

endchoice

config BR2_PACKAGE_HAS_JPEG
	bool

# This extra symbol is needed to be able to hide the internal ones
config BR2_PACKAGE_EXTERNAL_JPEG_SELECTED
	bool
	select BR2_PACKAGE_EXTERNAL_JPEG

config BR2_PACKAGE_PROVIDES_JPEG
	string
	default "libjpeg"    if BR2_PACKAGE_LIBJPEG
	default "jpeg-turbo" if BR2_PACKAGE_JPEG_TURBO

endif


==== BR2_EXTERNAL/try-this/Config.in ====
# This one actually looks like a normal virtual package
config BR2_PACKAGE_TRY_THIS
	bool "try this!"
	select BR2_PACKAGE_EXTERNAL_JPEG_SELECTED

config BR2_PACKAGE_PROVIDES_JPEG
	default "trythis" if BR2_PACKAGE_TRY_THIS

====


 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-08-22 22:21             ` Arnout Vandecappelle
@ 2015-08-24 10:14               ` Sylvain Raybaud
  0 siblings, 0 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-08-24 10:14 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Arnout, Yann, all

On 23/08/2015 00:21, Arnout Vandecappelle wrote:
> On 08/09/2015 01:22 AM, Yann E. MORIN wrote:
>>> Now, the mariadb vs. mysql case might not be so problematic. We
>>> don't much expect a myriad of alternate implementations to just
>>> pop-up over the night,
> Well, actually... IIUC there are in fact two MariaDB
> implementations: the cluster verion (Galera, added here) and the
> single-node version. Well, they might actually be the same, but the
> download URLs are different.
> 
> Sylvain, can you comment?

That's right, there are two variants: MariaDB and MariaDB galera. The
later includes the capability of running as a cluster, when run with
the galera plugin. They are not the same but I haven't thoroughly
looked at the differences since it's the cluster I'm interested in. I
agree that ideally a third choice "mariadb" should be added. I've only
been focused on mariadb galera for now, but I don't think it's much
more work to add mariadb. Maybe I can do it after I'm done with
mariadb galera?

Cheers,

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJV2u6EAAoJEEkkwl4JtJ9yrEMP/0G2yWR/AV8GJa+jW3p1Km3e
WuxJgvELUwgoL5gcPsjmqmBENBC19j0Z1StHDXefD3b91wv1NPxF/oJ/4yawNt0g
m22SWl3N0fMw4AAVM1m64wx/XdeJxU3usz3nDdQb1xC7675fOAFWmH4/PoSmFj/2
WsqB8IPh8GQWVOwJSTEOnTyXOCLSfTqsq643X3j88HwvSuHg52t3r7ObqbS8819E
H16eMFmD3qZbEr05hvRsHBEnXl0czrpFaEoc5zAui+CJgKS/oP+zkYNTRW/8gkgV
c0/LGHflQD+YsrmlamNWtqoC1p45/Zhy9shpMG4LEv9c9Us9UXiGwTFWmtyXzsta
wN+s6Po8JslkDRKYXB2M0AJ6aHWgbWDPe9kaOXI9maPIVlHTSKfGEUQHQaoz0kQn
04JvKlSjFlol7HUrvoA8Z08hefC90HkkGViEVy5csy01fN/WbkFwam0AvvpwIbOa
olFrwseslgnLba3OvnTY/4/GRKkq4m3ROycf/lTY/YhiZ8T9X3LflNm/tNYF7bYa
VOfIp7gEdQtp1/cJ/Srk/4F0VCMzB+2x40Evs+g2v/KNmSG2eNceem7bm2O+VKok
hSvZQRsMDkremwHb4KU5i14NFL/rkCnHLlmflvnWgV5JkGfD2Yoo/aQytHRzYXV/
BebcNtnMT7LYy7oOAYt0
=Y5rG
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-07-09 21:56   ` Samuel Martin
  2015-07-10  7:54     ` Thomas Petazzoni
  2015-08-21  8:23     ` Sylvain Raybaud
@ 2015-08-26 21:45     ` Sylvain Raybaud
  2015-10-08 15:15     ` Sylvain Raybaud
  3 siblings, 0 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-08-26 21:45 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[sorry for the repost, but it looks like this email, originally sent
on 21st august, never made it to the list.]

Hi Samuel

Thanks for your review. Here are my replies to some points (also inlined).

On 09/07/2015 23:56, Samuel Martin wrote:
> Hi Sylvain,
> 
> Here is a partial review (inlined).
> 
> But, overall, I feel like this implementation (essentially the *.mk
> file) does not match the Buildroot way of doing things... :-/ Have
> you look at the virtual package infrastructure [1]?

Considering your remark and the discussion that took place last week,
I repackaged the whole thing in the same way as jpeg.

> 
> On Thu, Jul 9, 2015 at 6:22 PM, Sylvain Raybaud

>> diff --git 
>> a/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
>>
>> 
b/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
>> 
>> 
new file mode 100644
>> index 0000000..83eac77 --- /dev/null +++ 
>> b/package/mysql/10.0.17/mariadb-galera-01-fix_xtradb_cmakelist.patch
>>
>>
@@
>> 
- -0,0 +1,27 @@
>> +Do not perform test if the build is not requested anyway. The 
>> test may fail, +preventing building the whole package. +
> The comment does not really reflect what is done in the patch: - 
> according to the comment: this change touch tests; - AFAICS, this 
> change disable a plugin.

No, I just enclose some commands in:

IF(NOT WITHOUT_XTRADB)
[..]
ENDIF()

Meaning: "if building XtraDB plugin was not requested, do not care
about the result of the test". This patch does not disable XtraDB.
This is done via an option passed in mariadb-galera.mk

> [..]

>> ++IF(NOT WITHOUT_XTRADB)
> Does this boolean come from an option? it could.
> 

It does. There is the following line in mariadb-galera.mk:

MARIADB_GALERA_EXTRA_OPTS += "-DWITHOUT_XTRADB=1"


[..]

>> diff --git 
>> a/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>>
>> 
b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>> 
>> 
new file mode 100644
>> index 0000000..1ddec5d --- /dev/null +++ 
>> b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>>
>>
@@
>> 
- -0,0 +1,251 @@
>> +Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS in 
>> order to be +cross-compile friendly. +In buildroot another 
>> solution (maybe better, maybe not) could be to use 
>> +BR2_ARCH_HAS_ATOMICS in order to determine the value of 
>> HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE +and likes. +
> Missing SoB line [2].
> 
> It makes sense to submit this patch upstream as well.

Right. Does this mean we should wait for them to review this patch
before considering including it in buildroot?

> [..]
>> +config MYSQL_MARIADB_GALERA +       bool "mariadb-galera" + 
>> select BR2_PACKAGE_NCURSES +       select BR2_PACKAGE_OPENSSL + 
>> select BR2_PACKAGE_ZLIB +       select BR2_PACKAGE_LIBAIO + 
>> select BR2_PACKAGE_LIBTOOL +       select BR2_PACKAGE_GALERA + 
>> select BR2_PACKAGE_BASH # runtime dependency only +       select 
>> BR2_PACKAGE_LSOF # runtime dependency only +       select 
>> BR2_PACKAGE_PROCPS_NG # runtime dependency only +       select 
>> BR2_PACKAGE_FINDUTILS # runtime dependency only +       select 
>> BR2_PACKAGE_BUSYBOX_SHOW_OTHERS +       depends on 
>> BR2_TOOLCHAIN_BUILDROOT_GLIBC || BR2_PACKAGE_EGLIBC # spawn()
> Missing "depends on" for the selected packages [3].
> 
>> +       help +         MariaDB Galera Cluster. + 
>> https://mariadb.com/kb/en/mariadb/what-is-mariadb-galera-cluster 
>> + +endchoice + +endif + +comment "MySQL needs a toolchain w/
>> C++, threads" +depends on !BR2_INSTALL_LIBSTDCPP || 
>> !BR2_TOOLCHAIN_HAS_THREADS
> Indent is wrong. Missing: depends on BR2_USE_MMU Move this comment 
> in the choice.

I don't understand how to properly move this in the choice section.
However I modified Config.in when I made mysql a virtual package. Does
this remark still apply?

> 
>> + +comment "MariaDB needs an (e)glibc toolchain" +depends on 
>> !BR2_TOOLCHAIN_BUILDROOT_GLIBC && !BR2_PACKAGE_EGLIBC # spawn()
> Indent is wrong. Move this comment in the choice.

Same question about moving the comment.

Thanks again!

Cheers,

- -- 
Sylvain Raybaud
www.green-communications.fr
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJV3jOSAAoJEEkkwl4JtJ9yfRQP/RZ7HJu/m2j8Y6wGVLv11BMT
XmwP6dYpR0QyAvyH589ZsLAxrmMGWxiHnjlRNtydb2n/KOX0tFY281pBLOMhsbdr
H3Y5Z02GgY/eDJ18ndAw7m+elV5Ia68IkNJF+GLnRgwdMEuJL5ZiXPjNzQ9ifMkU
TkWJN5u/whFiGAlQ1Tsa57lCmjk80XCTw36ZgxU3medQqyVwqp2mTCL11IOq8VCV
IrJTFFB95BDOGoh/ewlpIDorXxGhzneJl+2vY5HxHhiJ5tfKsCxe9vpb8n9O7BXX
HKjLID0Jdbqqm7pjKKQx/6fCS+gcmkCeZ6iJNp9G1hDZ52nmV1UB0nytDZor0Eb7
Hpt+ja/4+gtX+g2HLq4+3txA8D8ngbekPmEbINQ/Zpkk4I4Wbzdi+PyJSGNv0AKF
4za/UOBNT8GX8cyRJB+0NmgRF/wCXAz4CCeaNUEGZaw3sOexmB+nKmUae77gpHxq
o+ft/vsv3FJPpZWYeUCUgvuSbAmYyJrD5PnoxJhDuB82NuOUkoum+f6QwDdPGHoZ
R6R5VJlmig4+sMpjy+13OjdhwBe+79CTCVsepBsZu0jL4h8xMHa9ZO5NATaGCcz/
8/ucyWr+TowVhrrRd2JphGK1Sxva0Onhh+XX2m1PFcC6o269gtZ+3Sd/4bK2aIsK
i4yHpMR6G2u0NPFdHgcm
=/eYm
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant
  2015-07-09 21:56   ` Samuel Martin
                       ` (2 preceding siblings ...)
  2015-08-26 21:45     ` Sylvain Raybaud
@ 2015-10-08 15:15     ` Sylvain Raybaud
  3 siblings, 0 replies; 34+ messages in thread
From: Sylvain Raybaud @ 2015-10-08 15:15 UTC (permalink / raw)
  To: buildroot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Samuel

On 09/07/2015 23:56, Samuel Martin wrote:
>>> +--- a/storage/xtradb/CMakeLists.txt    2014-10-30
>>> 16:24:33.160188627 +0100 ++++ b/storage/xtradb/CMakeLists.txt
>>> 2014-10-30 16:25:09.060188829 +0100 +@@ -470,12 +470,13 @@ +
>>> SET(WITH_INNOBASE_STORAGE_ENGINE TRUE) + ENDIF() + 
>>> +-IF(XTRADB_OK) +-  MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES}
>>> STORAGE_ENGINE +-    DEFAULT +-    RECOMPILE_FOR_EMBEDDED +-
>>> LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT}) +-ELSE() +-
>>> MESSAGE(FATAL_ERROR "Percona XtraDB is not supported on this
>>> platform") ++IF(NOT WITHOUT_XTRADB)
> Does this boolean come from an option? it could.

It does. I've sent this patch upstream. MariaDB people acknowledged
the bug. I think they'll fix it but I don't know when.

> 
>>> ++  IF(XTRADB_OK) ++    MYSQL_ADD_PLUGIN(xtradb
>>> ${INNOBASE_SOURCES} STORAGE_ENGINE ++      DEFAULT ++
>>> RECOMPILE_FOR_EMBEDDED ++      LINK_LIBRARIES ${ZLIB_LIBRARY}
>>> ${LINKER_SCRIPT}) ++  ELSE() ++    MESSAGE(FATAL_ERROR "Percona
>>> XtraDB is not supported on this platform") ++  ENDIF() +
>>> ENDIF() +- diff --git
>>> a/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>>> b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>>
>>> 
> new file mode 100644
>>> index 0000000..1ddec5d --- /dev/null +++
>>> b/package/mysql/10.0.17/mariadb-galera-02-fix_innodb_cmakelist.patch
>>
>>> 
> @@ -0,0 +1,251 @@
>>> +Use CHECK_C_SOURCE_COMPILES instead of CHECK_C_SOURCE_RUNS in
>>> order to be +cross-compile friendly. +In buildroot another
>>> solution (maybe better, maybe not) could be to use 
>>> +BR2_ARCH_HAS_ATOMICS in order to determine the value of
>>> HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE +and likes. +
> Missing SoB line [2].
> 
> It makes sense to submit this patch upstream as well.
> 

I've sent this upstream. I've been told that CHECK_C_SOURCE_COMPILES
was used before but was not enough in some corner cases. They propose
to use it when cross-compiling and stick with SOURCE_RUN otherwise. It
means that "corner cases" won't be covered in cross-compilation but
this solution is no worse than my patch. However, this script checks
the availability and usability of:
__sync_bool_compare_and_swap
__sync_add_and_fetch
__sync_lock_test_and_set
__sync_sub_and_fetch
__sync_add_and_fetch
__atomic_thread_fence
__sync_bool_compare_and_swap
__sync_synchronize
maybe I could use BR2_ARCH_HAS_ATOMICS and/or other buildroot
variables to determine the value of HAVE_IB_GCC_ATOMIC_BUILTINS_BYTE,
HAVE_IB_ATOMIC_PTHREAD_T_GCC and HAVE_IB_ATOMIC_PTHREAD_T_GCC?

Cheers,

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJWFoiFAAoJEEkkwl4JtJ9ys6oQAKqi6EMMLc7THs6WotDuNF72
Lcg+2ZHlaWdICu58ELSEJD8eqPQeHpKV+UFV+Zm02PT1UZ/nqnSCM59lTjsmzHOo
D+XJz9w/otGTYjYhKRYuz4f8CyX7VAd6snNxw2TeesRQgShsU8h/A2LE74BPN3nn
k5f6DZhmDd0ZDBxHFYhOVxQXLK7i8u0zSDemwrLQbdj4ngh7d9P+5LbXNYVKNZiU
6lNJwNR7xwvEB2ZFtpRkqC2gTjIxD2n71ultwbRoFybnG/drt8dfLWoAg3ZoxrAQ
sGcbHY0gqhch7ioF/nwdtPqO648jQwY5WGbpLv5FP8GA2XxyWz7JYhyxwIZtyroO
6dDUJEvpYbVGHYGeR0B/sFJYNtW4gaM4zsoi7NVA740hvX56vhIOQflF+DxxU6ae
Ma0y1If14U/d5KG8cb4RkC6BSBNRLZAuRAibUIvlQ4pHj6Zw2O3nLJ8o+/hzDEDi
y2HlCtq1OS2kxsRj81DgmCQMHswO2lLITYmrH3W25dh8guF1cfE9t+a79ZmjeaQA
im7m6tAhokkTN4m8XcPyaHfBuWBVViZrPmGJLFlLeqGTjJB3+Xm5/48lvhg96L/3
54dZ9kNJeyIcmXgkJv1tEKtfHyy33NZPYnyRbMBzP+Jk+n/S288WSfkxpBn9j9ur
YmoAYbVCYiQlaJWydCQp
=CJ/5
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2015-10-08 15:15 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 16:21 [Buildroot] [PATCH 0/7 v2] Set of patches to add MariaDB galera cluster Sylvain Raybaud
2015-07-09 16:21 ` [Buildroot] [PATCH 1/7 v2] check: new package Sylvain Raybaud
2015-07-10 23:06   ` Yann E. MORIN
2015-07-09 16:21 ` [Buildroot] [PATCH 2/7 v2] libaio: add host variant Sylvain Raybaud
2015-07-10 22:30   ` Yann E. MORIN
2015-07-10 23:01     ` Yann E. MORIN
2015-07-10 23:00   ` Thomas Petazzoni
2015-07-09 16:21 ` [Buildroot] [PATCH 3/7 v2] galera: new package Sylvain Raybaud
2015-07-09 21:29   ` Samuel Martin
2015-07-09 21:53     ` Arnout Vandecappelle
2015-08-21 13:20       ` Sylvain Raybaud
2015-08-21 13:39     ` Sylvain Raybaud
2015-07-09 16:21 ` [Buildroot] [PATCH 4/7 v2] pkg-cmake: add PKG_CONFIG_* variables to help cmake find host packages Sylvain Raybaud
2015-07-10 22:47   ` Samuel Martin
2015-07-09 16:21 ` [Buildroot] [PATCH 5/7 v2] busybox: adjust configuration to add fancy options to the sleep applet Sylvain Raybaud
2015-07-10 22:48   ` Samuel Martin
2015-07-10 22:58   ` Thomas Petazzoni
2015-07-10 23:06     ` Sylvain Raybaud
2015-07-09 16:22 ` [Buildroot] [PATCH 6/7 v2] mysql: move patches into a version-specific subdirectory Sylvain Raybaud
2015-07-09 16:22 ` [Buildroot] [PATCH 7/7 v2] mysql: add mariadb galera cluster variant Sylvain Raybaud
2015-07-09 21:56   ` Samuel Martin
2015-07-10  7:54     ` Thomas Petazzoni
2015-08-07 13:44       ` Sylvain Raybaud
2015-08-08  8:43         ` Thomas Petazzoni
2015-08-08 23:22           ` Yann E. MORIN
2015-08-09  8:46             ` Thomas Petazzoni
2015-08-09 12:59               ` Yann E. MORIN
2015-08-22 22:21             ` Arnout Vandecappelle
2015-08-24 10:14               ` Sylvain Raybaud
2015-08-20 12:05           ` Sylvain Raybaud
2015-08-20 12:32             ` Thomas Petazzoni
2015-08-21  8:23     ` Sylvain Raybaud
2015-08-26 21:45     ` Sylvain Raybaud
2015-10-08 15:15     ` Sylvain Raybaud

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.