[OE-core] [PATCH] meson.bbclass: Fix build issues with /tmp mounted with noexec
Mark Asselstine
mark.asselstine at windriver.com
Wed Oct 10 20:19:54 UTC 2018
On Wednesday, October 10, 2018 3:54:10 PM EDT Khem Raj wrote:
> On Wed, Oct 10, 2018 at 12:36 PM Mark Asselstine
>
> <mark.asselstine at windriver.com> wrote:
> > Since commit d297f7ebf3f6 [fribidi: use Meson instead of autotools]
> > build failures have been observed with this package. The immediate
> > issue was related to improperly named #defines per
> > https://github.com/fribidi/fribidi/commit/46f52d588ab5, however, the
> > root cause was FRIBIDI_SIZEOF_INT getting a value of "-1".
> >
> > After searching the meson logs the following was found:
> > Could not run: /tmp/tmp2fxe6ha1/output.exe (error: [Errno 13] Permission
> > denied) Checking for size of "int": -1
> >
> > Which pointed to the real root cause being /tmp mounted with noexec, a
> > common configuration on Redhat and other distros. This issues has been
> > raised in the meson community:
> > https://github.com/mesonbuild/meson/issues/2972 but is yet to be
> > addressed.
> >
> > Using the discussion from issue#2972 and the fact that the underlying
> > code makes use of python 'tempfile' we can simply create a 'tmp'
> > directory and make use of TMPDIR to avoid this issue.
> >
> > Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
> > ---
> >
> > meta/classes/meson.bbclass | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
> > index ed08a40..7e63e12 100644
> > --- a/meta/classes/meson.bbclass
> > +++ b/meta/classes/meson.bbclass
> > @@ -109,6 +109,9 @@ EOF
> >
> > CONFIGURE_FILES = "meson.build"
> >
> > meson_do_configure() {
> >
> > + # Work around "Meson fails if /tmp is mounted with noexec #2972"
>
> I would call it a bug in meson not a workaround.
Definitely a bug in that it doesn't propogate as an error. On the need to
always use meson-private, I am 50/50 on that. Since meson respects TMPDIR/TMP/
TEMP does it really need to handle this directly?
Anyway, not sure if Mark Hatle and the other build system experts will like my
fix, I will adjust as needed if/when they weigh in.
MarkA
>
> > + mkdir -p "${B}/meson-private/tmp"
> > + export TMPDIR="${B}/meson-private/tmp"
> >
> > bbnote Executing meson ${EXTRA_OEMESON}...
> > if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}"
> > ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then>
> > bbfatal_log meson failed
> >
> > --
> > 2.7.4
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
More information about the Openembedded-core
mailing list