All of lore.kernel.org
 help / color / mirror / Atom feed
* meta-python: outrageously long cython shebang with pyro
@ 2017-05-13  6:34 S. Lockwood-Childs
  2017-05-15 11:58 ` Alexander Kanavin
  2017-05-19 22:27 ` [meta-python][master][pyro][PATCH] python-cython: mangle scripts to use /usr/bin/env python S. Lockwood-Childs
  0 siblings, 2 replies; 5+ messages in thread
From: S. Lockwood-Childs @ 2017-05-13  6:34 UTC (permalink / raw)
  To: openembedded-devel

The recipe-specific sysroots in pyro are a wonderful thing for uncovering 
missing dependencies, but they also make it easier than ever to break
the cython scripts by exceeding the measly 128-byte limit on shebang lines. 

The cython recipe builds fine -- this is runtime breakage from recipes that
depend on cython. This was always a danger when using lengthy toplevel
directory names (e.g. as tends to happen in jenkins auto-builds), but
now I managed to get the dreaded "bad interpreter: No such file or directory"
failure from cython despite a not-ridiculously-long toplevel path:

#!/var/data/sjl/poky/build/tmp/work/armv7a-neon-oe-linux-gnueabi/libplist/git-r0/recipe-sysroot-native/usr/bin/python-native/python

Does anybody know of a recommended strategy for solving the shebang problem,
now that it has been exacerbated by the sysroot move? I'll be happy to submit a
corresponding cython patch if so. 


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

* Re: meta-python: outrageously long cython shebang with pyro
  2017-05-13  6:34 meta-python: outrageously long cython shebang with pyro S. Lockwood-Childs
@ 2017-05-15 11:58 ` Alexander Kanavin
  2017-05-19 22:27 ` [meta-python][master][pyro][PATCH] python-cython: mangle scripts to use /usr/bin/env python S. Lockwood-Childs
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2017-05-15 11:58 UTC (permalink / raw)
  To: S. Lockwood-Childs, openembedded-devel

On 05/13/2017 09:34 AM, S. Lockwood-Childs wrote:
> The cython recipe builds fine -- this is runtime breakage from recipes that
> depend on cython. This was always a danger when using lengthy toplevel
> directory names (e.g. as tends to happen in jenkins auto-builds), but
> now I managed to get the dreaded "bad interpreter: No such file or directory"
> failure from cython despite a not-ridiculously-long toplevel path:
>
> #!/var/data/sjl/poky/build/tmp/work/armv7a-neon-oe-linux-gnueabi/libplist/git-r0/recipe-sysroot-native/usr/bin/python-native/python

We typically patch the upstream code to use

#!/usr/bin/env python

There is some PATH environment variable magic that will ensure that the 
correct version of python will come first in the PATH, so it should be 
safe to do. There's a ton of examples in oe-core.


Alex



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

* [meta-python][master][pyro][PATCH] python-cython: mangle scripts to use /usr/bin/env python
  2017-05-13  6:34 meta-python: outrageously long cython shebang with pyro S. Lockwood-Childs
  2017-05-15 11:58 ` Alexander Kanavin
@ 2017-05-19 22:27 ` S. Lockwood-Childs
  2017-05-19 23:45   ` [meta-python][master][pyro][PATCH, v2] " S. Lockwood-Childs
  2017-05-20  0:13   ` [meta-python][master][pyro][PATCH, v3] " S. Lockwood-Childs
  1 sibling, 2 replies; 5+ messages in thread
From: S. Lockwood-Childs @ 2017-05-19 22:27 UTC (permalink / raw)
  To: openembedded-devel

This prevents runtime failure "bad interpreter: No such file or directory"
from running native cython when the native python is installed
at a long path, exceeding the 128-character limit for shebang lines
on linux. Exceeding the limit was already possible when using a long
path for topdir, but it got easier to exceed after the switch to per-recipe
sysroots.

Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
---
 meta-python/recipes-devtools/python/python-cython.inc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta-python/recipes-devtools/python/python-cython.inc b/meta-python/recipes-devtools/python/python-cython.inc
index 1ecdcc9..66383bf 100644
--- a/meta-python/recipes-devtools/python/python-cython.inc
+++ b/meta-python/recipes-devtools/python/python-cython.inc
@@ -17,3 +17,10 @@ RDEPENDS_${PN}_class-target += "\
     ${PYTHON_PN}-subprocess \
     ${PYTHON_PN}-shell \
 "
