Message ID | 20240317095811.52758-1-fontaine.fabrice@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/1] package/xvisor: fix build without python interpreter | expand |
On 17/03/2024 10:58, Fabrice Fontaine wrote: > Fix the following build failures on a system not providing the "python" > interpreter binary raised at least since bump to version 0.3.1 in commit > c4f8b8968770ecbf6444a5921c6472f126717626 and more probably > since the addition of the package in commit > e23ddf0c13e6d3b054782b86188396a0c2add1a5 and > https://github.com/xvisor/xvisor/commit/ba904b4066f4b375cb1ad76ca41570741dbec62e: > > /bin/sh: line 1: /home/buildroot/autobuild/instance-2/output-1/build/xvisor-0.3.1/tools/scripts/d2c.py: cannot execute: required file not found > > or > > /bin/sh: /home/buildroot/instance-0/output-1/build/xvisor-0.3.2/tools/scripts/d2c.py: /usr/bin/python: bad interpreter: No such file or directory > > Fixes: > - http://autobuild.buildroot.org/results/2e100bacc9e9face8351287e4c979c1729709d7b > - http://autobuild.buildroot.org/results/5d8a08512db1b3095158753e3a7843b0fd6c9749 > > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Applied to master, thanks. Regards, Arnout > --- > ...plicitly-use-the-python3-interpreter.patch | 35 +++++++++++++++++++ > package/xvisor/xvisor.mk | 2 +- > 2 files changed, 36 insertions(+), 1 deletion(-) > create mode 100644 package/xvisor/0001-TOOLS-d2c-py-explicitly-use-the-python3-interpreter.patch > > diff --git a/package/xvisor/0001-TOOLS-d2c-py-explicitly-use-the-python3-interpreter.patch b/package/xvisor/0001-TOOLS-d2c-py-explicitly-use-the-python3-interpreter.patch > new file mode 100644 > index 0000000000..349d4415e2 > --- /dev/null > +++ b/package/xvisor/0001-TOOLS-d2c-py-explicitly-use-the-python3-interpreter.patch > @@ -0,0 +1,35 @@ > +From 888c94e7a121d96aa88f84c58fe7e2bd771fc5ac Mon Sep 17 00:00:00 2001 > +From: Julien Olivain <ju.o@free.fr> > +Date: Fri, 25 Aug 2023 21:56:37 +0200 > +Subject: [PATCH] TOOLS: d2c.py: explicitly use the python3 interpreter > + > +When compiling Xvisor on a system not providing the "python" > +interpreter binary, compilation fails with output: > + > + (d2c) core/vio/keymaps/modifiers.c > + /bin/sh: 1: /build/xvisor-0.3.2/tools/scripts/d2c.py: not found > + > +This commit fixes the issue following the PEP 394 recommendation: > +https://peps.python.org/pep-0394/ > + > +It sets the "shebang" to `#! /usr/bin/env python3` to allow using other > +interpreters in the PATH, or virtual environment. > + > +Signed-off-by: Julien Olivain <ju.o@free.fr> > + > +Upstream: https://github.com/xvisor/xvisor/commit/888c94e7a121d96aa88f84c58fe7e2bd771fc5ac > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> > +--- > + tools/scripts/d2c.py | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/tools/scripts/d2c.py b/tools/scripts/d2c.py > +index b46a7bc468..daac4a5450 100755 > +--- a/tools/scripts/d2c.py > ++++ b/tools/scripts/d2c.py > +@@ -1,4 +1,4 @@ > +-#!/usr/bin/python > ++#! /usr/bin/env python3 > + #/** > + # Copyright (c) 2013 Anup Patel. > + # All rights reserved. > diff --git a/package/xvisor/xvisor.mk b/package/xvisor/xvisor.mk > index eba37be9b7..2a51706b55 100644 > --- a/package/xvisor/xvisor.mk > +++ b/package/xvisor/xvisor.mk > @@ -11,7 +11,7 @@ XVISOR_LICENSE = GPL-2.0+ > XVISOR_LICENSE_FILES = COPYING > XVISOR_INSTALL_IMAGES = YES > XVISOR_INSTALL_TARGET = NO > -XVISOR_DEPENDENCIES = host-bison host-dtc host-flex > +XVISOR_DEPENDENCIES = host-bison host-dtc host-flex host-python3 > > XVISOR_MAKE_TARGETS = all >
>>>>> "Arnout" == Arnout Vandecappelle via buildroot <buildroot@buildroot.org> writes: > On 17/03/2024 10:58, Fabrice Fontaine wrote: >> Fix the following build failures on a system not providing the "python" >> interpreter binary raised at least since bump to version 0.3.1 in commit >> c4f8b8968770ecbf6444a5921c6472f126717626 and more probably >> since the addition of the package in commit >> e23ddf0c13e6d3b054782b86188396a0c2add1a5 and >> https://github.com/xvisor/xvisor/commit/ba904b4066f4b375cb1ad76ca41570741dbec62e: >> /bin/sh: line 1: >> /home/buildroot/autobuild/instance-2/output-1/build/xvisor-0.3.1/tools/scripts/d2c.py: >> cannot execute: required file not found >> or >> /bin/sh: >> /home/buildroot/instance-0/output-1/build/xvisor-0.3.2/tools/scripts/d2c.py: >> /usr/bin/python: bad interpreter: No such file or directory >> Fixes: >> - http://autobuild.buildroot.org/results/2e100bacc9e9face8351287e4c979c1729709d7b >> - http://autobuild.buildroot.org/results/5d8a08512db1b3095158753e3a7843b0fd6c9749 >> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> > Applied to master, thanks. .. >> -XVISOR_DEPENDENCIES = host-bison host-dtc host-flex >> +XVISOR_DEPENDENCIES = host-bison host-dtc host-flex host-python3 Given that this script doesn't use any special python modules we can presumably use BR2_PYTHON3_HOST_DEPENDENCY instead of forcing a build of host-python3?
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes: >>>>> "Arnout" == Arnout Vandecappelle via buildroot <buildroot@buildroot.org> writes: >> On 17/03/2024 10:58, Fabrice Fontaine wrote: >>> Fix the following build failures on a system not providing the "python" >>> interpreter binary raised at least since bump to version 0.3.1 in commit >>> c4f8b8968770ecbf6444a5921c6472f126717626 and more probably >>> since the addition of the package in commit >>> e23ddf0c13e6d3b054782b86188396a0c2add1a5 and >>> https://github.com/xvisor/xvisor/commit/ba904b4066f4b375cb1ad76ca41570741dbec62e: >>> /bin/sh: line 1: >>> /home/buildroot/autobuild/instance-2/output-1/build/xvisor-0.3.1/tools/scripts/d2c.py: >>> cannot execute: required file not found >>> or >>> /bin/sh: >>> /home/buildroot/instance-0/output-1/build/xvisor-0.3.2/tools/scripts/d2c.py: >>> /usr/bin/python: bad interpreter: No such file or directory >>> Fixes: >>> - http://autobuild.buildroot.org/results/2e100bacc9e9face8351287e4c979c1729709d7b >>> - http://autobuild.buildroot.org/results/5d8a08512db1b3095158753e3a7843b0fd6c9749 >>> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> >> Applied to master, thanks. > .. >>> -XVISOR_DEPENDENCIES = host-bison host-dtc host-flex >>> +XVISOR_DEPENDENCIES = host-bison host-dtc host-flex host-python3 > Given that this script doesn't use any special python modules we can > presumably use BR2_PYTHON3_HOST_DEPENDENCY instead of forcing a build of > host-python3? Committed to 2024.02.x, 2023.02.x and 2023.11.x, thanks.
diff --git a/package/xvisor/0001-TOOLS-d2c-py-explicitly-use-the-python3-interpreter.patch b/package/xvisor/0001-TOOLS-d2c-py-explicitly-use-the-python3-interpreter.patch new file mode 100644 index 0000000000..349d4415e2 --- /dev/null +++ b/package/xvisor/0001-TOOLS-d2c-py-explicitly-use-the-python3-interpreter.patch @@ -0,0 +1,35 @@ +From 888c94e7a121d96aa88f84c58fe7e2bd771fc5ac Mon Sep 17 00:00:00 2001 +From: Julien Olivain <ju.o@free.fr> +Date: Fri, 25 Aug 2023 21:56:37 +0200 +Subject: [PATCH] TOOLS: d2c.py: explicitly use the python3 interpreter + +When compiling Xvisor on a system not providing the "python" +interpreter binary, compilation fails with output: + + (d2c) core/vio/keymaps/modifiers.c + /bin/sh: 1: /build/xvisor-0.3.2/tools/scripts/d2c.py: not found + +This commit fixes the issue following the PEP 394 recommendation: +https://peps.python.org/pep-0394/ + +It sets the "shebang" to `#! /usr/bin/env python3` to allow using other +interpreters in the PATH, or virtual environment. + +Signed-off-by: Julien Olivain <ju.o@free.fr> + +Upstream: https://github.com/xvisor/xvisor/commit/888c94e7a121d96aa88f84c58fe7e2bd771fc5ac +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> +--- + tools/scripts/d2c.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/scripts/d2c.py b/tools/scripts/d2c.py +index b46a7bc468..daac4a5450 100755 +--- a/tools/scripts/d2c.py ++++ b/tools/scripts/d2c.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#! /usr/bin/env python3 + #/** + # Copyright (c) 2013 Anup Patel. + # All rights reserved. diff --git a/package/xvisor/xvisor.mk b/package/xvisor/xvisor.mk index eba37be9b7..2a51706b55 100644 --- a/package/xvisor/xvisor.mk +++ b/package/xvisor/xvisor.mk @@ -11,7 +11,7 @@ XVISOR_LICENSE = GPL-2.0+ XVISOR_LICENSE_FILES = COPYING XVISOR_INSTALL_IMAGES = YES XVISOR_INSTALL_TARGET = NO -XVISOR_DEPENDENCIES = host-bison host-dtc host-flex +XVISOR_DEPENDENCIES = host-bison host-dtc host-flex host-python3 XVISOR_MAKE_TARGETS = all
Fix the following build failures on a system not providing the "python" interpreter binary raised at least since bump to version 0.3.1 in commit c4f8b8968770ecbf6444a5921c6472f126717626 and more probably since the addition of the package in commit e23ddf0c13e6d3b054782b86188396a0c2add1a5 and https://github.com/xvisor/xvisor/commit/ba904b4066f4b375cb1ad76ca41570741dbec62e: /bin/sh: line 1: /home/buildroot/autobuild/instance-2/output-1/build/xvisor-0.3.1/tools/scripts/d2c.py: cannot execute: required file not found or /bin/sh: /home/buildroot/instance-0/output-1/build/xvisor-0.3.2/tools/scripts/d2c.py: /usr/bin/python: bad interpreter: No such file or directory Fixes: - http://autobuild.buildroot.org/results/2e100bacc9e9face8351287e4c979c1729709d7b - http://autobuild.buildroot.org/results/5d8a08512db1b3095158753e3a7843b0fd6c9749 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> --- ...plicitly-use-the-python3-interpreter.patch | 35 +++++++++++++++++++ package/xvisor/xvisor.mk | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 package/xvisor/0001-TOOLS-d2c-py-explicitly-use-the-python3-interpreter.patch