1 |
> On Sep 9, 2018, at 12:11 PM, Michał Górny <mgorny@g.o> wrote: |
2 |
> |
3 |
> On Sun, 2018-09-09 at 11:22 -0400, Richard Yao wrote: |
4 |
>>> On Sep 9, 2018, at 7:32 AM, Andrew Savchenko <bircoph@g.o> wrote: |
5 |
>>> |
6 |
>>> Hi! |
7 |
>>> |
8 |
>>> Our current -Werror policy demands unconditional removal: |
9 |
>>> https://devmanual.gentoo.org/ebuild-writing/common-mistakes/index.html#-werror-compiler-flag-not-removed |
10 |
>>> |
11 |
>>> I think this is wrong, see bugs 665464, 665538 for a recent |
12 |
>>> discussion why. |
13 |
>>> |
14 |
>>> My point is that in *most* cases -Werror indeed should be removed, |
15 |
>>> because upstream rarely can keep up with all possible configure, |
16 |
>>> *FLAGS, compiler versions and arch combinations. But! In some cases |
17 |
>>> — especially for security oriented software — this flag may be |
18 |
>>> pertain and may be kept at maintainer's discretion. |
19 |
>>> |
20 |
>>> The rationale is that -Werror usually points to dangerous |
21 |
>>> situations like uninitialized variables, pointer type mismatch or |
22 |
>>> implicit function declaration (and much more) which may lead to |
23 |
>>> serious security implications. |
24 |
>>> |
25 |
>>> So, if maintainer has enough manpower to support this flag, we |
26 |
>>> should allow to keep it. Of course if it will cause long-standing |
27 |
>>> troubles (e.g. bugs opened for a long time) QA should have power to |
28 |
>>> remove it or demand its removal. |
29 |
>>> |
30 |
>>> So my proposal is: |
31 |
>>> |
32 |
>>> 1) Deprecate QA policy with unconditional demand of -Werror removal. |
33 |
>>> 2) Add to devmanual's chapter on -Werror an exception clause about |
34 |
>>> security-oriented software and maintainer's right to make final |
35 |
>>> decision. |
36 |
>> |
37 |
>> -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). |
38 |
>> |
39 |
>> 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. |
40 |
> |
41 |
> Now that you know that you're violating a policy, please kindly fix |
42 |
> that. |
43 |
> |
44 |
>> Perhaps we could have another USE flag for -Werror where it is a security feature. e.g. USE=strict-compile-checks |
45 |
> |
46 |
> Perhaps people could learn that Gentoo lets them alter CFLAGS, and stop |
47 |
> inventing USE flags for every flag the compiler supports. |
48 |
|
49 |
Do that and watch nearly everything break. If a package really ought to have -Werror due to a very good reason and is properly maintained to support it, then there is nothing wrong with inventing a USE flag to give users the option of enforcing that. It is better than letting users discover that via random trial and error. That just wastes people’s time. |
50 |
> |
51 |
>>> |
52 |
>>> Best regards, |
53 |
>>> Andrew Savchenko |
54 |
>> |
55 |
>> |
56 |
> |
57 |
> -- |
58 |
> Best regards, |
59 |
> Michał Górny |