diff options
author | Tausif Rahman <tausif.rahman@mongodb.com> | 2022-04-27 19:19:14 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-27 19:49:04 +0000 |
commit | 4e79ecabfa57623648688e5d602dae16e3f4a72c (patch) | |
tree | df9431dd33dcfa0300f5fbb2d13d5e61d2a5c2c3 | |
parent | c6db2e961c4e0a65a606896c4a38f8fe1548cf45 (diff) | |
download | mongo-4e79ecabfa57623648688e5d602dae16e3f4a72c.tar.gz |
SERVER-54107 compile_commands.json should have an order-only dependency on generated-sources
-rw-r--r-- | SConstruct | 5 | ||||
-rw-r--r-- | etc/evergreen_yml_components/definitions.yml | 2 | ||||
-rw-r--r-- | site_scons/site_tools/ninja.py | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct index 8cb6eafa7d0..4b6e002b4eb 100644 --- a/SConstruct +++ b/SConstruct @@ -5354,7 +5354,10 @@ env.AddMethod(injectModule, 'InjectModule') if get_option('ninja') == 'disabled': compileCommands = env.CompilationDatabase('compile_commands.json') - compileDb = env.Alias("compiledb", compileCommands) + # Initialize generated-sources Alias as a placeholder so that it can be used as a + # dependency for compiledb. This Alias will be properly updated in other SConscripts. + generatedSources = env.Alias("generated-sources") + compileDb = env.Alias("compiledb", [compileCommands, generatedSources]) msvc_version = "" diff --git a/etc/evergreen_yml_components/definitions.yml b/etc/evergreen_yml_components/definitions.yml index 5cf2f49caca..b784cfef968 100644 --- a/etc/evergreen_yml_components/definitions.yml +++ b/etc/evergreen_yml_components/definitions.yml @@ -2385,7 +2385,7 @@ tasks: - *f_expansions_write - func: "scons compile" vars: - targets: generated-sources compiledb + targets: compiledb compiling_for_test: true - command: subprocess.exec type: test diff --git a/site_scons/site_tools/ninja.py b/site_scons/site_tools/ninja.py index 0b0d3ed88bf..d069e16382b 100644 --- a/site_scons/site_tools/ninja.py +++ b/site_scons/site_tools/ninja.py @@ -879,7 +879,7 @@ class NinjaState: ) ninja.build( - "compiledb", rule="phony", implicit=["compile_commands.json"], + "compiledb", rule="phony", implicit=["compile_commands.json"], order_only=[generated_sources_alias], ) # Look in SCons's list of DEFAULT_TARGETS, find the ones that |