[1/1] mariadb: fix mysql_config when cross compiling

Message ID 20181108170950.30189-2-chrismcc@gmail.com
State Changes Requested
Headers show
Series
  • mariadb and mysql
Related show

Commit Message

Christopher McCrory Nov. 8, 2018, 5:09 p.m.
Mariadb_config in staging is not a shell script, this breaks
mysql_config when cross-compiling.  This in turn breaks package builds
needing the location of the include and library files. So remove it after
installation into $TARGET_DIR

Signed-off-by: Christopher McCrory <chrismcc@gmail.com>
---
 package/mariadb/mariadb.mk | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Peter Korsgaard Nov. 9, 2018, 2:54 p.m. | #1
>>>>> "Christopher" == Christopher McCrory <chrismcc@gmail.com> writes:

 > Mariadb_config in staging is not a shell script, this breaks
 > mysql_config when cross-compiling.  This in turn breaks package builds
 > needing the location of the include and library files. So remove it after
 > installation into $TARGET_DIR

 > Signed-off-by: Christopher McCrory <chrismcc@gmail.com>
 > ---
 >  package/mariadb/mariadb.mk | 5 +++++
 >  1 file changed, 5 insertions(+)

 > diff --git a/package/mariadb/mariadb.mk b/package/mariadb/mariadb.mk
 > index 06d6365fab..52d47f98fc 100644
 > --- a/package/mariadb/mariadb.mk
 > +++ b/package/mariadb/mariadb.mk
 > @@ -125,10 +125,15 @@ endif
 
 >  # We don't need mysql_config on the target as it's only useful in staging
 >  # We also don't need the test suite on the target
 > +# Also mariadb_config in staging is not a shell script, this breaks
 > +# mysql_config when cross-compiling.  This in turn breaks package builds
 > +# needing the location of the include and library files. So remove it after
 > +# installation into $TARGET_DIR

Ehh, STAGING_DIR or TARGET_DIR?

What then happens when those packages try to run mariadb_config to get
the include/library locations? What if the build machine already has
mariadb_config in the path?

>  define MARIADB_POST_INSTALL
 >  	mkdir -p $(TARGET_DIR)/var/lib/mysql
 >  	$(RM) $(TARGET_DIR)/usr/bin/mysql_config
 >  	$(RM) -r $(TARGET_DIR)/usr/share/mysql/test
 > +	$(RM) $(STAGING_DIR)/usr/bin/mariadb_config

Fixups to STAGING_DIR should not be mixed up wiith the TARGET_DIR
installation logic, please add a POST_INSTALL_STAGING_HOOK instead.

>  endef
 
 >  MARIADB_POST_INSTALL_TARGET_HOOKS += MARIADB_POST_INSTALL
 > -- 
 > 2.14.5

 > _______________________________________________
 > buildroot mailing list
 > buildroot@busybox.net
 > http://lists.busybox.net/mailman/listinfo/buildroot

Patch

diff --git a/package/mariadb/mariadb.mk b/package/mariadb/mariadb.mk
index 06d6365fab..52d47f98fc 100644
--- a/package/mariadb/mariadb.mk
+++ b/package/mariadb/mariadb.mk
@@ -125,10 +125,15 @@  endif
 
 # We don't need mysql_config on the target as it's only useful in staging
 # We also don't need the test suite on the target
+# Also mariadb_config in staging is not a shell script, this breaks
+# mysql_config when cross-compiling.  This in turn breaks package builds
+# needing the location of the include and library files. So remove it after
+# installation into $TARGET_DIR
 define MARIADB_POST_INSTALL
 	mkdir -p $(TARGET_DIR)/var/lib/mysql
 	$(RM) $(TARGET_DIR)/usr/bin/mysql_config
 	$(RM) -r $(TARGET_DIR)/usr/share/mysql/test
+	$(RM) $(STAGING_DIR)/usr/bin/mariadb_config
 endef
 
 MARIADB_POST_INSTALL_TARGET_HOOKS += MARIADB_POST_INSTALL