diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-03-04 14:06:54 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-03-04 15:40:58 +0100 |
commit | cae2ec50abedb135bbeab2aae95fecebcfe977b3 (patch) | |
tree | 39f1644d1da93c46da354a7f427c8950dd6f0db7 /src/other_tools/repo_map | |
parent | 077bfedccb7a1428d95d735788c794ef58d153bf (diff) | |
download | justbuild-cae2ec50abedb135bbeab2aae95fecebcfe977b3.tar.gz |
serve protocol: support executable distfiles
As serve and just-mr share their caching of description-tree
association, we also have to change this cache. Thanks to json
encoding before hashing, we know that the old and new hash keys
do not overlap, so the change is save. As distdirs also keep the
respective files in the git root, no new downlaoding will happen
either, hence no warning in the CHANGELOG is needed.
Diffstat (limited to 'src/other_tools/repo_map')
-rw-r--r-- | src/other_tools/repo_map/repos_to_setup_map.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/other_tools/repo_map/repos_to_setup_map.cpp b/src/other_tools/repo_map/repos_to_setup_map.cpp index f2b28685..e98cf848 100644 --- a/src/other_tools/repo_map/repos_to_setup_map.cpp +++ b/src/other_tools/repo_map/repos_to_setup_map.cpp @@ -367,6 +367,8 @@ void DistdirCheckout(ExpressionPtr const& repo_desc, pragma_absent->get()->IsBool() and pragma_absent->get()->Bool(); // map of distfile to content + auto distdir_content_for_id = std::make_shared< + std::unordered_map<std::string, std::pair<std::string, bool>>>(); auto distdir_content = std::make_shared<std::unordered_map<std::string, std::string>>(); // get distdir list @@ -534,6 +536,8 @@ void DistdirCheckout(ExpressionPtr const& repo_desc, : std::filesystem::path(archive.fetch_url) .filename() .string()); + distdir_content_for_id->insert_or_assign( + repo_distfile, std::make_pair(archive.content, false)); distdir_content->insert_or_assign(repo_distfile, archive.content); // add to fetch list dist_repos_to_fetch->emplace_back(std::move(archive)); @@ -541,7 +545,8 @@ void DistdirCheckout(ExpressionPtr const& repo_desc, } // get hash of distdir content auto distdir_content_id = - HashFunction::ComputeBlobHash(nlohmann::json(*distdir_content).dump()) + HashFunction::ComputeBlobHash( + nlohmann::json(*distdir_content_for_id).dump()) .HexString(); // get the WS root as git tree DistdirInfo distdir_info = { |