* [PATCH] externalsrc.bbclass: Add task buildclean
@ 2016-12-22 13:28 Ola x Nilsson
2016-12-22 17:20 ` Paul Eggleton
2016-12-23 17:32 ` Peter Kjellerstedt
0 siblings, 2 replies; 4+ messages in thread
From: Ola x Nilsson @ 2016-12-22 13:28 UTC (permalink / raw)
To: openembedded-core
The buildclean task should call the package build system clean
command, just implemented for Make for now.
This is meant for recipes where S == B, but can be useful as a
standalone task for other recipes too.
Setting it to run before do_clean will do what most developers expect
when calling bitbake -c clean.
Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com>
---
meta/classes/externalsrc.bbclass | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index e115a47..bc82f1f 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -4,7 +4,7 @@
# Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
# Released under the MIT license (see COPYING.MIT for the terms)
#
-# externalsrc.bbclass enables use of an existing source tree, usually external to
+# externalsrc.bbclass enables use of an existing source tree, usually external to
# the build system to build a piece of software rather than the usual fetch/unpack/patch
# process.
#
@@ -108,6 +108,8 @@ python () {
# We don't want the workdir to go away
d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN'))
+ bb.build.addtask('do_makeclean', 'do_clean', None, d)
+
# If B=S the same builddir is used even for different architectures.
# Thus, use a shared CONFIGURESTAMPFILE and STAMP directory so that
# change of do_configure task hash is correctly detected and stamps are
@@ -142,6 +144,17 @@ python externalsrc_compile_prefunc() {
bb.plain('NOTE: %s: compiling from external source tree %s' % (d.getVar('PN'), d.getVar('EXTERNALSRC')))
}
+do_buildclean[dirs] = "${S} ${B}"
+do_buildclean[nostamp] = "1"
+do_buildclean[doc] = "Call 'make clean' or equivalent in ${B}"
+externalsrc_do_buildclean() {
+ if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
+ oe_runmake clean || die "make failed"
+ else
+ bbnote "nothing to compile - no makefile found"
+ fi
+}
+
def srctree_hash_files(d):
import shutil
import subprocess
@@ -188,3 +201,5 @@ def srctree_configure_hash_files(d):
if f in search_files:
out_items.append('%s:True' % os.path.join(root, f))
return ' '.join(out_items)
+
+EXPORT_FUNCTIONS do_buildclean
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] externalsrc.bbclass: Add task buildclean
2016-12-22 13:28 [PATCH] externalsrc.bbclass: Add task buildclean Ola x Nilsson
@ 2016-12-22 17:20 ` Paul Eggleton
2016-12-22 18:11 ` Ola x Nilsson
2016-12-23 17:32 ` Peter Kjellerstedt
1 sibling, 1 reply; 4+ messages in thread
From: Paul Eggleton @ 2016-12-22 17:20 UTC (permalink / raw)
To: Ola x Nilsson; +Cc: openembedded-core
Hi Ola,
I like this, thanks. Just one thing commented below.
On Thu, 22 Dec 2016 14:28:03 Ola x Nilsson wrote:
> The buildclean task should call the package build system clean
> command, just implemented for Make for now.
>
> This is meant for recipes where S == B, but can be useful as a
> standalone task for other recipes too.
>
> Setting it to run before do_clean will do what most developers expect
> when calling bitbake -c clean.
>
> Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com>
> ---
> meta/classes/externalsrc.bbclass | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/externalsrc.bbclass
> b/meta/classes/externalsrc.bbclass index e115a47..bc82f1f 100644
> --- a/meta/classes/externalsrc.bbclass
> +++ b/meta/classes/externalsrc.bbclass
> @@ -4,7 +4,7 @@
> # Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
> # Released under the MIT license (see COPYING.MIT for the terms)
> #
> -# externalsrc.bbclass enables use of an existing source tree, usually
> external to
> +# externalsrc.bbclass enables use of an existing source tree,
> usually external to
> # the build system to build a piece of software rather
> than the usual fetch/unpack/patch # process.
> #
> @@ -108,6 +108,8 @@ python () {
> # We don't want the workdir to go away
> d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN'))
>
> + bb.build.addtask('do_makeclean', 'do_clean', None, d)
> +
Shouldn't this be do_buildclean here?
> # If B=S the same builddir is used even for different
> architectures. # Thus, use a shared CONFIGURESTAMPFILE and STAMP directory
> so that # change of do_configure task hash is correctly detected and stamps
> are @@ -142,6 +144,17 @@ python externalsrc_compile_prefunc() {
> bb.plain('NOTE: %s: compiling from external source tree %s' %
> (d.getVar('PN'), d.getVar('EXTERNALSRC'))) }
>
> +do_buildclean[dirs] = "${S} ${B}"
> +do_buildclean[nostamp] = "1"
> +do_buildclean[doc] = "Call 'make clean' or equivalent in ${B}"
> +externalsrc_do_buildclean() {
> + if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
> + oe_runmake clean || die "make failed"
> + else
> + bbnote "nothing to compile - no makefile found"
> + fi
> +}
> +
> def srctree_hash_files(d):
> import shutil
> import subprocess
> @@ -188,3 +201,5 @@ def srctree_configure_hash_files(d):
> if f in search_files:
> out_items.append('%s:True' % os.path.join(root, f))
> return ' '.join(out_items)
> +
> +EXPORT_FUNCTIONS do_buildclean
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] externalsrc.bbclass: Add task buildclean
2016-12-22 17:20 ` Paul Eggleton
@ 2016-12-22 18:11 ` Ola x Nilsson
0 siblings, 0 replies; 4+ messages in thread
From: Ola x Nilsson @ 2016-12-22 18:11 UTC (permalink / raw)
To: Ola x Nilsson, Paul Eggleton; +Cc: openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 3159 bytes --]
---- Paul Eggleton wrote ----
> Hi Ola,
>
> I like this, thanks. Just one thing commented below.
>
> On Thu, 22 Dec 2016 14:28:03 Ola x Nilsson wrote:
> >
> > + bb.build.addtask('do_makeclean', 'do_clean', None, d)
> > +
>
> Shouldn't this be do_buildclean here?
>
Of course it should. The danger of last minute changes. I'll send a v2 patch after the holidays.
--
Ola
Hi Ola,
I like this, thanks. Just one thing commented below.
On Thu, 22 Dec 2016 14:28:03 Ola x Nilsson wrote:
> The buildclean task should call the package build system clean
> command, just implemented for Make for now.
>
> This is meant for recipes where S == B, but can be useful as a
> standalone task for other recipes too.
>
> Setting it to run before do_clean will do what most developers expect
> when calling bitbake -c clean.
>
> Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com>
> ---
> meta/classes/externalsrc.bbclass | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/externalsrc.bbclass
> b/meta/classes/externalsrc.bbclass index e115a47..bc82f1f 100644
> --- a/meta/classes/externalsrc.bbclass
> +++ b/meta/classes/externalsrc.bbclass
> @@ -4,7 +4,7 @@
> # Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
> # Released under the MIT license (see COPYING.MIT for the terms)
> #
> -# externalsrc.bbclass enables use of an existing source tree, usually
> external to
> +# externalsrc.bbclass enables use of an existing source tree,
> usually external to
> # the build system to build a piece of software rather
> than the usual fetch/unpack/patch # process.
> #
> @@ -108,6 +108,8 @@ python () {
> # We don't want the workdir to go away
> d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN'))
>
> + bb.build.addtask('do_makeclean', 'do_clean', None, d)
> +
Shouldn't this be do_buildclean here?
> # If B=S the same builddir is used even for different
> architectures. # Thus, use a shared CONFIGURESTAMPFILE and STAMP directory
> so that # change of do_configure task hash is correctly detected and stamps
> are @@ -142,6 +144,17 @@ python externalsrc_compile_prefunc() {
> bb.plain('NOTE: %s: compiling from external source tree %s' %
> (d.getVar('PN'), d.getVar('EXTERNALSRC'))) }
>
> +do_buildclean[dirs] = "${S} ${B}"
> +do_buildclean[nostamp] = "1"
> +do_buildclean[doc] = "Call 'make clean' or equivalent in ${B}"
> +externalsrc_do_buildclean() {
> + if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
> + oe_runmake clean || die "make failed"
> + else
> + bbnote "nothing to compile - no makefile found"
> + fi
> +}
> +
> def srctree_hash_files(d):
> import shutil
> import subprocess
> @@ -188,3 +201,5 @@ def srctree_configure_hash_files(d):
> if f in search_files:
> out_items.append('%s:True' % os.path.join(root, f))
> return ' '.join(out_items)
> +
> +EXPORT_FUNCTIONS do_buildclean
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
[-- Attachment #2: Type: text/html, Size: 5133 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] externalsrc.bbclass: Add task buildclean
2016-12-22 13:28 [PATCH] externalsrc.bbclass: Add task buildclean Ola x Nilsson
2016-12-22 17:20 ` Paul Eggleton
@ 2016-12-23 17:32 ` Peter Kjellerstedt
1 sibling, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2016-12-23 17:32 UTC (permalink / raw)
To: Ola x Nilsson, openembedded-core@lists.openembedded.org
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Ola x Nilsson
> Sent: den 22 december 2016 14:28
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] externalsrc.bbclass: Add task buildclean
>
> The buildclean task should call the package build system clean
> command, just implemented for Make for now.
>
> This is meant for recipes where S == B, but can be useful as a
> standalone task for other recipes too.
>
> Setting it to run before do_clean will do what most developers expect
> when calling bitbake -c clean.
>
> Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com>
> ---
> meta/classes/externalsrc.bbclass | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/externalsrc.bbclass
> b/meta/classes/externalsrc.bbclass
> index e115a47..bc82f1f 100644
> --- a/meta/classes/externalsrc.bbclass
> +++ b/meta/classes/externalsrc.bbclass
> @@ -4,7 +4,7 @@
> # Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
> # Released under the MIT license (see COPYING.MIT for the terms)
> #
> -# externalsrc.bbclass enables use of an existing source tree, usually external to
> +# externalsrc.bbclass enables use of an existing source tree, usually external to
> # the build system to build a piece of software rather than the usual fetch/unpack/patch
> # process.
> #
> @@ -108,6 +108,8 @@ python () {
> # We don't want the workdir to go away
> d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN'))
>
> + bb.build.addtask('do_makeclean', 'do_clean', None, d)
> +
> # If B=S the same builddir is used even for different architectures.
> # Thus, use a shared CONFIGURESTAMPFILE and STAMP directory so that
> # change of do_configure task hash is correctly detected and stamps are
> @@ -142,6 +144,17 @@ python externalsrc_compile_prefunc() {
> bb.plain('NOTE: %s: compiling from external source tree %s' % (d.getVar('PN'), d.getVar('EXTERNALSRC')))
> }
>
> +do_buildclean[dirs] = "${S} ${B}"
> +do_buildclean[nostamp] = "1"
> +do_buildclean[doc] = "Call 'make clean' or equivalent in ${B}"
> +externalsrc_do_buildclean() {
> + if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
> + oe_runmake clean || die "make failed"
> + else
> + bbnote "nothing to compile - no makefile found"
Change "compile" to "clean" to avoid confusion.
> + fi
> +}
> +
> def srctree_hash_files(d):
> import shutil
> import subprocess
> @@ -188,3 +201,5 @@ def srctree_configure_hash_files(d):
> if f in search_files:
> out_items.append('%s:True' % os.path.join(root, f))
> return ' '.join(out_items)
> +
> +EXPORT_FUNCTIONS do_buildclean
> --
> 2.1.4
//Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-23 17:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-22 13:28 [PATCH] externalsrc.bbclass: Add task buildclean Ola x Nilsson
2016-12-22 17:20 ` Paul Eggleton
2016-12-22 18:11 ` Ola x Nilsson
2016-12-23 17:32 ` Peter Kjellerstedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox