* [PATCH] gcc-source: rewrite do_preconfigure() in shell
@ 2017-03-02 16:16 Ross Burton
2017-03-02 16:21 ` Richard Purdie
0 siblings, 1 reply; 2+ messages in thread
From: Ross Burton @ 2017-03-02 16:16 UTC (permalink / raw)
To: openembedded-core
This function is essentially just four lines of shell, that for some reason was
written in Python.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/recipes-devtools/gcc/gcc-source.inc | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/meta/recipes-devtools/gcc/gcc-source.inc b/meta/recipes-devtools/gcc/gcc-source.inc
index fab99f2..7dcdb75 100644
--- a/meta/recipes-devtools/gcc/gcc-source.inc
+++ b/meta/recipes-devtools/gcc/gcc-source.inc
@@ -1,8 +1,8 @@
-deltask do_configure
-deltask do_compile
-deltask do_install
+deltask do_configure
+deltask do_compile
+deltask do_install
deltask do_populate_sysroot
-deltask do_populate_lic
+deltask do_populate_lic
RM_WORK_EXCLUDE += "${PN}"
inherit nopackages
@@ -18,20 +18,17 @@ INHIBIT_DEFAULT_DEPS = "1"
DEPENDS = ""
PACKAGES = ""
-python do_preconfigure () {
- import subprocess
- cmd = d.expand('cd ${S} && PATH=${PATH} gnu-configize')
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+do_preconfigure() {
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+
# See 0044-gengtypes.patch, we need to regenerate this file
- bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.c"))
- cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure")
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ rm -f ${S}/gcc/gengtype-lex.c
+
+ sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure
# Easiest way to stop bad RPATHs getting into the library since we have a
# broken libtool here (breaks cross-canadian and target at least)
- cmd = d.expand("sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure")
- subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure
}
addtask do_preconfigure after do_patch
do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot"
-
--
2.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gcc-source: rewrite do_preconfigure() in shell
2017-03-02 16:16 [PATCH] gcc-source: rewrite do_preconfigure() in shell Ross Burton
@ 2017-03-02 16:21 ` Richard Purdie
0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2017-03-02 16:21 UTC (permalink / raw)
To: Ross Burton, openembedded-core
On Thu, 2017-03-02 at 16:16 +0000, Ross Burton wrote:
> This function is essentially just four lines of shell, that for some
> reason was
> written in Python.
>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
> meta/recipes-devtools/gcc/gcc-source.inc | 25 +++++++++++-----------
I suspect this will break in the various signature checks and cause
rebuilds when things shouldn't.
http://git.yoctoproject.org/cgit.cgi/poky/commit/meta/?id=f07b7c0da1748afc35fbb2ead7ae10ec66c7c428
hints at why:
"It needs to be a python task to avoid lots of shell exported variables as dependencies."
which should of course be a comment in the code.
I wish we had a better way to control exported variables to shell tasks
which would be a better fix but right now we don't.
Cheers,
Richard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-02 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 16:16 [PATCH] gcc-source: rewrite do_preconfigure() in shell Ross Burton
2017-03-02 16:21 ` Richard Purdie
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.