[Nix#9292] builtins.fetchGit
dirty mode almost unusable in pure evaluation mode #105
Labels
No labels
Area/build-packaging
Area/evaluator
Area/flakes
Area/profiles
Area/remote-builds
Area/repl
Area/store
bug
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#105
Loading…
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#9292
Describe the bug
builtins.fetchGit
has a mode where if you pass a local directory and noref
norrev
, it uses the state of the tracked files in the Git working directory.With pure evaluation, this mode is almost unusable, because it requires a
narHash
, even though paths in pure evaluation mode will always be in the Nix store, and therefore implicitly pure.Steps To Reproduce
This can be reproduced with both stable Nix and Flakes, it doesn't depend on any experimental features, but I'll use Flakes since it's really hard to use pure evaluation mode without it.
Create this
flake.nix
file in a new empty Git repository:Try to evaluate
fetchGit
without providing anarHash
, notice how it doesn't let us. Note that we usepath:
so that the.git
directory is also available:Try to evaluate
fetchGit
with an emptynarHash
:This gives us the correct hash, however this would prevent us from including
flake.nix
in Git, since that would then influence the hash again, and we can't put the hash into a file influenced by the hash.Expected behavior
builtins.fetchGit ./.
in pure evaluation mode should just work, since the path will refer to a store path, which is always pure.nix-env --version
outputnix-env (Nix) 2.15.1
Additional context
This issue is sponsored by Antithesis ✨
Priorities
Add 👍 to issues you find important.