FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 05-16-2011, 11:31 PM
Wouter Verhelst
 
Default Using -Werror in CFLAGS for a debian package build

Hi -devel,

I was working on nbd-server upstream, and so had ran ./configure with
CFLAGS='-Wall -Werror', which I consider good practice when writing C
code.

What I didn't notice immediately was that gcc was emitting some
warnings, but that the -Werror option was not honored for those
warnings. Investigating turned up #615157 (Cc'd): the gcc maintainers
have decided to disable -Werror for some new warnings, because otherwise
it would cause FTBFS bugs in packages that have -Werror set in their
debian/rules file.

IMHO, this is the wrong way to handle such things.

First and foremost, I do not believe that setting -Werror in a
debian/rules file is the best way to maintain a package; -Werror is a
development option which should not be used in a release build (which a
Debian package is). When a package sets -Werror in its debian/rules
file, it *will* FTBFS when the default compiler is changed, while not
necessarily breaking the package itself. I don't think it adds value.

That's a personal opinion, however, and we don't have a policy on this;
so if a maintainer is willing to deal with the fallout of their packages
failing to build when the default compiler is changed, that should
probably be their problem. So long as they are ready to receive FTBFS
bugs and fix them in a timely manner, oh well. It might still be an
annoyance for a user who wants to build a package on a different
compiler than what happens to be the default one, but it's not a fatal
problem. And I can see how using -Werror *might* increase the quality of
a package; some warnings are emitted on only some architectures, so
having -Werror *could* ensure that architecture-specific bugs are
eliminated before they potentially become a problem. It's not totally
silly, but it still seems a bit excessive.

At any rate, all that is undermined if gcc does not turn all warnings
into errors; if a maintainer uses -Werror in a package, that means they
*want* their package to FTBFS on warnings. Reducing the effect of
-Werror would not seem to help these maintainers; presumably they want
the warnings to be fixed in their source anyway, because eventually this
breakage of -Werror will be reverted, and then their packages will FTBFS
again. And while it's a very bad idea to introduce RC bugs in your
reverse dependencies when we're near or in a freeze, I was under the
impression that we're not currently in such a time, which would suggest
that doing so would be acceptable currently.

Additionally, reducing the effect of -Werror in that manner has an
effect on those who use Debian sid as a development environment; put
otherwise, the Debian default compiler is used for more than just Debian
packages, and I don't think we should be mucking with it in this manner.

Thoughts?

--
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a
 
Old 05-17-2011, 12:04 AM
Russ Allbery
 
Default Using -Werror in CFLAGS for a debian package build

Wouter Verhelst <wouter@debian.org> writes:

> What I didn't notice immediately was that gcc was emitting some
> warnings, but that the -Werror option was not honored for those
> warnings. Investigating turned up #615157 (Cc'd): the gcc maintainers
> have decided to disable -Werror for some new warnings, because otherwise
> it would cause FTBFS bugs in packages that have -Werror set in their
> debian/rules file.

> IMHO, this is the wrong way to handle such things.

I was a bit dubious about it as well, for the reasons you state, but
please note that GCC 4.6 introduced a major new warning about set but
unused variables and, so far, every large or medium C code base that I
have has had at least once instance of that warning. And I'm usually
pretty picky about such things.

If -Werror had not been disabled for this warning, my guess is that nearly
every package using -Wall -Werror not previously tested with 4.6 would
FTBFS.

I don't like seeing us modify upstream compiler behavior in Debian this
way, but I can understand not wanting to introduce what could have easily
been hundreds of failures. (The problem, of course, is that those
failures are still latent, and unless we're going to keep this going
forward, we have cleanup to do so that we can go back to tracking GCC's
normal behavior.)

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87r57y9oqw.fsf@windlord.stanford.edu">http://lists.debian.org/87r57y9oqw.fsf@windlord.stanford.edu
 
Old 05-17-2011, 12:23 AM
Sune Vuorela
 
