summary refs log tree commit diff
path: root/doc/builders
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2021-09-19 19:45:12 +0200
committerRobert Hensing <robert@roberthensing.nl>2021-09-19 19:45:12 +0200
commitb502de64766757b635ed2bb4aeb9532ceaefe71d (patch)
treee1ddf3d34f7749cedc6256768bbc1302b9b79cd7 /doc/builders
parentf74b1608328b31c554b8c34b1036cf6c02210004 (diff)
downloadnixpkgs-b502de64766757b635ed2bb4aeb9532ceaefe71d.tar
nixpkgs-b502de64766757b635ed2bb4aeb9532ceaefe71d.tar.gz
nixpkgs-b502de64766757b635ed2bb4aeb9532ceaefe71d.tar.bz2
nixpkgs-b502de64766757b635ed2bb4aeb9532ceaefe71d.tar.lz
nixpkgs-b502de64766757b635ed2bb4aeb9532ceaefe71d.tar.xz
nixpkgs-b502de64766757b635ed2bb4aeb9532ceaefe71d.tar.zst
nixpkgs-b502de64766757b635ed2bb4aeb9532ceaefe71d.zip
doc/builders/fetchers: Explain invalidateFetcherByDrvHash
Diffstat (limited to 'doc/builders')
-rw-r--r--doc/builders/fetchers.chapter.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/builders/fetchers.chapter.md b/doc/builders/fetchers.chapter.md
index d54fe850c6c..2e2786c9879 100644
--- a/doc/builders/fetchers.chapter.md
+++ b/doc/builders/fetchers.chapter.md
@@ -6,7 +6,7 @@ When using Nix, you will frequently need to download source code and other files
 
 Because fixed output derivations are _identified_ by their hash, a common mistake is to update a fetcher's URL or a version parameter, without updating the hash. **This will cause the old contents to be used.** So remember to always invalidate the hash argument.
 
-Similarly, a change to the implementation of a fetcher may cause a fixed output derivation to fail, but isn't caught by tests because the supposed output is already in the store or cache. So when testing a fetcher, always make sure to `nix-store --delete` the output and pay attention to the log, in case deletion was prevented by a garbage collection root.
+For those who develop and maintain fetcheres, a similar problem arises with changes to the implementation of a fetcher. These may cause a fixed output derivation to fail, but won't normally be caught by tests because the supposed output is already in the store or cache. For the purpose of testing, you can use a trick that is embodied by the `invalidateFetcherByDrvHash` function. It uses the derivation `name` to create a unique output path per fetcher implementation, defeating the caching precisely where it would be harmful.
 
 ## `fetchurl` and `fetchzip` {#fetchurl}