[yocto] [meta-mono] [RFC] [PATCH 1/1] mono.bbclass: set MONO_CFG_DIR

Richard Tollerton rich.tollerton at ni.com
Fri Jul 17 09:57:22 PDT 2015


Several mono package builds were observed to fail while cross-compiling
to arm in ways that, upon stracing, boiled down to not being able to
load the mono config file because mono was looking for it in
${STAGING_DIR_NATIVE}/usr/etc instead of
${STAGING_DIR_NATIVE}/etc (which is where it was being installed).

mono/mono/metadata/assembly.c:set_dirs() appears to be responsible for
guessing /usr/etc, by essentially computing $(dirname $0)/../etc.
There's a separate codepath that instead chooses $sysconfdir (cf
assembly.c:fallback(), mono-config-dirs.c:mono_config_get_cfg_dir(), and
the Makefile). Presumably that's what's usually used for native mono
builds, but for presently unknown reasons, it's not getting used here.

The workaround implemented here is to force setting MONO_CFG_DIR for all
builds to the correct location of /etc in the native sysroot.
(I had earlier worked around this by changing the mono-native build to
install to /usr/etc instead of /etc, but that's more complicated to
manage in the recipes, and violates the configuration symmetry between
architectures.)

Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
---
 classes/mono.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/classes/mono.bbclass b/classes/mono.bbclass
index 315ee82..1cb4b17 100644
--- a/classes/mono.bbclass
+++ b/classes/mono.bbclass
@@ -30,3 +30,5 @@ FILES_${PN}-dev += "\
 FILES_${PN}-doc += "\
   ${libdir}/monodoc/* \
 "
+
+export MONO_CFG_DIR="${STAGING_ETCDIR_NATIVE}"
-- 
2.4.4




More information about the yocto mailing list