[Nix#10104] fetchTree performs fetch even when a narHash is provided #52
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream-Issue: NixOS/nix#10104
Describe the bug
According to the docs, when you add
narHashto afetchTreecall, the result won't be fetched if it's already available:NixOS/nix@864fc85fc8/src/libexpr/primops/fetchTree.cc (L218)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
narHashparameter 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 --versionoutputnix-env (Nix) 2.18.1
Additional context
This might be duplicate of https://github.com/NixOS/nix/issues/9077 or https://github.com/NixOS/nix/issues/9570, but I'm not sure so I open separately.
Priorities
Add 👍 to issues you find important.
according to upstream issue, this has been fixed in cppnix 2.19; needs to be checked for persistence
It's a little more complicated than this,
fetchTreewill only check the store and bypass the cache whennarHashis present, and the fetcher type deems that enough info is given (which info varies per type), it is in thehasAllInfomethod, which:gittype, needslastModifiedand eithershallow = true,revCountto be set or have norefgithubtype, needs arevandlastModifiedtarballandpathis always truemercurial, havedefaultas a ref orrevCountto be set