Skip to contentSkip to conversation

autotools: do more cleanup when in do_configure

PATCH In review Chen Qi 3 participants 5 messages Sep 10, 2018 – Sep 11, 2018

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover autotools: do more cleanup when in do_configure

*** BLURB HERE ***
The following changes since commit c710430aa1a5a30d3087c3102485d4621e8d179e:

Revert "prelink: Fix SRC_URI and branch" (2018-09-06 14:49:28 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/autotools-clean
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/autotools-clean

Chen Qi (1):
autotools: do more cleanup when in do_configure

 meta/classes/autotools.bbclass | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 autotools: do more cleanup when in do_configure

I met the following error when compiling some projects.

| configure: error: `LDFLAGS' has changed since the previous run:
| configure:   former value:  `-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed'
| configure:   current value: `-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'

[snip]
| configure: error: changes in the environment can compromise the build | configure: error: run make distclean' and/or rm .././config.cache' and start over

I think when some recipe inherits autotools-brokensep, it should try to do more cleanups before configure. So also do 'make distclean' and remove config.cache just as what the error message told us.

---
 meta/classes/autotools.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta/classes/autotools.bbclass +2 -0
index 8768a6a..f577461 100644
@@ -113,6 +113,8 @@ autotools_preconfigure() {
 				cd ${S}
 				if [ "${CLEANBROKEN}" != "1" -a \( -e Makefile -o -e makefile -o -e GNUmakefile \) ]; then
 					oe_runmake clean
+					oe_runmake distclean
+					rm -f ${B}/config.cache
 				fi
 				find ${S} -ignore_readdir_race -name \*.la -delete
 			fi
Signature · 1 line
1.9.1
#2 lore raw
Quoted 5 lines · Chen Qi

I met the following error when compiling some projects.

| configure: error: `LDFLAGS' has changed since the previous run:
| configure:   former value:  `-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed'
| configure:   current value: `-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'
Quoted 7 lines

[snip]
| configure: error: changes in the environment can compromise the build | configure: error: run make distclean' and/or rm .././config.cache' and start over

I think when some recipe inherits autotools-brokensep, it should try to do more cleanups before configure. So also do 'make distclean' and remove config.cache just as what the error message told us.

Does just removing config.cache work for your problem? I'm concerned about running a distclean because some upstreams abuse that target and then can't rebuild.

Also obviously the proper fix is to not use autotools-brokensep in the recipe in the first place.

Ross

author
#3 lore raw
Quoted 10 lines · Ross
Quoted 9 lines · Chen Qi

I met the following error when compiling some projects.

| configure: error: `LDFLAGS' has changed since the previous run:
| configure:   former value:  `-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed'
| configure:   current value: `-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'

[snip]
| configure: error: changes in the environment can compromise the build | configure: error: run make distclean' and/or rm .././config.cache' and start over

Quoted 4 lines
Quoted 3 lines

I think when some recipe inherits autotools-brokensep, it should try to do more cleanups before configure. So also do 'make distclean' and remove config.cache just as what the error message told us.

Does just removing config.cache work for your problem?

I guess it should, but I haven't checked.

Quoted 3 lines

I'm concerned
about running a distclean because some upstreams abuse that target and then can't rebuild.

Hmm... I hold the opposite opinion.
I suspect that just doing a make clean' is more likely to break rebuild while doing a make distclean' should reduce the possibility.

Conceptually, make clean' is followed by make' while make distclean' is followed by configure & make'. At rebuild, we are doing configure & make'; so we should use make distclean', in theory.

I'll revisit this issue later and do more investigation.

Quoted 2 lines

Also obviously the proper fix is to not use autotools-brokensep in the recipe in the first place.

You are right.
The recipe is cyrus-sasl and the newly updated version has fixed to use autotools instead of autotools-brokensep.

To summarize, ideally we should have no recipe inheriting autotools-brokensep. But in reality, it's almost not possible. I sent out this patch because I thought it would be helpful for such recipes.

Best Regards,
Chen Qi

Quoted 2 lines

Ross

#4 lore raw
Quoted 52 lines · ChenQi
Quoted 16 lines · Ross
Quoted 14 lines · Chen Qi

I met the following error when compiling some projects.

Quoted 5 lines

configure: error: `LDFLAGS' has changed since the previous run:
configure: former value: `-Wl,-O1 -Wl,--hash-style=gnu -Wl,-
-as-needed'
configure: current value: `-Wl,-O1 -Wl,--hash-style=gnu -Wl,-
-as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'

[snip]

Quoted 4 lines

configure: error: changes in the environment can compromise the build
configure: error: run make distclean' and/or rm .././config.cache' and start over

Quoted 7 lines
Quoted 5 lines

I think when some recipe inherits autotools-brokensep, it should try to
do more cleanups before configure. So also do 'make distclean' and remove
config.cache just as what the error message told us.

Does just removing config.cache work for your problem?

I guess it should, but I haven't checked.

Quoted 4 lines

I'm concerned
about running a distclean because some upstreams abuse that target and
then can't rebuild.

Hmm... I hold the opposite opinion.
I suspect that just doing a `make clean' is more likely to break rebuild
while doing a `make distclean' should reduce the possibility.

Conceptually, make clean' is followed by make' while `make distclean'
is followed by `configure & make'.
At rebuild, we are doing configure & make'; so we should use make distclean', in theory.

I'll revisit this issue later and do more investigation.

Quoted 3 lines

Also obviously the proper fix is to not use autotools-brokensep in the
recipe in the first place.

You are right.
The recipe is cyrus-sasl and the newly updated version has fixed to use
autotools instead of autotools-brokensep.

Quoted 4 lines

To summarize, ideally we should have no recipe inheriting autotools-brokensep. But in reality, it's almost not possible. I sent out this patch because I thought it would be helpful for such recipes.

I seem to remember trying distclean when we first implemented this code. A lot of tarballs have generated files in them which distclean will remove but we lack the code/dependencies to regenerate them. "clean" was something we could get to work, "distclean" led to a lot of build failures.

If we were to consider doing this it would need a lot of testing.

Cheers,

Richard