Default Using -Werror in CFLAGS for a debian package build

On 2011-05-17, Russ Allbery <rra@debian.org> wrote:
> I don't like seeing us modify upstream compiler behavior in Debian this
> way, but I can understand not wanting to introduce what could have easily
> been hundreds of failures. (The problem, of course, is that those
> failures are still latent, and unless we're going to keep this going
> forward, we have cleanup to do so that we can go back to tracking GCC's
> normal behavior.)

I have seen several bug reports from the gcc maintainer saying

| This package builds with -Werror, and GCC 4.6 triggers new warnings
| which will make the package fail to build. Currently a Debian patch
| just passes
| -Wno-error=unused-but-set-variable and
| -Wno-error=unused-but-set-parameter
| to avoid build failures, but this patch will be reverted with the
| GCC 4.6.1 release, and the severity of the report will be raised.

Which I_think is a good compromise, and a case where I really think the
gcc maintainer is doing good a communicating.

/Sune


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnit3fv7.p7v.nospam@sshway.ssh.pusling.com">http ://lists.debian.org/slrnit3fv7.p7v.nospam@sshway.ssh.pusling.com
 
Old 05-17-2011, 12:28 AM
Wouter Verhelst
 
Default Using -Werror in CFLAGS for a debian package build

On Mon, May 16, 2011 at 05:04:07PM -0700, Russ Allbery wrote:
> Wouter Verhelst <wouter@debian.org> writes:
>
> > What I didn't notice immediately was that gcc was emitting some
> > warnings, but that the -Werror option was not honored for those
> > warnings. Investigating turned up #615157 (Cc'd): the gcc maintainers
> > have decided to disable -Werror for some new warnings, because otherwise
> > it would cause FTBFS bugs in packages that have -Werror set in their
> > debian/rules file.
>
> > IMHO, this is the wrong way to handle such things.
>
> I was a bit dubious about it as well, for the reasons you state, but
> please note that GCC 4.6 introduced a major new warning about set but
> unused variables and, so far, every large or medium C code base that I
> have has had at least once instance of that warning. And I'm usually
> pretty picky about such things.

Indeed; my own code runs into it as well. This is precisely why I'm
unhappy about it; when I write code, I want the compiler to complain,
loudly, when I do something dubious. When I build packages, I don't;
instead, I then want the compiler to just compile. The difference should
be in the CFLAGS that I pass it along, not in its defaults.

> If -Werror had not been disabled for this warning, my guess is that nearly
> every package using -Wall -Werror not previously tested with 4.6 would
> FTBFS.

Yes, and I think we should allow that to happen. If a maintainer chooses
to let their package fail because a new compiler version introduces new
warnings, then we should not be second-guessing their reasons like this.

I don't think it's smart for maintainers to use -Werror in their
packages; but if they, after having informed themselves, choose to so
anyway, then disabling warnings 'because it will make packages fail' is
counter-productive.

It's not like -Werror is the default.

