summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2023-02-09 08:50:58 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-09 10:41:34 +0000
commit7be8b2f04f5d2e487015c4fcb92b7ff6aa81dc57 (patch)
treed043e74b01f4373bd58658397fe888a87a4495e2
parent4ac9a81c224c4eebc1e971062b5319ed37122e83 (diff)
downloadmongo-7be8b2f04f5d2e487015c4fcb92b7ff6aa81dc57.tar.gz
Revert "SERVER-72147 defer switching hard coded clang tidy module flags."
This reverts commit 8181de8a415a6198731a7cabe8e04ca014722aa0.
-rw-r--r--src/mongo/tools/mongo_tidy_checks/SConscript10
-rw-r--r--src/mongo/tools/mongo_tidy_checks/tests/SConscript22
2 files changed, 13 insertions, 19 deletions
diff --git a/src/mongo/tools/mongo_tidy_checks/SConscript b/src/mongo/tools/mongo_tidy_checks/SConscript
index 1ff404ae59e..5947c018f3a 100644
--- a/src/mongo/tools/mongo_tidy_checks/SConscript
+++ b/src/mongo/tools/mongo_tidy_checks/SConscript
@@ -30,10 +30,12 @@ if not toolchain_found or not toolchain_clang_tidy_dev_found:
env = env.Clone()
-# TODO SERVER-73731
-# Instead of hardcoding these flags, we should load the flags used by the toolchain here
-env['CC'] = [f'{base_toolchain_bin}/gcc']
-env['CXX'] = [f'{base_toolchain_bin}/g++']
+# TODO SERVER-72147
+# This config was ripped from the toolchain build because our standard build config produced
+# mismatched ABI, as well as using z,defs which will not work in this situation, so I am not
+# sure what flags were specifically responsible and I just swapped them all. The toolchain build
+# should test the check module so that if the configuration of clang-tidy changes there it would
+# catch any issues here.
env['CPPPATH'] = [str(tidy_include)]
env['LIBPATH'] = []
env['CCFLAGS'] = [
diff --git a/src/mongo/tools/mongo_tidy_checks/tests/SConscript b/src/mongo/tools/mongo_tidy_checks/tests/SConscript
index fb9ea385c9f..7c39431e109 100644
--- a/src/mongo/tools/mongo_tidy_checks/tests/SConscript
+++ b/src/mongo/tools/mongo_tidy_checks/tests/SConscript
@@ -9,14 +9,6 @@ import SCons
# multiple compilation databases is not supported by ninja
if env.GetOption('ninja') == 'disabled':
- tidy_test_env = env.Clone()
-
- # These test files will purposefully be error prone, so we can disable warnings any warnings we expect
- # to see.
- tidy_test_env.Append(CCFLAGS=[
- '-Wno-unused-but-set-parameter',
- ], )
-
# This list represents the test source files, which should contain a single issue which will be flagged
# by a clang tidy check. The issue should be isolated in as minimal way as possible.
tests = [
@@ -31,13 +23,13 @@ if env.GetOption('ninja') == 'disabled':
test_objs = []
compilation_dbs = []
for test in tests:
- test_env = tidy_test_env.Clone()
+ test_env = env.Clone()
compilation_dbs += test_env.CompilationDatabase(
os.path.splitext(os.path.basename(test))[0] + ".json")
test_objs += test_env.Object(test)
# Building a program binary may not be necessary but it does validate the code and tie it together.
- test_prog = tidy_test_env.Program(
+ test_prog = env.Program(
target='MongoTidyCheck_test',
source=['MongoTidyCheckTestMain.cpp'] + test_objs,
LIBDEPS_NO_INHERIT=[
@@ -47,7 +39,7 @@ if env.GetOption('ninja') == 'disabled':
# Here we setup the test execution. The test will pythons built in unittest framework
# to execute clang tidy for each test source file from the list above.
- test = tidy_test_env.Command(
+ test = env.Command(
target='run_MongoTidyCheck_test',
source=[
'MongoTidyCheck_unittest.py',
@@ -60,11 +52,11 @@ if env.GetOption('ninja') == 'disabled':
'--clang-tidy-path=${SOURCES[1]}',
'--mongo-tidy-module=${SOURCES[2]}',
'${["--test-compiledbs=%s" % src for src in SOURCES[3:]]}',
- f"{'' if tidy_test_env.Verbose() else '2> /dev/null'}",
+ f"{'' if env.Verbose() else '2> /dev/null'}",
]),
- "" if tidy_test_env.Verbose() else "Runnning mongo tidy checks unittests.",
+ "" if env.Verbose() else "Runnning mongo tidy checks unittests.",
),
)
- tidy_test_env.Alias('+mongo-tidy-tests', test)
- tidy_test_env.Depends(test, test_prog)
+ env.Alias('+mongo-tidy-tests', test)
+ env.Depends(test, test_prog)