1 |
On 09/14/2018 12:40 PM, Alon Bar-Lev wrote: |
2 |
> On Fri, Sep 14, 2018 at 12:34 AM Sergei Trofimovich <slyfox@g.o> wrote: |
3 |
>> |
4 |
>> On Tue, 11 Sep 2018 12:44:38 +0300 |
5 |
>> Alon Bar-Lev <alonbl@g.o> wrote: |
6 |
>> |
7 |
>> I'm personally in favour of not allowing -Werror |
8 |
>> to be in build system unconditionally. |
9 |
>> |
10 |
>> Maintainer is free to implement --enable-werror any way |
11 |
>> it's convenient to run on their own extended sanity checks |
12 |
>> and optionally expose it to users. Be it USE flag or |
13 |
>> EXTRA_ECONF option. |
14 |
> |
15 |
> This discussion is not for downstream to have a more strict policy |
16 |
> than upstream. People try to hijack discussion and introduce noise to |
17 |
> de-focus the discussion. |
18 |
> |
19 |
> Downstream policy cannot be more strict than upstream as then every |
20 |
> change upstream is doing downstream need to rebase and invest in even |
21 |
> more changes. |
22 |
> |
23 |
> This discussion is to follow upstream strict policy if upstream proves |
24 |
> that it stands behind it and downstream is willing to follow. |
25 |
I don't think we should do that unless we provide a USE flag for users |
26 |
to opt into the behavior. Forcing it on users is problematic for the |
27 |
reasons others stated. However, letting them opt into the behavior is |
28 |
reasonable. |
29 |
|
30 |
In the case of sys-fs/zfs, enabling -Werror (which includes -Wall) on |
31 |
USE=debug is following upstream's wishes to build debug builds with -Werror. |
32 |
> |
33 |
> For your question: No. Downstream should not add -Werror to upstream |
34 |
> package, not in a parameter or USE flag, as this will probably break |
35 |
> and cause a queue of downstream patches. |
36 |
> |
37 |
>>> I would like to suggest a modify our policy with the following |
38 |
>>> exception clause: Package maintainer may decide to keep upstream |
39 |
>>> -Werror as long as he is willing to resolve all issues resulting from |
40 |
>>> -Werror as if it was a blocker bug. |
41 |
>> |
42 |
>> Do you intend to keep -Werror for case when ebuild goes |
43 |
>> stable as well? |
44 |
> |
45 |
> Correct. |
46 |
> |
47 |
>> If you do it then what is your workflow to fix breakages |
48 |
>> appearing in stable packages caused by minor environment |
49 |
>> changes like toolchain tweaks? |
50 |
> |
51 |
> Correct. |
52 |
> |
53 |
>> Add another round of stabilization on each arch team? It |
54 |
>> sounds like your default assumption that code needs to be |
55 |
>> changed in a semantically significant way: add annotations |
56 |
>> that might not like some toolchains, remove unused code. |
57 |
> |
58 |
> No dependency of toolchain nor annotations. |
59 |
> A strict policy of no warnings will require changes as dependencies |
60 |
> including toolchain are progressing. |
61 |
> This creates an overhead for selected packages. |
62 |
> A maintainer and the non-stable team should be able to know the package status. |
63 |
> Preferably this may be done by automation, I appreciate the work of |
64 |
> Toralf Förster with tinderbox to automate check various cases. |
65 |
> When a new slot of toolchain is available, maintainers should check |
66 |
> their packages in any case, there are other issues and side affects |
67 |
> that we experienced, especially in C++ packages. |
68 |
> For these packages usually there are 3 for each slot: the current |
69 |
> stable, the next stable and the non-stable, so the overhead is |
70 |
> constrained. |
71 |
> |
72 |
>> Or patch package in-place without bumping? None of options |
73 |
>> sound optimal compared to dropping -Werror. |
74 |
> |
75 |
> Success of build is not the only concern although I see people here |
76 |
> that are interested only in that. |
77 |
> Patching upstream package and/or change upstream quality policy is |
78 |
> something that we should avoid as well to maintain upstream warranty. |
79 |
> |
80 |
>>> The package maintainer decision may be based on the package state and |
81 |
>>> the relationship with upstream, but basically, it is his decision as |
82 |
>>> long as issues are fixed in timely manner, it is his overhead after |
83 |
>>> all. |
84 |
>> |
85 |
>> I agree that maintainer's will and upstream's will should be |
86 |
>> respected and it's not something needs to be absolutely |
87 |
>> enforced all the time. |
88 |
>> |
89 |
>> Personally I disagree -Werror on end-user machine is worth |
90 |
>> it (or cppcheck, or coverity round-trip run is worth running |
91 |
>> on user's machine unconditionally). |
92 |
>> |
93 |
>> Unused variable is a good example of typical benign warning: |
94 |
>> it was there all the time, it's not a new bug and does not |
95 |
>> warrant need for an immediate fix. |
96 |
> |
97 |
> Unused variable is a good example of CRITICAL potential issue, the bug |
98 |
> that triggered this this discussion has a return code that was not |
99 |
> used. The permutation was not tested by upstream as it rarely used, it |
100 |
> was not tested by me either by the same reason, both is a mistake. |
101 |
> Fortunately, someone else tested this permutation and his build |
102 |
> failed, triggered a bug. If -Werror has not been used we would not |
103 |
> have known about this issue. In many cases these happen in |
104 |
> architecture that maintainer nor upstream have access to. In this |
105 |
> specific case I went over the code history to the time the return code |
106 |
> have been used and determined that this indeed should be ignored, |
107 |
> imagine the opposite. A patch was submitted to upstream to confirm |
108 |
> resolution as any issue in code, upstream confirmed and merged this in |
109 |
> timely fashion. Bottom line we all (Gentoo, upstream and any other |
110 |
> distribution) enjoy better quality. |
111 |
> |
112 |
>> Toolchain just happend to get better at control flow graph |
113 |
>> analysis. Fix can easily wait for next release and save |
114 |
>> everyone's time. |
115 |
> |
116 |
> Once again, the number of permutation of build and architecture may |
117 |
> reveal issues that are cannot be detected on maintainer machine. |
118 |
> If a fix is a real issue that is found in stable package, do you |
119 |
> suggest to wait for next release to save whose time? |
120 |
> |
121 |
>> Not every user is willing to create bugzilla account and figure |
122 |
>> the path of reporting the breakage. Especially if there are |
123 |
>> many breakages like that. Getting multiple various errors is |
124 |
>> probable if one imagines -Werror to be commonly allowed. |
125 |
>> This is user's overhead. Not just maintainer's. |
126 |
> |
127 |
> Most of these issues are detected early at process by unstable users |
128 |
> which are opening bugs. |
129 |
> |
130 |
> Once again I outlined the cases in which -Werror can be preserved, I |
131 |
> will repeat... (a) upstream has strict policy of no-warnings, (b) |
132 |
> upstream added -Werror, (c) downstream opinion is that upstream is |
133 |
> following the policy, (d) upstream is friendly, (e) downstream accepts |
134 |
> the potential maintenance overhead. |
135 |
> |
136 |
>> Gentoo does not normally run tests on user's systems either. |
137 |
>> Tests are arguably a lot more precise in pointing out real |
138 |
>> problems in software. |
139 |
> |
140 |
> Correct. I believe that this may be revisit as well, for selected |
141 |
> packages in which tests are stable run them on user machines. There is |
142 |
> no reason why we cannot add a directive to ebuild to enable tests by |
143 |
> default and let user to disable this to save CPU/time of build. |
144 |
> |
145 |
>>> ARGUMENT: If a package compiled in the past using toolchain X then it |
146 |
>>> must continue to do so with any future toolchain. |
147 |
>>> |
148 |
>>> I do not understand when "build" is the test for runtime |
149 |
>> |
150 |
>> The argument was about "keep compiling". Runtime |
151 |
>> behaviour is a separate issue and (in my opinion) is an |
152 |
>> orthogonal topic. |
153 |
>> |
154 |
>> On another note I occasionally like to build Gentoo with |
155 |
>> clang's -Weverything (or equivalent set of gcc CFLAGS) |
156 |
>> to get the idea if there is a good useful warning out there |
157 |
>> to put into -Werror= list. |
158 |
>> |
159 |
>> Explicit -Werror= list allows code not to regress. But even |
160 |
>> that is prone to harmless infelicities in libc headers that |
161 |
>> can't be easily fixed. |
162 |
>> |
163 |
>> In case of opensc it just does not compile even if I pass -Wno-error: |
164 |
>> $ CC=clang CFLAGS="-O2 -Weverything -Wno-error" emerge -v1 opensc |
165 |
>> |
166 |
>> I don't expect 'opensc' upstream to fix this use for me |
167 |
>> and don't see it worth reporting to bugzilla. |
168 |
>> |
169 |
>> But maybe I'm wrong? |
170 |
> |
171 |
> When downstream maintainer create healthy relationship with upstream, |
172 |
> and when mutual interest is to support clang then working together to |
173 |
> improve upstream support of clang instead doing that at downstream is |
174 |
> much better solution to the entire open source eco-system. |
175 |
> |
176 |
> Regards, |
177 |
> Alon |
178 |
> |