summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/build_engine/target_map/absent_target_map.cpp4
-rw-r--r--src/buildtool/build_engine/target_map/export.cpp5
-rw-r--r--src/buildtool/main/analyse_context.hpp8
-rw-r--r--src/buildtool/main/main.cpp2
-rw-r--r--src/buildtool/serve_api/serve_service/target.cpp2
5 files changed, 11 insertions, 10 deletions
diff --git a/src/buildtool/build_engine/target_map/absent_target_map.cpp b/src/buildtool/build_engine/target_map/absent_target_map.cpp
index b21f426c..fd786539 100644
--- a/src/buildtool/build_engine/target_map/absent_target_map.cpp
+++ b/src/buildtool/build_engine/target_map/absent_target_map.cpp
@@ -64,7 +64,7 @@ void WithFlexibleVariables(
/*fatal=*/true);
return;
}
- auto target_cache_key = context->target_cache.ComputeKey(
+ auto target_cache_key = context->target_cache->ComputeKey(
*repo_key, target_name, effective_config);
if (not target_cache_key) {
(*logger)(fmt::format("Could not produce cache key for target {}",
@@ -74,7 +74,7 @@ void WithFlexibleVariables(
}
std::optional<std::pair<TargetCacheEntry, Artifact::ObjectInfo>>
target_cache_value{std::nullopt};
- target_cache_value = context->target_cache.Read(*target_cache_key);
+ target_cache_value = context->target_cache->Read(*target_cache_key);
bool from_just_serve = false;
if (not target_cache_value and context->serve) {
auto task = fmt::format("[{},{}]",
diff --git a/src/buildtool/build_engine/target_map/export.cpp b/src/buildtool/build_engine/target_map/export.cpp
index 23a70cd4..f3f4e97a 100644
--- a/src/buildtool/build_engine/target_map/export.cpp
+++ b/src/buildtool/build_engine/target_map/export.cpp
@@ -131,13 +131,14 @@ void ExportRule(
auto const& target_name = key.target.GetNamedTarget();
auto repo_key = context->repo_config->RepositoryKey(target_name.repository);
auto target_cache_key = repo_key
- ? context->target_cache.ComputeKey(
+ ? context->target_cache->ComputeKey(
*repo_key, target_name, effective_config)
: std::nullopt;
if (target_cache_key) {
// first try to get value from local target cache
- auto target_cache_value = context->target_cache.Read(*target_cache_key);
+ auto target_cache_value =
+ context->target_cache->Read(*target_cache_key);
bool from_just_serve{false};
#ifndef BOOTSTRAP_BUILD_TOOL
diff --git a/src/buildtool/main/analyse_context.hpp b/src/buildtool/main/analyse_context.hpp
index d5022d4b..de3b4980 100644
--- a/src/buildtool/main/analyse_context.hpp
+++ b/src/buildtool/main/analyse_context.hpp
@@ -25,10 +25,10 @@
#include "src/buildtool/storage/target_cache.hpp"
struct AnalyseContext final {
- gsl::not_null<const RepositoryConfig*> repo_config;
- ActiveTargetCache const& target_cache;
- gsl::not_null<Statistics*> statistics;
- gsl::not_null<Progress*> progress;
+ gsl::not_null<RepositoryConfig const*> const repo_config;
+ gsl::not_null<ActiveTargetCache const*> const target_cache;
+ gsl::not_null<Statistics*> const statistics;
+ gsl::not_null<Progress*> const progress;
std::optional<ServeApi> const& serve;
};
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index 457bfcd1..1e956cc8 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -1007,7 +1007,7 @@ auto main(int argc, char* argv[]) -> int {
Progress exports_progress{};
AnalyseContext analyse_ctx{
.repo_config = &repo_config,
- .target_cache = Storage::Instance().TargetCache(),
+ .target_cache = &Storage::Instance().TargetCache(),
.statistics = &stats,
.progress = &exports_progress,
.serve = serve};
diff --git a/src/buildtool/serve_api/serve_service/target.cpp b/src/buildtool/serve_api/serve_service/target.cpp
index a87648dc..d7e48402 100644
--- a/src/buildtool/serve_api/serve_service/target.cpp
+++ b/src/buildtool/serve_api/serve_service/target.cpp
@@ -451,7 +451,7 @@ auto TargetService::ServeTarget(
Logger logger{"serve-target", {LogSinkFile::CreateFactory(tmp_log)}};
AnalyseContext analyse_ctx{.repo_config = &repository_config,
- .target_cache = tc,
+ .target_cache = &tc,
.statistics = &stats,
.progress = &progress,
.serve = serve_};