-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flakes: flake inputs incorrectly following from the root of the current flake #5697
Comments
@balsoft as the original author of the offending commit, I wonder if you may have an idea of what's going on? |
Here we go again... I'll look into it on the weekend |
Previously, when we were attemptint to reuse the old lockfile information in the computeLocks function, we have passed the parent of the current input to the next computeLocks call. This was incorrect, since the follows are resolved relative to the parent. This caused issues when we tried to reuse oldLock but couldn't for some reason (read: mustRefetch is true), in that case the follows were resolved incorrectly. Fix this by passing the correct parent, and adding some tests to prevent this particular regression from happening again. Closes NixOS#5697
Previously, when we were attempting to reuse the old lockfile information in the computeLocks function, we have passed the parent of the current input to the next computeLocks call. This was incorrect, since the follows are resolved relative to the parent. This caused issues when we tried to reuse oldLock but couldn't for some reason (read: mustRefetch is true), in that case the follows were resolved incorrectly. Fix this by passing the correct parent, and adding some tests to prevent this particular regression from happening again. Closes NixOS#5697
Thanks @balsoft ! I can confirm, the fix works here |
Might it be possible that this bug came back? @balsoft should I open a new issue for this? I'm trying the current 2.6 release and get the same behaviour:
|
I've left a bisect running. Let's see what broke it. |
It's not possible in general to know in computeLocks, relative to which path the follows was intended to be. So, we always resolve follows to their absolute states when we encounter them (which can either be in parseFlakeInput or computeLocks' fake input population). Fixes NixOS#6013 Fixes NixOS#5609 Fixes NixOS#5697 (again)
Resolved again by #6036 |
I still see the hyprland-wm and hyprland-plugins. |
Describe the bug
I noticed recent versions of Nix in the last month or so had strange follows behavior that caused some errors I wasn't seeing before. I boiled it down to this: flake inputs now seem to want to track their follows from the root of the consuming flake, rather than from their own root as it was before. This means that if flake B has inputs C and D with
C.follows = "D/C"
, and flake A pulls B as an input, you'll now see an error when trying to generate A's lockfile like so:Whereas before, this error did not occur and C would correctly come from B's lockfile, that is: "B/D/C". Now it seems Nix no longer knows about "B/D/C" and thinks "D" doesn't exist at all.
Steps To Reproduce
Just so happens this is occurring in a public work repo so you can refernce it to reproduce:
git bisect
)nix flake info github:input-output-hk/bitte/b6f9b26935425a2efadb9b35201c99916ced3a33
Expected behavior
Since follows are declared in flake B, it would make sense they would try to follow starting from its root, and not the root of the consuming flake.
The text was updated successfully, but these errors were encountered: