diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-12-06 15:20:44 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-12-09 13:01:58 +0100 |
commit | 344c00f1a63b628a0dff9335e106e005766c7d2f (patch) | |
tree | 1459dc2d530f3d02c901d2d5520f91e11506bcdb | |
parent | a3b8c2dcf4948352ba62685c2cd82ec2bfc8896f (diff) | |
download | justbuild-344c00f1a63b628a0dff9335e106e005766c7d2f.tar.gz |
Avoid writing to the CAS during bootstrapping
-rw-r--r-- | src/buildtool/build_engine/target_map/export.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/buildtool/build_engine/target_map/export.cpp b/src/buildtool/build_engine/target_map/export.cpp index c6e5d740..3433ff4c 100644 --- a/src/buildtool/build_engine/target_map/export.cpp +++ b/src/buildtool/build_engine/target_map/export.cpp @@ -148,13 +148,16 @@ void ExportRule( return; } context->statistics->IncrementExportsFoundCounter(); + + std::optional<TargetCacheKey> target_cache_key; +#ifndef BOOTSTRAP_BUILD_TOOL auto const& target_name = key.target.GetNamedTarget(); auto repo_key = context->repo_config->RepositoryKey(*context->storage, target_name.repository); - auto target_cache_key = repo_key - ? context->storage->TargetCache().ComputeKey( + target_cache_key = repo_key ? context->storage->TargetCache().ComputeKey( *repo_key, target_name, effective_config) : std::nullopt; +#endif if (target_cache_key) { // first try to get value from local target cache |