Openembedded Core Discussions
 help / color / mirror / Atom feed
* [master][dizzy][PATCH 0/2] swig + pcre-config
@ 2015-01-23 14:48 Patrick Ohly
  2015-01-23 14:48 ` [master][dizzy][PATCH 1/2] binconfig-disabled: try harder to prevent usage of config scripts Patrick Ohly
  2015-01-23 14:48 ` [master][dizzy][PATCH 2/2] binconfig-disabled: install config scripts in sysroot Patrick Ohly
  0 siblings, 2 replies; 3+ messages in thread
From: Patrick Ohly @ 2015-01-23 14:48 UTC (permalink / raw)
  To: openembedded-core

The reason for the patch series is the observation that swig from
meta-openembedded requires pcre-config to be installed on the host
system, even though it does not actually get used.

While that can be fixed in the swig recipe, investigating the situation
led to the conclusion that the current handling of obsolete config
scripts is sub-optimal and does not actually cause undesired usage
of the patched scripts to fail.

These two patches address that. They apply to master and dizzy.
Applying also to dizzy would have the desirable effect of removing
swig's host dependency without having to modify swig, but might also
be a bit too intrusive for the stable series.

Patrick Ohly (2):
  binconfig-disabled: try harder to prevent usage of config scripts
  binconfig-disabled: install config scripts in sysroot

 meta/classes/binconfig-disabled.bbclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)

-- 
1.8.4.5



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

* [master][dizzy][PATCH 1/2] binconfig-disabled: try harder to prevent usage of config scripts
  2015-01-23 14:48 [master][dizzy][PATCH 0/2] swig + pcre-config Patrick Ohly
@ 2015-01-23 14:48 ` Patrick Ohly
  2015-01-23 14:48 ` [master][dizzy][PATCH 2/2] binconfig-disabled: install config scripts in sysroot Patrick Ohly
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick Ohly @ 2015-01-23 14:48 UTC (permalink / raw)
  To: openembedded-core

Returning a non-zero exit code is not enough to cause errors when configure
scripts call the patched config scripts: for example, swig's configure script
uses PCRE_LIBS=`$PCRE_CONFIG --libs` and does not abort on errors. Using empty
output may then succeed, for example when the required library is available
indirectly.

Returning some nonsense command line arguments covers such cases, because
using them will definitely lead to errors during compilation. The faked
arguments were chosen such that these errors can be linked back to the root
cause.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
---
 meta/classes/binconfig-disabled.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/binconfig-disabled.bbclass b/meta/classes/binconfig-disabled.bbclass
index 27f904e..4c42ae2 100644
--- a/meta/classes/binconfig-disabled.bbclass
+++ b/meta/classes/binconfig-disabled.bbclass
@@ -10,6 +10,9 @@ FILES_${PN}-dev += "${bindir}/*-config"
 do_install_append () {
 	for x in ${BINCONFIG}; do
 		echo "#!/bin/sh" > ${D}$x
+		# Make the disabled script emit invalid parameters for those configure
+		# scripts which call it without checking the return code.
+		echo "echo '--should-not-have-used-$x'" > ${D}$x
 		echo "exit 1" >> ${D}$x
 	done
 }
-- 
1.8.4.5



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

* [master][dizzy][PATCH 2/2] binconfig-disabled: install config scripts in sysroot
  2015-01-23 14:48 [master][dizzy][PATCH 0/2] swig + pcre-config Patrick Ohly
  2015-01-23 14:48 ` [master][dizzy][PATCH 1/2] binconfig-disabled: try harder to prevent usage of config scripts Patrick Ohly
@ 2015-01-23 14:48 ` Patrick Ohly
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick Ohly @ 2015-01-23 14:48 UTC (permalink / raw)
  To: openembedded-core

The purpose of binconfig-disabled is to manipulate config scripts such that
using them causes errors. But that only works when the modified config script
really gets installed in the sysroot. That is not the case with the staging
code in binconfig.bbclass.

Only patched config files get staged. For that reason it seemed more
appropriate to change binconfig-disabled instead of binconfig.

The reason for the change was the observation that the swig recipe needs
pcre-config installed on the host system. Staging pcre-config removes that
host dependency. swig did not actually end up *using* the pcre-config from the
host, because later during do_compile the patched configure.ac is used to
re-generate configure.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
---
 meta/classes/binconfig-disabled.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/classes/binconfig-disabled.bbclass b/meta/classes/binconfig-disabled.bbclass
index 4c42ae2..0acc964 100644
--- a/meta/classes/binconfig-disabled.bbclass
+++ b/meta/classes/binconfig-disabled.bbclass
@@ -16,3 +16,13 @@ do_install_append () {
 		echo "exit 1" >> ${D}$x
 	done
 }
+
+SYSROOT_PREPROCESS_FUNCS += "binconfig_disabled_sysroot_preprocess"
+
+binconfig_disabled_sysroot_preprocess () {
+	for x in ${BINCONFIG}; do
+		configname=`basename $x`
+		install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+		install ${D}$x ${SYSROOT_DESTDIR}${bindir_crossscripts}
+	done
+}
-- 
1.8.4.5



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

end of thread, other threads:[~2015-01-23 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-23 14:48 [master][dizzy][PATCH 0/2] swig + pcre-config Patrick Ohly
2015-01-23 14:48 ` [master][dizzy][PATCH 1/2] binconfig-disabled: try harder to prevent usage of config scripts Patrick Ohly
2015-01-23 14:48 ` [master][dizzy][PATCH 2/2] binconfig-disabled: install config scripts in sysroot Patrick Ohly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox