Fix builtins.getFlake
to handle Git based flakes properly #28
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
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
testing/flakey
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#28
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?
Currently (as far as I understand it),
builtins.getFlake
ignores if the active repository is a Git repository and always treats it as a plain source repository. This causes some notable issues::lf
and starting with a loaded flake both pollute top-level scope which isn't always desirable, and the alternative is slow or not functional given below.In my opinion this is outright broken and should simply be fixed, hopefully nobody is relying on this in the wild.
I'm a bit unsure whether this is the behavior that should happen, or not;
builtins.getFlake
takes a standard flakeref as input. Could you trybuiltins.parseFlakeRef
and see what it outputs?What has to happen instead is something like:
I'd define this as somewhat of a footgun since the behavior of the command-line installables interface is that the current path is treated as a Git repository if possible, whereas using it this way sees it as a full path (since you can't use a "." reference in pure mode) which prevents it from being recognized the same way, leading to behavior that's almost never wanted.
Ah! That's a more actionable issue ("absolute paths are parsed as path flakes, rather than as git flakes"); and one that seems a lot more reasonable to fix (and we probably want to fix, as well.)
Would detecting a
.git
subdirectory in an unqualified absolute path and assuming it to be a Git flake be a reasonable solution? I still want to be able to force path flake usage if desired but this seems like a reasonable way to handle unqualified?i think this is https://github.com/NixOS/nix/issues/5836