mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
Merge pull request #4464 from tweag/nar-narhash-addressed
narinfo: Change NAR URLs to be addressed on the NAR hash instead of the compressed hash
This commit is contained in:
commit
ee3846b587
2 changed files with 2 additions and 6 deletions
|
@ -176,11 +176,7 @@ ref<const ValidPathInfo> BinaryCacheStore::addToStoreCommon(
|
||||||
auto [fileHash, fileSize] = fileHashSink.finish();
|
auto [fileHash, fileSize] = fileHashSink.finish();
|
||||||
narInfo->fileHash = fileHash;
|
narInfo->fileHash = fileHash;
|
||||||
narInfo->fileSize = fileSize;
|
narInfo->fileSize = fileSize;
|
||||||
narInfo->url = "nar/" + narInfo->fileHash->to_string(Base32, false) + ".nar"
|
narInfo->url = "nar/" + info.narHash.to_string(Base32, false) + ".nar";
|
||||||
+ (compression == "xz" ? ".xz" :
|
|
||||||
compression == "bzip2" ? ".bz2" :
|
|
||||||
compression == "br" ? ".br" :
|
|
||||||
"");
|
|
||||||
|
|
||||||
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(now2 - now1).count();
|
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",
|
printMsg(lvlTalkative, "copying path '%1%' (%2% bytes, compressed %3$.1f%% in %4% ms) to binary cache",
|
||||||
|
|
|
@ -60,7 +60,7 @@ basicDownloadTests
|
||||||
# Test whether Nix notices if the NAR doesn't match the hash in the NAR info.
|
# Test whether Nix notices if the NAR doesn't match the hash in the NAR info.
|
||||||
clearStore
|
clearStore
|
||||||
|
|
||||||
nar=$(ls $cacheDir/nar/*.nar.xz | head -n1)
|
nar=$(ls $cacheDir/nar/*.nar | head -n1)
|
||||||
mv $nar $nar.good
|
mv $nar $nar.good
|
||||||
mkdir -p $TEST_ROOT/empty
|
mkdir -p $TEST_ROOT/empty
|
||||||
nix-store --dump $TEST_ROOT/empty | xz > $nar
|
nix-store --dump $TEST_ROOT/empty | xz > $nar
|
||||||
|
|
Loading…
Reference in a new issue