Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Changing policy about -Werror
Date: Sun, 09 Sep 2018 16:11:53
Message-Id: 1536509500.863.0.camel@gentoo.org
In Reply to: Re: [gentoo-dev] Changing policy about -Werror by Richard Yao
1 On Sun, 2018-09-09 at 11:22 -0400, Richard Yao wrote:
2 > > On Sep 9, 2018, at 7:32 AM, Andrew Savchenko <bircoph@g.o> wrote:
3 > >
4 > > Hi!
5 > >
6 > > Our current -Werror policy demands unconditional removal:
7 > > https://devmanual.gentoo.org/ebuild-writing/common-mistakes/index.html#-werror-compiler-flag-not-removed
8 > >
9 > > I think this is wrong, see bugs 665464, 665538 for a recent
10 > > discussion why.
11 > >
12 > > My point is that in *most* cases -Werror indeed should be removed,
13 > > because upstream rarely can keep up with all possible configure,
14 > > *FLAGS, compiler versions and arch combinations. But! In some cases
15 > > — especially for security oriented software — this flag may be
16 > > pertain and may be kept at maintainer's discretion.
17 > >
18 > > The rationale is that -Werror usually points to dangerous
19 > > situations like uninitialized variables, pointer type mismatch or
20 > > implicit function declaration (and much more) which may lead to
21 > > serious security implications.
22 > >
23 > > So, if maintainer has enough manpower to support this flag, we
24 > > should allow to keep it. Of course if it will cause long-standing
25 > > troubles (e.g. bugs opened for a long time) QA should have power to
26 > > remove it or demand its removal.
27 > >
28 > > So my proposal is:
29 > >
30 > > 1) Deprecate QA policy with unconditional demand of -Werror removal.
31 > > 2) Add to devmanual's chapter on -Werror an exception clause about
32 > > security-oriented software and maintainer's right to make final
33 > > decision.
34 >
35 > -Werror has caught bugs that could have resulted in data loss in ZFS in the past thanks to it being built in userspace as part of zdb. So it is useful for integrity too, not just security (although arguably, integrity is part of security).
36 >
37 > Currently, sys-fs/zfs turns on -Werror when USE=debug is set. So far, nobody has complained about USE=debug enforcing -Werror. USE=debug by definition ought to be an exception.
38
39 Now that you know that you're violating a policy, please kindly fix
40 that.
41
42 > Perhaps we could have another USE flag for -Werror where it is a security feature. e.g. USE=strict-compile-checks
43
44 Perhaps people could learn that Gentoo lets them alter CFLAGS, and stop
45 inventing USE flags for every flag the compiler supports.
46
47 > >
48 > > Best regards,
49 > > Andrew Savchenko
50 >
51 >
52
53 --
54 Best regards,
55 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] Changing policy about -Werror Richard Yao <ryao@g.o>
Re: [gentoo-dev] Changing policy about -Werror Richard Yao <ryao@g.o>