aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2021-01-18 18:13:07 +0100
committeradisbladis <adisbladis@gmail.com>2021-01-21 10:32:56 +0100
commit144cad906991015e997a6b3e7cc69412eb2b8ab1 (patch)
tree9d0cdf0742a932c1e832440a4357bc2db428c305 /src
parent259100332f96250d6615d5839f6a77798c77aefb (diff)
narinfo: Change NAR URLs to be addressed on the NAR hash instead of the compressed hash
This change is to simplify [Trustix](https://github.com/tweag/trustix) indexing and makes it possible to reconstruct this URL regardless of the compression used. In particular this means that https://github.com/tweag/trustix/blob/7c2e9ca597de233846e0b265fb081626ca6c59d8/contrib/nix/nar/nar.go#L61-L71 can be removed and only the bits that are required to establish trust needs to be published in the Trustix build logs.
Diffstat (limited to 'src')
-rw-r--r--src/libstore/binary-cache-store.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index 4f5f8607d..15163ead5 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -176,11 +176,7 @@ ref<const ValidPathInfo> BinaryCacheStore::addToStoreCommon(
auto [fileHash, fileSize] = fileHashSink.finish();
narInfo->fileHash = fileHash;
narInfo->fileSize = fileSize;
- narInfo->url = "nar/" + narInfo->fileHash->to_string(Base32, false) + ".nar"
- + (compression == "xz" ? ".xz" :
- compression == "bzip2" ? ".bz2" :
- compression == "br" ? ".br" :
- "");
+ narInfo->url = "nar/" + info.narHash.to_string(Base32, false) + ".nar";
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(now2 - now1).count();
printMsg(lvlTalkative, "copying path '%1%' (%2% bytes, compressed %3$.1f%% in %4% ms) to binary cache",