> I don't like seeing us modify upstream compiler behavior in Debian this
> way, but I can understand not wanting to introduce what could have easily
> been hundreds of failures. (The problem, of course, is that those
> failures are still latent, and unless we're going to keep this going
> forward, we have cleanup to do so that we can go back to tracking
> GCC's normal behavior.)

I'm not saying I don't understand the rationale; I do. But I don't agree
with it; I don't think it's the right thing to do.

--
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a
 
Old 05-17-2011, 12:00 PM
Charles Plessy
 
Default Using -Werror in CFLAGS for a debian package build

Le Tue, May 17, 2011 at 01:31:14AM +0200, Wouter Verhelst a écrit :
>
> What I didn't notice immediately was that gcc was emitting some
> warnings, but that the -Werror option was not honored for those
> warnings. Investigating turned up #615157 (Cc'd): the gcc maintainers
> have decided to disable -Werror for some new warnings, because otherwise
> it would cause FTBFS bugs in packages that have -Werror set in their
> debian/rules file.

Dear Wouter and Matthias, and everybody,

while I do not question the choice made for GCC 4.6, I also note that after
forwarding a disabled FTBFS bug upstream, I had within a day an answer that he
could not reproduce the failure in an up-to-date Sid virtual machine. Of
course he may have read the explanations more carefully, but he has a point:
even after fixing the error that stopped the build, it is not straightforward
to make sure that the successful build will still be successful after the GCC
patch is reverted.

Is there an easy way we can suggest to our upstreams to re-enable the errors ?
That may be useful for them to update their code.

Have a nice day,

--
Charles Plessy
Debian Med packaging team,
http://www.debian.org/devel/debian-med
Tsurumi, Kanagawa, Japan


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110517120050.GE31559@merveille.plessy.net">http://lists.debian.org/20110517120050.GE31559@merveille.plessy.net
 
Old 05-20-2011, 09:03 AM
Didier Raboud
 
Default Using -Werror in CFLAGS for a debian package build

Wouter Verhelst wrote:

> I was working on nbd-server upstream, and so had ran ./configure with
> CFLAGS='-Wall -Werror', which I consider good practice when writing C
> code.
>
> What I didn't notice immediately was that gcc was emitting some
> warnings, but that the -Werror option was not honored for those
> warnings. Investigating turned up #615157 (Cc'd): the gcc maintainers
> have decided to disable -Werror for some new warnings, because otherwise
> it would cause FTBFS bugs in packages that have -Werror set in their
> debian/rules file.

Wouldn't it be possible to use the dpkg-buildflags framework for this? As
far as I understand it, this framework sets the gcc options used to build
Debian packages. Using it would allow to have an upstream-like gcc for the
whole system, and Debian-specific options when building packages.

(It would also have the side-effect of making sure all packages actually
work fine when dpkg-buildflags sets something different as usually
expected.)

Opinions ?


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: ir5apo$kdd$1@dough.gmane.org">http://lists.debian.org/ir5apo$kdd$1@dough.gmane.org
 
Old 05-20-2011, 05:15 PM
Goswin von Brederlow
 
Default Using -Werror in CFLAGS for a debian package build

Didier Raboud <odyx@debian.org> writes:

> Wouter Verhelst wrote:
>
>> I was working on nbd-server upstream, and so had ran ./configure with
>> CFLAGS='-Wall -Werror', which I consider good practice when writing C
>> code.
>>
>> What I didn't notice immediately was that gcc was emitting some
>> warnings, but that the -Werror option was not honored for those
>> warnings. Investigating turned up #615157 (Cc'd): the gcc maintainers
>> have decided to disable -Werror for some new warnings, because otherwise
>> it would cause FTBFS bugs in packages that have -Werror set in their
>> debian/rules file.
>
> Wouldn't it be possible to use the dpkg-buildflags framework for this? As
> far as I understand it, this framework sets the gcc options used to build
> Debian packages. Using it would allow to have an upstream-like gcc for the
> whole system, and Debian-specific options when building packages.
>
> (It would also have the side-effect of making sure all packages actually
> work fine when dpkg-buildflags sets something different as usually
> expected.)
>
> Opinions ?

You would want to only have -Werror for your own packages, not for every
package you compile. dpkg-buildflags doesn't know what package you are
trying to build when it gets asked for the right flags to use.

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87aaehuwcu.fsf@frosties.localnet">http://lists.debian.org/87aaehuwcu.fsf@frosties.localnet
 
Old 05-20-2011, 08:53 PM
Enrico Weigelt
 
Default Using -Werror in CFLAGS for a debian package build

* Russ Allbery <rra@debian.org> schrieb:

> If -Werror had not been disabled for this warning, my guess is that nearly
> every package using -Wall -Werror not previously tested with 4.6 would
> FTBFS.

I, personally, consider all of those warnings bugs. Well, unused
variables aren't problems per se, but often can give good hints where
there *might* be some bug. So, IMHO, maintainers should always enable
them for testing and try to fix the problems.


cu
--
----------------------------------------------------------------------
Enrico Weigelt, metux IT service -- http://www.metux.de/

phone: +49 36207 519931 email: weigelt@metux.de
mobile: +49 151 27565287 icq: 210169427 skype: nekrad666
----------------------------------------------------------------------
Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110520205351.GC14996@nibiru.local">http://lists.debian.org/20110520205351.GC14996@nibiru.local
 
Old 05-22-2011, 04:06 PM
peter green
 
Default Using -Werror in CFLAGS for a debian package build

(note: this message quotes from multiple mails by different people)

Wouter>First and foremost, I do not believe that setting -Werror in a
Wouter>debian/rules file is the best way to maintain a package; -Werror is a
Wouter>development option which should not be used in a release build (which a
Wouter>Debian package is). When a package sets -Werror in its debian/rules
Wouter>file, it *will* FTBFS when the default compiler is changed, while not
Wouter>necessarily breaking the package itself. I don't think it adds value.
The thing is that there are some warnings that really SHOULD be errors as
code that generates them is almost certainly wrong. Generally a build failure
is less serious than a subtuly broken package.

A package maintainer could try and identify such warnings individually
but I don't think many maintainers would be willing to go to that effort.


Maybe what is really needed is a -Werror=serious or similar option that
turns the worst warnings (stuff like converting a pointer to/from an
integer of the wrong size, incompatible implicit declarations and other
stuff that indicates something is SERIOUSLY wrong) into errors while

leaving minor warnings (things that really just indicate that the code
could do with a little cleanup) as warnings.

Russ>I was a bit dubious about it as well, for the reasons you state, but
Russ>please note that GCC 4.6 introduced a major new warning about set but
Russ>unused variables and, so far, every large or medium C code base that I
Russ>have has had at least once instance of that warning. And I'm usually
Russ>pretty picky about such things.
Russ>
Russ>If -Werror had not been disabled for this warning, my guess is that nearly
Russ>every package using -Wall -Werror not previously tested with 4.6 would
Russ>FTBFS.
Is this really THAT big a deal? Is it really worth making dubious changes
to build dependencies (gcc in this case but a similar saga is going on with
dash) to temporarlly hide (and therefore make harder to fix) FTBFS bugs that
are usually trivial to fix in the package that suffers from them (worst case
you can just change the cflags in this case or set CONFIG_SHELL in the
dash/configure case.


Yes it may mean some packages may need a sourceful nmu rather than a binnmu
to transition but is that really such a huge deal?


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4DD93475.8010900@p10link.net">http://lists.debian.org/4DD93475.8010900@p10link.net
 
Old 05-22-2011, 08:13 PM
Russ Allbery
 
Default Using -Werror in CFLAGS for a debian package build

peter green <plugwash@p10link.net> writes:

> Is this really THAT big a deal? Is it really worth making dubious
> changes to build dependencies (gcc in this case but a similar saga is
> going on with dash) to temporarlly hide (and therefore make harder to
> fix) FTBFS bugs that are usually trivial to fix in the package that
> suffers from them (worst case you can just change the cflags in this
> case or set CONFIG_SHELL in the dash/configure case.

I'm not sure.

My personal inclination for my own packages would be along the lines you
describe: just let them FTBFS and have people fix them. I wouldn't have
minded that for my own packages, although it would have given this
specific issue a bit more urgency than it felt like it deserved (but then
I don't use -Werror for exactly that reason).

But I'm also not on the release team, and I can imagine adding a couple
hundred new FTBFS problems in the middle of transitions could have really
ruined their week. It's problematic enough right now that GCC 4.6 seems
to be struggling on armel; I have two packages that currently can't build
due to internal compiler errors in armel.

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87y61ycx43.fsf@windlord.stanford.edu">http://lists.debian.org/87y61ycx43.fsf@windlord.stanford.edu
 

Thread Tools




All times are GMT. The time now is 06:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org