From b885deebf9fc02b9f1e849d91de93fadcfb71a73 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 6 Mar 2024 17:17:16 +0100 Subject: just analyse: Use explicit target cache instance The serve endpoint always has to access the correctly sharded target cache, including during analysis. For this purpose, the target cache instance interrogated during analysis has to be explicitly provided. --- src/buildtool/build_engine/target_map/target_map.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/buildtool/build_engine/target_map/target_map.cpp') diff --git a/src/buildtool/build_engine/target_map/target_map.cpp b/src/buildtool/build_engine/target_map/target_map.cpp index 2322ba54..4d28ac6a 100644 --- a/src/buildtool/build_engine/target_map/target_map.cpp +++ b/src/buildtool/build_engine/target_map/target_map.cpp @@ -1237,6 +1237,7 @@ void withRuleDefinition( void withTargetsFile( const BuildMaps::Target::ConfiguredTarget& key, const gsl::not_null& repo_config, + const ActiveTargetCache& target_cache, const nlohmann::json& targets_file, const gsl::not_null& source_target, const gsl::not_null& rule_map, @@ -1275,6 +1276,7 @@ void withTargetsFile( desc, key, repo_config, + target_cache, subcaller, setter, logger, @@ -1657,6 +1659,7 @@ auto CreateTargetMap( const gsl::not_null& absent_target_map, const gsl::not_null& result_map, const gsl::not_null& repo_config, + const ActiveTargetCache& target_cache, std::size_t jobs) -> TargetMap { auto target_reader = [source_target_map, targets_file_map, @@ -1664,11 +1667,12 @@ auto CreateTargetMap( directory_entries_map, absent_target_map, result_map, - repo_config](auto ts, - auto setter, - auto logger, - auto subcaller, - auto key) { + repo_config, + target_cache](auto ts, + auto setter, + auto logger, + auto subcaller, + auto key) { if (key.target.IsAnonymousTarget()) { withTargetNode(key, repo_config, @@ -1803,6 +1807,7 @@ auto CreateTargetMap( {key.target.ToModule()}, [key, repo_config, + target_cache, source_target_map, rule_map, ts, @@ -1812,6 +1817,7 @@ auto CreateTargetMap( result_map](auto values) { withTargetsFile(key, repo_config, + target_cache, *values[0], source_target_map, rule_map, -- cgit v1.2.3