Flake path does not appear to be a git repository #468
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#468
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?
Describe the bug
This has been an elusive bug which I have only managed to reproduce twice now, several weeks apart. It may require some hammering to resolve.
Cloning a repository with a
flake.nix
file in it and then attempting to runnix flake show
fails with the following logs. I believe this happened previously with aflake.nix
file at the repository root, but I now see it occur with a flake in a subdirectory.Show Logs
Steps To Reproduce
git clone forgejo@git.auxolotl.org:auxolotl/labs.git
tidepool
subdirectory:cd labs/tidepool
nix flake show
Expected behavior
Flakes in Git repositories should not fail when used.
nix --version
outputnix (Lix, like Nix) 2.90.0-rc1
Additional context
I had originally attempted to report this some weeks ago, but after performing a git operation in the repository the error went away. Even with a fresh clone I was then unable to reproduce the error. There may be some odd caching behavior or similar which avoids the error.
At the time of submitting this, the commit which is cloned from
auxolotl/labs
iscadfaabc853d20f2bc20bad794fcbe520ea48f13
and the output ofgit log
displays the following which I believe should be fine.After trying several different git operations and running
nix flake show
it appears that the log was onto something mentioning amaster
branch. It appears that creating this branch resolves the issue, allowing me to perform flake operations. Perhapsmaster
is hard-coded somewhere? This repository's default branch is namedmain
and does not otherwise have a branch namedmaster
.Just in case I have updated my
nixpkgs
version which gives me Lix at version2.90.0
and the issue persists.this might be fixed in lix 2.91
I will give it a try :)
I have switched to
2.91.0
and am still seeing this issueMinor note: clone does not need to be over SSH; we just reproduced with an HTTPS clone (thank gods; if this were somehow specific to the clone type I think we'd combust).
you've hit upon something we've seen a while ago in similar circumstances, that is once more indicative of the massive design issues of flakes and how stupidly rushed and incomplete a system they are.
.
and..
in schemed urls are not special and passed through to the scheme handler, which then usually fucks it up.
flakeref is not a relative path.
refers to the repo root, not the directory of the current flake file. usually..
can't be used to reimport bits of the current flakepath:.
can.
inpath
schemes is a relative path and does mean "directory of the current flake.nix"!in conclusion,
ceterum censeo flakes esse delendam
oh and to answer to this bit specifically too: yes, not specifying a ref/rev defaults to
master
because of course it does. adding&ref=main
to your git urls also resolves the issue. we're not entirely sure whether this is actually safe or whether that can actually poison the fetcher cache.