summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-01-23 17:16:11 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-02 09:30:18 -0500
commit3bb3d224c597aa6679af4c115d60af81843a5b92 (patch)
treeb9cc6d597bc33caaf53b21c99e3935aa56a1d393 /python
parent02a742bd76b4aae01636185b6107ff0e50cfee92 (diff)
downloadaura-central-3bb3d224c597aa6679af4c115d60af81843a5b92.tar.gz
Preprocessor warnings should not be fatal errors
Diffstat (limited to 'python')
-rw-r--r--python/mozbuild/mozbuild/jar.py2
-rw-r--r--python/mozbuild/mozbuild/preprocessor.py17
2 files changed, 6 insertions, 13 deletions
diff --git a/python/mozbuild/mozbuild/jar.py b/python/mozbuild/mozbuild/jar.py
index d40751b69..98333482b 100644
--- a/python/mozbuild/mozbuild/jar.py
+++ b/python/mozbuild/mozbuild/jar.py
@@ -460,7 +460,7 @@ class JarMaker(object):
pp.setMarker('%')
pp.out = outf
pp.do_include(inf)
- pp.failUnused(realsrc)
+ pp.warnUnused(realsrc)
outf.close()
inf.close()
return
diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild/preprocessor.py
index e8aac7057..2e7eed1ca 100644
--- a/python/mozbuild/mozbuild/preprocessor.py
+++ b/python/mozbuild/mozbuild/preprocessor.py
@@ -316,20 +316,13 @@ class Preprocessor:
if defines:
self.context.update(defines)
- def failUnused(self, file):
+ def warnUnused(self, file):
msg = None
if self.actionLevel == 0 and not self.silenceMissingDirectiveWarnings:
- msg = 'no preprocessor directives found'
+ sys.stderr.write('{0}: WARNING: no preprocessor directives found\n'.format(file))
elif self.actionLevel == 1:
- msg = 'no useful preprocessor directives found'
- if msg:
- class Fake(object): pass
- fake = Fake()
- fake.context = {
- 'FILE': file,
- 'LINE': None,
- }
- raise Preprocessor.Error(fake, msg, None)
+ sys.stderr.write('{0}: WARNING: no useful preprocessor directives found\n'.format(file))
+ pass
def setMarker(self, aMarker):
"""
@@ -385,7 +378,7 @@ class Preprocessor:
self.out = output
self.do_include(input, False)
- self.failUnused(input.name)
+ self.warnUnused(input.name)
if depfile:
mk = Makefile()