* [PATCH] autotools: Attempt to clean build directory when rerunning configure
@ 2012-10-29 18:14 Phil Blundell
2012-10-30 8:10 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Phil Blundell @ 2012-10-29 18:14 UTC (permalink / raw)
To: oe-core
Existing logic in autotools_preconfigure() will clean the build directory
before rerunning configure in the case where ${S} != ${B}. It is, however,
desirable to make at least some attempt to clean the build artifacts for
in-tree builds since many packages lack the appropriate dependency rules
to force a recompile if (for example) CFLAGS has changed. Making distclean
would be better but is not practical because many packages don't support it
properly. Even "make clean" is not universally available, so we ignore any
failure from that command and just carry on regardless.
Signed-off-by: Phil Blundell <philb@gnu.org>
---
meta/classes/autotools.bbclass | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index b97d74b..6539df9 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -93,10 +93,15 @@ CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
autotools_preconfigure() {
if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
- if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${S}" != "${B}" ]; then
- echo "Previously configured separate build directory detected, cleaning ${B}"
- rm -rf ${B}
- mkdir ${B}
+ if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
+ if [ "${S}" != "${B}" ]; then
+ echo "Previously configured separate build directory detected, cleaning ${B}"
+ rm -rf ${B}
+ mkdir ${B}
+ else
+ echo "Previously configured source directory detected, cleaning ${S}"
+ ( oe_runmake clean ) || true
+ fi
fi
fi
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] autotools: Attempt to clean build directory when rerunning configure
2012-10-29 18:14 [PATCH] autotools: Attempt to clean build directory when rerunning configure Phil Blundell
@ 2012-10-30 8:10 ` Richard Purdie
2012-10-30 12:19 ` Phil Blundell
0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2012-10-30 8:10 UTC (permalink / raw)
To: Phil Blundell; +Cc: oe-core
On Mon, 2012-10-29 at 18:14 +0000, Phil Blundell wrote:
> Existing logic in autotools_preconfigure() will clean the build directory
> before rerunning configure in the case where ${S} != ${B}. It is, however,
> desirable to make at least some attempt to clean the build artifacts for
> in-tree builds since many packages lack the appropriate dependency rules
> to force a recompile if (for example) CFLAGS has changed. Making distclean
> would be better but is not practical because many packages don't support it
> properly. Even "make clean" is not universally available, so we ignore any
> failure from that command and just carry on regardless.
>
> Signed-off-by: Phil Blundell <philb@gnu.org>
> ---
> meta/classes/autotools.bbclass | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
How extensively has this been tested? I have a suspicion that we might
run into a number of issues doing this throughout the tree :(
I'm wondering how many recipes will suffer from issues with "make clean"
verses how many recipes would struggle if we defaulted ${B} != ${S}?
Cheers,
Richard
> diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
> index b97d74b..6539df9 100644
> --- a/meta/classes/autotools.bbclass
> +++ b/meta/classes/autotools.bbclass
> @@ -93,10 +93,15 @@ CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
>
> autotools_preconfigure() {
> if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
> - if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${S}" != "${B}" ]; then
> - echo "Previously configured separate build directory detected, cleaning ${B}"
> - rm -rf ${B}
> - mkdir ${B}
> + if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
> + if [ "${S}" != "${B}" ]; then
> + echo "Previously configured separate build directory detected, cleaning ${B}"
> + rm -rf ${B}
> + mkdir ${B}
> + else
> + echo "Previously configured source directory detected, cleaning ${S}"
> + ( oe_runmake clean ) || true
> + fi
> fi
> fi
> }
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] autotools: Attempt to clean build directory when rerunning configure
2012-10-30 8:10 ` Richard Purdie
@ 2012-10-30 12:19 ` Phil Blundell
0 siblings, 0 replies; 3+ messages in thread
From: Phil Blundell @ 2012-10-30 12:19 UTC (permalink / raw)
To: Richard Purdie; +Cc: oe-core
On Tue, 2012-10-30 at 08:10 +0000, Richard Purdie wrote:
> How extensively has this been tested? I have a suspicion that we might
> run into a number of issues doing this throughout the tree :(
I've had this in my tree for a few weeks and the only package I've found
so far that went wrong was polkit, see separate patch for that. (There
a few other packages for which "make clean" fails in a harmless manner.)
But it's true that I haven't built the whole of world this way yet.
>I'm wondering how many recipes will suffer from issues with "make
>clean" verses how many recipes would struggle if we defaulted
>${B} != ${S}?
My guess is that "make clean" is slightly more likely to work (or, at
least, not break anything) on average. But defaulting ${B} != ${S}
would definitely be a desirable thing in the longer term and I would
certainly be in favour of moving in that direction.
p.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-30 12:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 18:14 [PATCH] autotools: Attempt to clean build directory when rerunning configure Phil Blundell
2012-10-30 8:10 ` Richard Purdie
2012-10-30 12:19 ` Phil Blundell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox