You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If `narHash` is set, the source is first looked up is the Nix store and [substituters](@docroot@/command-ref/conf-file.md#conf-substituters), and only fetched if not available.
Well, that's not happening.
Steps To Reproduce
The 1st time you fetch, it downloads ✅:
➤ nix eval --no-eval-cache --debug --expr 'builtins.fetchTree {type="github"; owner="OCA"; repo="account-analytic"; rev="bc8dbde0477634d64915d027093756defcf0ebc3"; narHash="sha256-sD75xS86JRr7q1be+U8FMI7ijDj4tgexlyNGVEa8fpc=";}'
did not find cache entry for'{"rev":"bc8dbde0477634d64915d027093756defcf0ebc3","type":"git-tarball"}'
did not find cache entry for'{"name":"source","type":"tarball","url":"https://github.com/OCA/account-analytic/archive/bc8dbde0477634d64915d027093756defcf0ebc3.tar.gz"}'
did not find cache entry for'{"name":"source","type":"file","url":"https://github.com/OCA/account-analytic/archive/bc8dbde0477634d64915d027093756defcf0ebc3.tar.gz"}'
downloading 'https://github.com/OCA/account-analytic/archive/bc8dbde0477634d64915d027093756defcf0ebc3.tar.gz'...
starting download of https://github.com/OCA/account-analytic/archive/bc8dbde0477634d64915d027093756defcf0ebc3.tar.gz
finished download of 'https://github.com/OCA/account-analytic/archive/bc8dbde0477634d64915d027093756defcf0ebc3.tar.gz'; curl status = 0, HTTP status = 200, body = 1089274 bytes
performing daemon worker op: 39
acquiring write lock on '/nix/var/nix/temproots/575565'
performing daemon worker op: 7
performing daemon worker op: 26
{ lastModified = 1697447248; lastModifiedDate = "20231016090728"; narHash = "sha256-sD75xS86JRr7q1be+U8FMI7ijDj4tgexlyNGVEa8fpc="; outPath = "/nix/store/q3fw9j28hdlyal51xgqlrac9vcb59p2f-source"; rev = "bc8dbde0477634d64915d027093756defcf0ebc3"; shortRev = "bc8dbde"; }
download thread shutting down
The next time you download, it says "using cache entry". That's suspicious 🕵️♂️. It shouldn't need any cache because there's a narHash parameter passed:
Describe the bug
According to the docs, when you add
narHash
to afetchTree
call, the result won't be fetched if it's already available:nix/src/libexpr/primops/fetchTree.cc
Line 218 in 864fc85
Well, that's not happening.
Steps To Reproduce
The 1st time you fetch, it downloads ✅:
The next time you download, it says "using cache entry". That's suspicious 🕵️♂️. It shouldn't need any cache because there's a
narHash
parameter passed:Let's remove cache and retry. We can see how fetches again. ❌ It shouldn't!:
Expected behavior
When calling with a NAR hash, it shouldn't need to even check the cache. Nix should just check the store and skip the fetching/caching completely.
nix-env --version
outputnix-env (Nix) 2.18.1
Additional context
This might be duplicate of #9077 or #9570, but I'm not sure so I open separately.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: