-
Notifications
You must be signed in to change notification settings - Fork 296
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
Environment Setup Fails Due to Missing .devenv.flake.nix after devenv update #1137
Comments
Here is an easier repro:
|
The nix path its looking in is some version of nixpkgs.
|
Removing the dependency on
Does not appear to be related to being an overlay, because if I change things around such that we just use it directly:
and
We wind up with more or less the same traceback. |
The simplest possible repro of the issue is this (my foundry-devenv repo fork "simplify-bug-repro" branch has a devenv.nix that incudes only the remote flake as a package):
When I attempt to put the exact same files that are currently in the simplify-bug-repro branch into a subdir of |
This is the same issue that I ran into and mentioned to Domen on Matrix a few days ago. I've created a barebones repo to demonstrate/reproduce the issue here, which (optionally) depends on a very simple flake which can be found here. This issue came up for me when I started work on a pre-commit hook that scans repos for secrets using TruffleHog, which at the time I started was broken on Darwin in Nixpkgs. I noticed issues with pulling in my fixed version of the TruffleHog package:
I've noticed a few workarounds in this:
I've also noticed that the pre-commit hook I've defined actually works, even when devShell evaluation fails. That part evaluates fine. I don't know how indicative it is, but the failure to find a
And when I inspect that Nix store path, I can see it's
|
It seems this varies. I've seen devenv mistakenly look for a |
I suspect the most fruitful place to look next will be comparing the
|
That sounds likely, thanks for relating it! |
There must be some implicit thing that is consuming |
Yes. I believe that's in Nix itself. Notice that the Nix path in our stack traces seems to be a devenv-specific fork. On my system, when I try to use
On my other machine, which I just did some testing on with my repos for reproduction this morning, I found a few other surprising things. (Post to follow, sorry in advance for double-posting.) |
Check this out: 'stable' Nix (2.18.2) doesn't know how to open a flake repl in a devenv repo, but the Nix whose store path ends in
As for where in Nix to look, our clue is of course right there in the stack traces:
That's this file (permalink). I assume devenv patches this file somewhere to have it look for I assume there's also some other trickery, that devenv perhaps invokes
is complaining about a missing At any rate, our issues are likely in the patched-up Nix that it seems devenv uses for evaluation, perhaps in the embedded Nix code for |
Oh geez, well-spotted. |
Yep, check it out: one of the changes in Domen's fork of Nix is to copy untracked files into the store for flake repos: domenkozar/nix@138a986 Incidentally I think that tells us we might (also?) want to look at libfetchers. Here's a starting point for files of interest:
Here are links to the relevant files on the relevant branch:
(It looks like the error message is one of the generic ones from I'm poking through those files now, but I'll soon have to switch gears for work so I may not be able to follow up today. |
I suspect the issue is how Nix resolves paths, while |
Testing a fix in #1137 |
As you've likely seen, this fix doesn't work because Could there be a bug in Here's the relevant bit of my stack trace when I tested this fix:
|
The bug is in |
Thanks for the update. I just noticed from a bit of playing around. You've probably seen it, but it might be helpful for posterity, or linking to the upstream Nix issue eventually, if it hasn't been filed yet:
(I'm also a bit surprised that any reference to something inside the Nix store is forbidden even during 'pure' evaluation, and that |
This is mostly a side effect of NixOS/nix#6530, which tries to abstract away flake paths. It should be reported there if we want it to be fixed upstream. |
See also NixOS/nix#10505 |
Any word on this? This is a pretty killer bug for me. Should I just revert to older |
This is on the top of my priority list of next week. |
Hello, we got this error in our GitHub Actions (following https://devenv.sh/integrations/github-actions/#run-multiple-commands) since yesterday. Would you know how to revert to the previous version in the GitHub Actions? |
Looks like this The repo my stuff was choking on was |
I have the same issue with |
Describe the bug
I had a working devenv with an overlay for foundry, but it started failing once I did
devenv update
(from 0.6.3 to 1.0.3).The process fails due to an error related to missing files and possible path issues. The specific error message indicates that the
.devenv.flake.nix
file cannot be found (despite it being there), leading to a failure in loading the environment. Here's the specific part of the error log that highlights the issue:To reproduce
Please find the necessary files (
devenv.nix
,devenv.yaml
, anddevenv.lock
) and the complete error logs in this https://gist.github.com/gonzaloetjo/41b62b2a97387b8b8029ba3c2fdd5d8c.Expected behavior
The environment should load without errors, sourcing all necessary Nix packages and configurations. Previously, this setup loaded correctly without any issues.
Version
Previously, this configuration was working with version
0.6.3
.The repository for the current environment setup is found here.
The text was updated successfully, but these errors were encountered: