buildroot/package/meson
Yann E. MORIN dd331c1a6f package/meson: fix shebang in deep build trees
The meson script includes the full path to the python interpreter. In
deep build trees, this path can be more than 128 characters long, which
is the limit for how long a shebang may be.

Notice that this has been bumped to 256 since kerel 5.1, but the issue still
persists:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6eb3c3d0a52dca337e327ae8868ca1f44a712e02

In older kernels, this limit was silently ignored, leading to potential
bugs, but newer kernels enforce that limit, and refuse to execve() the
script, returning with NOEXEC.  Since the script is +x, the shell (any
bourne shell, as well as the C shell) will conclude from that situation that
they should interpret it as a shell script, which it obviously is not.

Fix the problem by replacing the shebang with a call to /usr/bin/env
which will redirect to the correct python3 interpreter found in the
PATH.

Note however that this means our meson installation can no longer be
called from outside of the meson-package infrastructure anymore (not
that we ever supported it before, but who knows what people may have
done in their br2-external), unless one does set the PATH to include
$(HOST_DIR)/bin/ earlier than a system-provided python3 would be found.

Fixes: #12331 #12461

Reported-by: Jean-pierre Cartal <jpcartal@free.fr>
Reported-by: Matthias Weißer <m.weisser.m@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit 62df914ced)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-03-07 21:41:02 +01:00
..
0001-Only-fix-RPATH-if-install_rpath-is-not-empty.patch
0002-mdist.py-import-lzma-only-when-needed.patch package/meson: import lzma only when needed 2019-10-19 20:39:16 +02:00
0003-Prefer-ext-static-libs-when-default-library-static.patch package/meson: force ext static libs when BR2_STATIC_LIBS 2019-10-26 19:02:00 +02:00
cross-compilation.conf.in
meson.hash package/meson: bump to version 0.52.0 2019-10-16 21:56:19 +02:00
meson.mk package/meson: fix shebang in deep build trees 2020-03-07 21:41:02 +01:00