Bug 11342

Summary: implement "treat warnings as error" option
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Juro Bystricky <juro.bystricky>
Component: coreAssignee: Unassigned <unassigned>
Status: RESOLVED OBSOLETE QA Contact:
Severity: enhancement    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod, sgw
Version: 2.3   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Juro Bystricky 2017-04-12 16:15:53 UTC
A build can generate a warning. The warnings are not fatal. In many (possibly all) cases a repeated build will not generate the warning again, as the task results/artifacts may be cached and the task does not need rebuilding. This way many warnings end up in effect ignored/invisible until a next "clean" build.
One way to prevent this would be have an option to treat warnings as errors.
Better way (but probably easier said than done) would be to ensure that tasks that generate warnings are repeated on the next build again and thus generate the same warnings again.
Comment 1 Ross Burton 2017-04-13 13:40:21 UTC
The latter would be very hard...

Fatal warnings as a bitbake option shouldn't be too difficult though.
Comment 2 Juro Bystricky 2017-09-02 00:23:26 UTC
(In reply to comment #1)
> The latter would be very hard...
> 
> Fatal warnings as a bitbake option shouldn't be too difficult though.

Ideally, if there is a warning, this should prevent writing of the corresponding build artefacts to the sstate. This way no new bitbake options are required and we should see the warning each time we repeat the build. Again, probably easier said than done.
Comment 3 Randy MacLeod 2020-05-21 08:22:52 UTC
We have over the past 2 years, migrated many warnings to errors now so this issue has been addressed to some degree.