Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 106513 - emerge fails with "CFLAGS changed" due to extra spaces being removed
Summary: emerge fails with "CFLAGS changed" due to extra spaces being removed
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 125730 130506 132130 135174 142541 144289 150041 162290 167178 172599 174058 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-19 05:24 UTC by Ben XO
Modified: 2007-06-09 12:40 UTC (History)
14 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben XO 2005-09-19 05:24:25 UTC
Various applications fail with "CFLAGS changed" when the make.conf has more than
one adjacent space in the CFLAGS. This is because something, somewhere is
tokenising the CFLAGS and then recombining them, and a literal comparison
between the old and the new one fails, thus:

configure: error: `CFLAGS' has changed since the previous run:
configure:   former value:  -O3 -march=pentium4 -fomit-frame-pointer  -pipe
configure:   current value: -O3 -march=pentium4 -fomit-frame-pointer -pipe
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm

examples include:
http://bugs.gentoo.org/show_bug.cgi?id=92645
http://bugs.gentoo.org/show_bug.cgi?id=105442
http://bugs.gentoo.org/show_bug.cgi?id=106447

CFLAGS stripped of extra spaces are semantically identical, it's easy to see why
people are encountering this bug. The correct workaround (sanctioned by gentoo
dev) appears to be to sanitize your make.conf CFLAGS. This is certainly the
easiest solution all round.

*However, there's no mention that this could be a problem in either the default
make.conf, or any of the installation guides.*

So, this is a request that something be mentioned, somewhere appropriate.

Alternative solutions are reporting this issue upstream everywhere that it
occurs; or changing portage so that it doesn't trigger this issue.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-09-19 05:37:25 UTC
Can we add one line to make.conf.example? 
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-09-19 05:47:47 UTC
Another possibility would be for portage itself to sanitize spaces when 
reading files. It's done already for the cascaded variables and I can't think 
of any case where spaces should be important within portage config files. 
Anybody see a reason to not do this? 
Comment 3 Marius Mauch (RETIRED) gentoo-dev 2005-09-19 09:11:04 UTC
Was about to suggest that.
Comment 4 Triffid Hunter 2005-09-26 01:20:10 UTC
another vote for comment #2.. it will automagically fix this, while allowing 
make.conf to remain readable with larger cflags sets and/or smaller terminals.

export CFLAGS="`echo $CFLAGS`" or equivalent somewhere after sourcing make.conf 
would be ideal.
Comment 5 SpanKY gentoo-dev 2006-03-11 01:01:12 UTC
*** Bug 125730 has been marked as a duplicate of this bug. ***
Comment 6 Ben XO 2006-04-14 03:18:59 UTC
Has this been fixed yet? Solution looks like it was found 6 months ago, but it's possible that the bug title is now misleading.

IIRC (it was a while ago!) the bug title is as it is because when I tried to report this as an apache ebuild bug, I was told that it was a documentation issue with an obvious workaround. It does have an obvious workaround; but it's not necessarily a documentation issue, as you can see from the comments.

For example, this bug is triggered by anyone who has a large CFLAGS setting in make.conf which has been spaced for readability.

So, i've changed the Summary from

  emerge fails with "CFLAGS changed", documentation required in make.conf docs

to

  emerge fails with "CFLAGS changed" due to extra spaces being removed

I hope this is ok.
Comment 7 Ben XO 2006-04-14 03:20:12 UTC
...or I would have changed it if bugzilla allowed that sort of thing ;)
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2006-04-19 14:15:00 UTC
*** Bug 130506 has been marked as a duplicate of this bug. ***
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2006-05-03 07:46:53 UTC
*** Bug 132130 has been marked as a duplicate of this bug. ***
Comment 10 Josh G 2006-06-01 09:15:20 UTC
*** Bug 135174 has been marked as a duplicate of this bug. ***
Comment 11 Ben XO 2006-07-04 02:46:51 UTC
--- naim-0.11.7.2.ebuild        2005-09-03 20:35:49.000000000 +0100
+++ naim-0.11.7.2-r1.ebuild     2006-07-04 10:44:31.000000000 +0100
@@ -26,7 +26,7 @@
                --enable-detach \
                ${myconf} \
                || die "configure failed"
-       emake || die "make failed"
+       emake -j1 || die "make failed"
 }

 src_install() {
Comment 12 Ben XO 2006-07-04 02:48:48 UTC
(In reply to comment #11)
> --- naim-0.11.7.2.ebuild        2005-09-03 20:35:49.000000000 +0100
> +++ naim-0.11.7.2-r1.ebuild     2006-07-04 10:44:31.000000000 +0100
> @@ -26,7 +26,7 @@
>                 --enable-detach \
>                 ${myconf} \
>                 || die "configure failed"
> -       emake || die "make failed"
> +       emake -j1 || die "make failed"
>  }
> 
>  src_install() {
> 

er excuse me. please delete this comment and the one quoted, it was intended to go with a different bug. so sorry!
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2006-08-02 08:11:17 UTC
*** Bug 142541 has been marked as a duplicate of this bug. ***
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2006-08-18 02:11:16 UTC
*** Bug 144289 has been marked as a duplicate of this bug. ***
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2006-10-04 03:42:43 UTC
*** Bug 150041 has been marked as a duplicate of this bug. ***
Comment 16 Zac Medico gentoo-dev 2006-10-18 21:45:23 UTC
(In reply to comment #2)
> Another possibility would be for portage itself to sanitize spaces when 
> reading files. It's done already for the cascaded variables and I can't think 
> of any case where spaces should be important within portage config files. 
> Anybody see a reason to not do this? 

I don't think it's a good idea for use to implement a *global* policy like this of collapsing whitespace in variables just because these configure scripts aren't very robust in their checks.  We'd be committing ourselves to a global policy just to hack around somebody else's bug.  I don't want a special case hack on CFLAGS for somebody else's bug either.

Anyway, does anybody actually know what is collapsing the whitespace in these cases?  If portage is collapsing the whitespace somewhere it shouldn't, then I think we should fix that.  However, my tests show that the extra whitespace is preserved in ${T}/environment like one would expect.
Comment 17 Ben XO 2006-10-19 01:50:16 UTC
I'm concerned that this bug has been closed as "WONTFIX" when all of the bugs which report individual ebuilds as exhibiting this behaviour have also been resolved as DUPLICATE of this bug or as WONTFIX. Shifting the blame about indefinitely obviously isn't the way to go.

My point of view on "hacking around somebody else's bugs" is that we already do this extensively by patching ebuilds, so i don't think an idea can be justifiably dismissed on these grounds alone.

If, instead, your reasoning is that we shouldn't do something for every single ebuild just because a significant handful need it, then we should start patching ebuilds and not resolving bugs as duplicate of this one, and reopen a bunch of bugs.

I don't know portage's ebuild helper structure too well, but perhaps providing a utility class or something to do this when necessary in an ebuild is the way forward.

This next bit is purely opinion, but I believe that the idea of the portage system is to make porting and compiling packages as easy as possible for both the end user and the package maintainer. As the package maintainer is rarely the software author, i believe it makes sense to provide as many tools and easy solutions for working around common bugs as possible.
Comment 18 Zac Medico gentoo-dev 2006-10-19 04:06:22 UTC
(In reply to comment #17)
> I'm concerned that this bug has been closed as "WONTFIX" when all of the bugs
> which report individual ebuilds as exhibiting this behaviour have also been
> resolved as DUPLICATE of this bug or as WONTFIX. Shifting the blame about
> indefinitely obviously isn't the way to go.

I'd say that a global policy to hide upstream bugs is obviously not the way to go.

> My point of view on "hacking around somebody else's bugs" is that we already do
> this extensively by patching ebuilds, so i don't think an idea can be
> justifiably dismissed on these grounds alone.

Those patches should be sent upstream whenever possible.

> If, instead, your reasoning is that we shouldn't do something for every single
> ebuild just because a significant handful need it, then we should start
> patching ebuilds and not resolving bugs as duplicate of this one, and reopen a
> bunch of bugs.

Patching ebuild and/or sending the patches upstream...

> I don't know portage's ebuild helper structure too well, but perhaps providing
> a utility class or something to do this when necessary in an ebuild is the way
> forward.

Perhaps function in flag-o-matic.eclass could do this.

> This next bit is purely opinion, but I believe that the idea of the portage
> system is to make porting and compiling packages as easy as possible for both
> the end user and the package maintainer. As the package maintainer is rarely
> the software author, i believe it makes sense to provide as many tools and easy
> solutions for working around common bugs as possible.

If there's no way to fix this upstream, then a function in flag-o-matic.eclass or something like that is probably the way to go.
Comment 19 Jakub Moc (RETIRED) gentoo-dev 2007-01-15 21:46:10 UTC
*** Bug 162290 has been marked as a duplicate of this bug. ***
Comment 20 Jakub Moc (RETIRED) gentoo-dev 2007-02-16 10:36:53 UTC
*** Bug 167178 has been marked as a duplicate of this bug. ***
Comment 21 Jakub Moc (RETIRED) gentoo-dev 2007-03-28 21:25:43 UTC
*** Bug 172599 has been marked as a duplicate of this bug. ***
Comment 22 Jakub Moc (RETIRED) gentoo-dev 2007-04-10 17:41:30 UTC
*** Bug 174058 has been marked as a duplicate of this bug. ***
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2007-06-09 11:23:19 UTC
*** Bug 181404 has been marked as a duplicate of this bug. ***
Comment 24 Harald van Dijk (RETIRED) gentoo-dev 2007-06-09 12:40:04 UTC
(In reply to comment #16)
> Anyway, does anybody actually know what is collapsing the whitespace in these
> cases?

autoconf was, and has since been fixed with <http://cvs.savannah.gnu.org/viewvc/autoconf/lib/autoconf/status.m4?root=autoconf&r1=1.98&r2=1.99>

If this problem happens with any package now, all that needs to be done is regenerating the configure script.