+
+do_install_append() {
+	# Make sure we use /usr/bin/env python
+	for PYTHSCRIPT in `grep -rIl '^!#.*python' ${D}${bindir}`; do
+		sed -i -e '1s|^#!.*|#!/usr/bin/env ${PYTHON_PN}|' $PYTHSCRIPT
+	done
+}
-- 
1.9.4



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

* [meta-python][master][pyro][PATCH, v2] python-cython: mangle scripts to use /usr/bin/env python
  2017-05-19 22:27 ` [meta-python][master][pyro][PATCH] python-cython: mangle scripts to use /usr/bin/env python S. Lockwood-Childs
@ 2017-05-19 23:45   ` S. Lockwood-Childs
  2017-05-20  0:13   ` [meta-python][master][pyro][PATCH, v3] " S. Lockwood-Childs
  1 sibling, 0 replies; 5+ messages in thread
From: S. Lockwood-Childs @ 2017-05-19 23:45 UTC (permalink / raw)
  To: openembedded-devel

This prevents runtime failure "bad interpreter: No such file or directory"                                              
from running native cython when the native python is installed                                                          
at a long path, exceeding the 128-character limit for shebang lines                                                     
on linux. Exceeding the limit was already possible when using a long                                                    
path for topdir, but it got easier to exceed after the switch to per-recipe                                             
sysroots.                                                                                                               
---
 meta-python/recipes-devtools/python/python-cython.inc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta-python/recipes-devtools/python/python-cython.inc b/meta-python/recipes-devtools/python/python-cython.inc
index 1ecdcc9..22b49f3 100644
--- a/meta-python/recipes-devtools/python/python-cython.inc
+++ b/meta-python/recipes-devtools/python/python-cython.inc
@@ -17,3 +17,10 @@ RDEPENDS_${PN}_class-target += "\
     ${PYTHON_PN}-subprocess \
     ${PYTHON_PN}-shell \
 "
+
+do_install_append() {
+	# Make sure we use /usr/bin/env python
+	for PYTHSCRIPT in `grep -rIl '^!#.*python' ${D}`; do
+		sed -i -e '1s|^#!.*|#!/usr/bin/env ${PYTHON_PN}|' $PYTHSCRIPT
+	done
+}
-- 
1.9.4



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

* [meta-python][master][pyro][PATCH, v3] python-cython: mangle scripts to use /usr/bin/env python
  2017-05-19 22:27 ` [meta-python][master][pyro][PATCH] python-cython: mangle scripts to use /usr/bin/env python S. Lockwood-Childs
  2017-05-19 23:45   ` [meta-python][master][pyro][PATCH, v2] " S. Lockwood-Childs
@ 2017-05-20  0:13   ` S. Lockwood-Childs
  1 sibling, 0 replies; 5+ messages in thread
From: S. Lockwood-Childs @ 2017-05-20  0:13 UTC (permalink / raw)
  To: openembedded-devel

This prevents runtime failure "bad interpreter: No such file or directory"
from running native cython when the native python is installed
at a long path, exceeding the 128-character limit for shebang lines
on linux. Exceeding the limit was already possible when using a long
path for topdir, but it got easier to exceed after the switch to per-recipe
sysroots.
---
 meta-python/recipes-devtools/python/python-cython.inc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta-python/recipes-devtools/python/python-cython.inc b/meta-python/recipes-devtools/python/python-cython.inc
index 1ecdcc9..da39d14 100644
--- a/meta-python/recipes-devtools/python/python-cython.inc
+++ b/meta-python/recipes-devtools/python/python-cython.inc
@@ -17,3 +17,10 @@ RDEPENDS_${PN}_class-target += "\
     ${PYTHON_PN}-subprocess \
     ${PYTHON_PN}-shell \
 "
+
+do_install_append() {
+	# Make sure we use /usr/bin/env python
+	for PYTHSCRIPT in `grep -rIl '^#!.*python' ${D}`; do
+		sed -i -e '1s|^#!.*|#!/usr/bin/env ${PYTHON_PN}|' $PYTHSCRIPT
+	done
+}
-- 
1.9.4


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

end of thread, other threads:[~2017-05-20  0:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-13  6:34 meta-python: outrageously long cython shebang with pyro S. Lockwood-Childs
2017-05-15 11:58 ` Alexander Kanavin
2017-05-19 22:27 ` [meta-python][master][pyro][PATCH] python-cython: mangle scripts to use /usr/bin/env python S. Lockwood-Childs
2017-05-19 23:45   ` [meta-python][master][pyro][PATCH, v2] " S. Lockwood-Childs
2017-05-20  0:13   ` [meta-python][master][pyro][PATCH, v3] " S. Lockwood-Childs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.