Skip to contentSkip to conversation

scons.bbclass: Force rebuild if necessary

PATCH In review Andreas Müller 3 participants 5 messages Nov 13, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 scons.bbclass: Force rebuild if necessary

---
 meta/classes/scons.bbclass | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta/classes/scons.bbclass +10 -1
index b9ae19d582..286843f74c 100644
@@ -2,7 +2,16 @@ DEPENDS += "python-scons-native"
 
 EXTRA_OESCONS ?= ""
 
-do_configure[noexec] = "1"
+do_configure() {
+	if [ -n "${CONFIGURESTAMPFILE}" ]; then
+		if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then
+			${STAGING_BINDIR_NATIVE}/scons --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS}
+		fi
+
+		mkdir -p `dirname ${CONFIGURESTAMPFILE}`
+		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+	fi
+}
 
 scons_do_compile() {
         ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
Signature · 1 line
2.14.5
#1 lore raw

PATCH 2/2 scons.bbclass: fix indention

---
 meta/classes/scons.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/scons.bbclass +4 -4
index 286843f74c..9ee7d1587d 100644
@@ -14,13 +14,13 @@ do_configure() {
 }
 
 scons_do_compile() {
-        ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
-        die "scons build execution failed."
+	${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
+	die "scons build execution failed."
 }
 
 scons_do_install() {
-        ${STAGING_BINDIR_NATIVE}/scons install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \
-        die "scons install execution failed."
+	${STAGING_BINDIR_NATIVE}/scons install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \
+	die "scons install execution failed."
 }
 
 EXPORT_FUNCTIONS do_compile do_install
Signature · 1 line
2.14.5
#2 lore raw
In reply to Andreas Müller

This make me look at scons a bit closer, somewhat in shock that it doesn't have a native way of doing out of tree builds. Apparently abusing the repository argument will sometimes work for out of tree (so you could just put B=$WORKDIR/build and add B to [cleandirs]) but abusing sounds like 'doesn't always work' to me.

I then discovered that the one recipe in oe-core that uses scons doesn't in fact use the class, and switching to it breaks because there's no standard way of passing install paths (serf tries to install to /usr on the host).

So how is your experience with the scons class? Is it actually useful?

Ross

Quoted 36 lines · Andreas Müller
---
 meta/classes/scons.bbclass | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta/classes/scons.bbclass +10 -2
index b9ae19d582..286843f74c 100644
@@ -2,7 +2,16 @@ DEPENDS += "python-scons-native"
 
 EXTRA_OESCONS ?= ""
 
-do_configure[noexec] = "1"
+do_configure() {
+       if [ -n "${CONFIGURESTAMPFILE}" ]; then
+               if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then
+                       ${STAGING_BINDIR_NATIVE}/scons --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS}
+               fi
+
+               mkdir -p `dirname ${CONFIGURESTAMPFILE}`
+               echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+       fi
+}
 
 scons_do_compile() {
         ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
--

2.14.5

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 42 lines · Ross

This make me look at scons a bit closer, somewhat in shock that it doesn't have a native way of doing out of tree builds. Apparently abusing the repository argument will sometimes work for out of tree (so you could just put B=$WORKDIR/build and add B to [cleandirs]) but abusing sounds like 'doesn't always work' to me.

I then discovered that the one recipe in oe-core that uses scons doesn't in fact use the class, and switching to it breaks because there's no standard way of passing install paths (serf tries to install to /usr on the host).

So how is your experience with the scons class? Is it actually useful?

Ross

Quoted 26 lines · Andreas Müller
---
 meta/classes/scons.bbclass | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta/classes/scons.bbclass +10 -1
index b9ae19d582..286843f74c 100644
@@ -2,7 +2,16 @@ DEPENDS += "python-scons-native"
 
 EXTRA_OESCONS ?= ""
 
-do_configure[noexec] = "1"
+do_configure() {
+       if [ -n "${CONFIGURESTAMPFILE}" ]; then
+               if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then
+                       ${STAGING_BINDIR_NATIVE}/scons --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS}
+               fi
+
+               mkdir -p `dirname ${CONFIGURESTAMPFILE}`
+               echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+       fi
+}
 
Quoted 5 lines
Quoted 5 lines
meta/classes/scons.bbclass +0 -1
 scons_do_compile() {
         ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
--

2.14.5

Have few recipes in my layers inheriting scons. I build them frequently in my running 'world image' [1]:

meta-games/recipes-games/pingus/pingus_0.7.6.bb -> Builds 'fine' currently meta-qt5-extra/recipes-misc/recipes-multimedia/mixxx/mixxx_git.bb There are others I don't use:
meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb_git.bb meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd_3.17.bb

Mixxx (has QA issues I am trying to fix) is the one on which I found out that rebuild is not performed in case recipes are changed on which mixxx depends on.

So yes I consider this class useful :)

[1] https://github.com/schnitzeltony/meta-mortsgna/blob/master/recipes-image/allgui/allgui-full-image.bb

Andreas

#4 lore raw
Quoted 43 lines · Andreas Müller
Quoted 42 lines · Ross

This make me look at scons a bit closer, somewhat in shock that it doesn't have a native way of doing out of tree builds. Apparently abusing the repository argument will sometimes work for out of tree (so you could just put B=$WORKDIR/build and add B to [cleandirs]) but abusing sounds like 'doesn't always work' to me.

I then discovered that the one recipe in oe-core that uses scons doesn't in fact use the class, and switching to it breaks because there's no standard way of passing install paths (serf tries to install to /usr on the host).

So how is your experience with the scons class? Is it actually useful?

Ross

Quoted 26 lines · Andreas Müller
---
  meta/classes/scons.bbclass | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
meta/classes/scons.bbclass +10 -1
index b9ae19d582..286843f74c 100644
@@ -2,7 +2,16 @@ DEPENDS += "python-scons-native"
 
  EXTRA_OESCONS ?= ""
 
-do_configure[noexec] = "1"
+do_configure() {
+       if [ -n "${CONFIGURESTAMPFILE}" ]; then
+               if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then
+                       ${STAGING_BINDIR_NATIVE}/scons --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS}
+               fi
+
+               mkdir -p `dirname ${CONFIGURESTAMPFILE}`
+               echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+       fi
+}
 
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
meta/classes/scons.bbclass +0 -1
  scons_do_compile() {
          ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
--

2.14.5

Have few recipes in my layers inheriting scons. I build them frequently in my running 'world image' [1]:

I use gpsd from meta-oe, which "works" too...

// Martin

Quoted 16 lines

meta-games/recipes-games/pingus/pingus_0.7.6.bb -> Builds 'fine' currently meta-qt5-extra/recipes-misc/recipes-multimedia/mixxx/mixxx_git.bb There are others I don't use:
meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb_git.bb meta-openembedded/meta-oe/recipes-navigation/gpsd/gpsd_3.17.bb

Mixxx (has QA issues I am trying to fix) is the one on which I found out that rebuild is not performed in case recipes are changed on which mixxx depends on.

So yes I consider this class useful :)

[1] https://github.com/schnitzeltony/meta-mortsgna/blob/master/recipes-image/allgui/allgui-full-image.bb

Andreas

Signature · 10 lines
Kind regards,
Martin Hundebøll
Embedded Linux Consultant

+45 61 65 54 61
[email protected]

Geanix IVS
https://geanix.com
DK39600706