[OE-core] [RFC PATCH 1/7][dora] native-python: bad interpreter error message
Mark Hatle
mark.hatle at windriver.com
Thu Dec 5 22:57:40 UTC 2013
From: Amy Fong <Amy.Fong at windriver.com>
-- Sent for YP compliance --
On some builds with really long paths, we can end up exceeding the maximum
length line for an interpreter (man execve: A maximum line length of
127 characters is allowed for the first line in a #! executable shell
script.)
To avoid this limit, we use env to execute python, with this, we will
be using python that's first found in our PATH.
The former ${bindir}/env is not a good idea for apps requiring native-python
since coreutil*-native may not have been built (${bindir}/env may not exist)
and with long paths, we can end up running into the same issue, hence we
use /usr/bin/env from the host.
Signed-off-by: Amy Fong <Amy.Fong at windriver.com>
Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
Signed-off-by: Mark Hatle <mark.hatle at windriver.com>
---
meta/classes/distutils.bbclass | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index 8c3a979..b2895b3 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -49,7 +49,13 @@ distutils_do_install() {
for i in ${D}${bindir}/* ; do \
if [ ${PN} != "${BPN}-native" ]; then
sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
- fi
+ else
+ # The former ${bindir}/env is not a good idea for apps requiring native-python
+ # since coreutil*-native may not have been built (${bindir}/env may not exist)
+ # and with long paths, we can end up running into an issue where the
+ # interpreter line is too long, hence we use /usr/bin/env from the host.
+ sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:/usr/bin/env\ python:g $i
+ fi
sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
done
fi
@@ -58,6 +64,12 @@ distutils_do_install() {
for i in ${D}${sbindir}/* ; do \
if [ ${PN} != "${BPN}-native" ]; then
sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
+ else
+ # The former ${bindir}/env is not a good idea for apps requiring native-python
+ # since coreutil*-native may not have been built (${bindir}/env may not exist)
+ # and with long paths, we can end up running into an issue where the
+ # interpreter line is too long, hence we use /usr/bin/env from the host.
+ sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:/usr/bin/env\ python:g $i
fi
sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
done
--
1.8.1.2.545.g2f19ada
More information about the Openembedded-core
mailing list