From cae2ec50abedb135bbeab2aae95fecebcfe977b3 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 4 Mar 2024 14:06:54 +0100 Subject: 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. --- src/other_tools/repo_map/repos_to_setup_map.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/other_tools/repo_map') 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>>(); auto distdir_content = std::make_shared>(); // 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 = { -- cgit v1.2.3