diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-03-06 17:17:16 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-03-11 15:59:05 +0100 |
commit | b885deebf9fc02b9f1e849d91de93fadcfb71a73 (patch) | |
tree | a26b4f9ad05e479b51b97a1a4c489525243c241a /src/buildtool/build_engine/target_map/target_map.cpp | |
parent | 1bba42d5168a13dbebda8820fc5e28df1d401669 (diff) | |
download | justbuild-b885deebf9fc02b9f1e849d91de93fadcfb71a73.tar.gz |
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.
Diffstat (limited to 'src/buildtool/build_engine/target_map/target_map.cpp')
-rw-r--r-- | src/buildtool/build_engine/target_map/target_map.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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<RepositoryConfig*>& repo_config, + const ActiveTargetCache& target_cache, const nlohmann::json& targets_file, const gsl::not_null<BuildMaps::Base::SourceTargetMap*>& source_target, const gsl::not_null<BuildMaps::Base::UserRuleMap*>& 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<AbsentTargetMap*>& absent_target_map, const gsl::not_null<ResultTargetMap*>& result_map, const gsl::not_null<RepositoryConfig*>& 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, |