Closed
Bug 1309505
Opened 9 years ago
Closed 9 years ago
Add -Werror to gyp builds
Categories
(NSS :: Build, defect)
NSS
Build
Tracking
(Not tracked)
RESOLVED
FIXED
3.28
People
(Reporter: franziskus, Unassigned)
References
Details
Attachments
(1 file)
|
2.44 KB,
patch
|
Details | Diff | Splinter Review |
All warnings must be errors in gyp builds as well.
| Reporter | ||
Comment 1•9 years ago
|
||
Ted, can you point us into the right direction here? Or are you taking this on?
Flags: needinfo?(ted)
Comment 2•9 years ago
|
||
I am not likely to get to this right away. If you'd like to try fixing it, you probably want to do something like:
1) Add an "enable_werror" variable in the variables section of config.gypi: https://hg.mozilla.org/projects/nss/file/tip/coreconf/config.gypi#l84 It looks like this defaults to on on everything but Android right now? If that's the case you might need to put a condition in the previous section to set it per-platform: https://hg.mozilla.org/projects/nss/file/tip/coreconf/config.gypi#l20 and then copy it out to the higher scope like 'enable_werror%': '<(enable_werror)',
2) For each platform you will need to add a condition somewhere on '<(enable_werror)==1' to set the appropriate flags. Linux could go here:
https://hg.mozilla.org/projects/nss/file/tip/coreconf/config.gypi#l240
OS X could go here:
https://hg.mozilla.org/projects/nss/file/tip/coreconf/config.gypi#l217 (and it looks like I left a note as to what is needed, something like https://dxr.mozilla.org/mozilla-beta/source/media/webrtc/trunk/build/common.gypi#1881 )
Windows could go here:
https://hg.mozilla.org/projects/nss/file/tip/coreconf/config.gypi#l204
and it would use something like this:
https://github.com/springmeyer/gyp/blob/master/test/win/compiler-flags/warning-level.gyp#L14
Flags: needinfo?(ted)
| Reporter | ||
Comment 3•9 years ago
|
||
So this works for c files on Linux (and I guess mac).
I don't think we need an extra variable as we want Werror always enabled when possible (so only doing an exception for Android for now).
What I noticed is that ninja doesn't seem to pick up changes in the external_tests directory and doesn't pass on cflags_cc to the cpp code in there. I don't see anything in the gyp files that would explain this.
Attachment #8802014 -
Flags: review?(ted)
| Reporter | ||
Comment 4•9 years ago
|
||
Comment on attachment 8802014 [details] [diff] [review]
gyp-werror.patch
Review of attachment 8802014 [details] [diff] [review]:
-----------------------------------------------------------------
::: coreconf/config.gypi
@@ +263,5 @@
> 'ANDROID',
> ],
> }],
> [ 'OS=="mac"', {
> + 'cflags': [
Looking at your comment again I guess this isn't working. I'll have to test on a mac.
| Reporter | ||
Comment 5•9 years ago
|
||
Comment on attachment 8802014 [details] [diff] [review]
gyp-werror.patch
Review of attachment 8802014 [details] [diff] [review]:
-----------------------------------------------------------------
The cpp problems came from missing files in the ssl_gtest.gyp. Let me have another look at this.
Attachment #8802014 -
Flags: review?(ted)
Comment 6•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.28
Comment 7•9 years ago
|
||
Recursive make was screwing up:
https://hg.mozilla.org/projects/nss/rev/cbeabbf0fb44ae6341996a91d51d20ccf53b5ff0
You need to log in
before you can comment on or make changes to this bug.
Description
•