diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/build_engine/base_maps/json_file_map.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/buildtool/build_engine/base_maps/json_file_map.hpp b/src/buildtool/build_engine/base_maps/json_file_map.hpp index f24b3564..79ba7eff 100644 --- a/src/buildtool/build_engine/base_maps/json_file_map.hpp +++ b/src/buildtool/build_engine/base_maps/json_file_map.hpp @@ -47,6 +47,7 @@ auto CreateJsonFileMap(gsl::not_null<RepositoryConfig*> const& repo_config, auto /* unused */, auto const& key) { auto const* root = ((*repo_config).*get_root)(key.repository); + auto const* json_file_name = ((*repo_config).*get_name)(key.repository); if (root == nullptr or json_file_name == nullptr) { (*logger)(fmt::format("Cannot determine root or JSON file name for " @@ -65,6 +66,20 @@ auto CreateJsonFileMap(gsl::not_null<RepositoryConfig*> const& repo_config, } auto json_file_path = module / *json_file_name; + if (root->IsAbsent()) { + std::string missing_root = "[unknown]"; + auto absent_tree = root->GetAbsentTreeId(); + if (absent_tree) { + missing_root = *absent_tree; + } + (*logger)(fmt::format( + "Would have to read JSON file {} of absent root {}.", + json_file_path.string(), + missing_root), + true); + return; + } + if (not root->IsFile(json_file_path)) { if constexpr (kMandatory) { (*logger)(fmt::format("JSON file {} does not exist.", |