Page MenuHomeFreeBSD

build: provide a default WARNS for src builds
ClosedPublic

Authored by kevans on Sep 10 2020, 6:49 PM.
Tags
None
Referenced Files
F103033586: D26397.diff
Wed, Nov 20, 2:02 AM
Unknown Object (File)
Mon, Nov 18, 3:04 AM
Unknown Object (File)
Mon, Nov 18, 2:29 AM
Unknown Object (File)
Mon, Nov 18, 12:22 AM
Unknown Object (File)
Sun, Nov 17, 11:27 PM
Unknown Object (File)
Sun, Nov 17, 11:05 PM
Unknown Object (File)
Sun, Nov 17, 10:48 PM
Unknown Object (File)
Oct 7 2024, 2:13 PM

Details

Summary

The current default is provided in various Makefile.inc in some top-level directories and covers a good portion of the tree, but doesn't cover parts of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if it's defined. This lets us relatively cleanly provide a default WARNS no matter where you're building in the src tree without breaking things outside of the tree.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 33596

Event Timeline

Seems sensible. I guess it's good that most of the issues are in tests or GPL code we're deleting soon?

I'll probably need to watch out for this change when I merge to CheriBSD, but it seems easy to handle.

This revision is now accepted and ready to land.Sep 10 2020, 7:07 PM

Seems sensible. I guess it's good that most of the issues are in tests or GPL code we're deleting soon?

Indeed- all of ofed is a mess with this stuff, but that's contrib and there's a lot there that needs fixed. While I'm mentioning it, here's a list of the changes I've already flushed out this branch that were detected by this patch set:

I'll probably need to watch out for this change when I merge to CheriBSD, but it seems easy to handle.

The conflicts proper should really be trivial, you'll mainly need to watch out if your version of LLVM differs significantly in warning heuristics from what's currently in base or you've changed warning sets at different WARN levels.

Maybe, as inspiration, we should make a web-service which made the warnings at current and higher levels for the non-6 directories available, along with a X/T plot of how many there are ?

In D26397#587148, @phk wrote:

Maybe, as inspiration, we should make a web-service which made the warnings at current and higher levels for the non-6 directories available, along with a X/T plot of how many there are ?

What an excellent idea- I do believe it'd be trivial to strip -Werror and force WARNS to 6 for an entire build. I'll hack something together for this.

In D26397#587148, @phk wrote:

Maybe, as inspiration, we should make a web-service which made the warnings at current and higher levels for the non-6 directories available, along with a X/T plot of how many there are ?

What an excellent idea- I do believe it'd be trivial to strip -Werror and force WARNS to 6 for an entire build. I'll hack something together for this.

Jenkins has a nice graph view for compiler warnings with the warnings next plugin. Maybe we could add another job without Werror and max warnings and run that like once a week?

In D26397#587148, @phk wrote:

Maybe, as inspiration, we should make a web-service which made the warnings at current and higher levels for the non-6 directories available, along with a X/T plot of how many there are ?

What an excellent idea- I do believe it'd be trivial to strip -Werror and force WARNS to 6 for an entire build. I'll hack something together for this.

Jenkins has a nice graph view for compiler warnings with the warnings next plugin. Maybe we could add another job without Werror and max warnings and run that like once a week?

Oh, that would be perfect. I'll ping @lwhsu and see if we can get that on his list, though my understanding is that his backlog is unnecessarily long because he's constantly hunting down peoples' problems. =(

I did commit rS365631 in the interim to help support this idea, so that in an ideal world we can do this purely with environment manipulations rather than having to apply a patch for it -- which is good whether we get it into the Jenkins workflow at some point or whether I hack something together in the interim.

I think I'm going to go ahead and commit this in the coming days -- FWIW, I hacked together a reallllly primitive interface for browsing warnings by crude 'path' (based solely on output, so not perfect) : https://warns.kevans.dev/ -- this should work in the interim until we can get something in CI proper. I'll hack together some pretty graphs from it when it gets a couple more builds under its belt.

emaste added inline comments.
contrib/libarchive/test_utils/test_main.c
478 ↗(On Diff #76896)

This file is the only code change left? IMO submit this upstream and commit this change separately, in advance of the rest.

contrib/libarchive/test_utils/test_main.c
478 ↗(On Diff #76896)

This is actually needing rebased -- I landed that upstream, pulled it through vendor and committed as rS365637. I've since discovered some other warnings in libarchive, but they're masked by the build stuff for all those having already papered over it with WARNS.

This revision now requires review to proceed.Sep 16 2020, 5:15 PM
This revision is now accepted and ready to land.Sep 18 2020, 5:20 PM