summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorTausif Rahman <tausif.rahman@mongodb.com>2022-05-12 15:40:54 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-12 17:05:34 +0000
commit1ca9f11ad44383794b3ffe5193f088bee99a1994 (patch)
treeaf12e1d97a3b2c53599d9e4a981ad6645d94f569 /site_scons
parent1cd743c746d94603d965c828b3187852a59d991c (diff)
downloadmongo-1ca9f11ad44383794b3ffe5193f088bee99a1994.tar.gz
SERVER-57692 forceincludes.py: add better error handling for missing header
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/forceincludes.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/site_scons/site_tools/forceincludes.py b/site_scons/site_tools/forceincludes.py
index 7238a54f0e3..6d535bf0ba0 100644
--- a/site_scons/site_tools/forceincludes.py
+++ b/site_scons/site_tools/forceincludes.py
@@ -33,6 +33,15 @@ def _add_scanner(builder):
# the forced includes into nodes given the search path.
fis = [env.FindFile(f, path) for f in env.get('FORCEINCLUDES', [])]
+ # If all nodes could not be resolved, there are missing headers.
+ if not all(fis):
+ missing_headers = [header for node, header in zip(fis, env.get('FORCEINCLUDES')) if not node]
+ errstring = f"Could not find force include header(s): {missing_headers} in any path in CPPPATH:\n"
+ for cpppath in env.get('CPPPATH', []):
+ errstring += f"\t{env.Dir(cpppath).path}\n"
+
+ raise SCons.Errors.SConsEnvironmentError(errstring)
+
# Use the nodes *source* scanner, which was provided to us as
# `argument` when we created this scanner, to scan the forced
# includes for transitive includes.