-
Notifications
You must be signed in to change notification settings - Fork 69
Doesn't watch paths through IFD + filterSource (unsure if proper diagnosis) #22
Comments
I’ve seen this, too. I think we’ll need some additional setup for properly recognizing IFD paths. I had started a minimal repro somewhere, will push it once it’s ready. |
To get around such problems, I'd love to have a |
Here’s an old issue I just migrated that talks about this: #31 |
I tried to get around this issue for developing a cabal-based project, but ran into issues. Documenting this here in the hope it saves someone some time. Haskell package environment sucks in the source Haskell package environment not directly overridable
created the simple
and generated
|
You don't even need IFD to reproduce this issue. Just running the imported derivation with a filtered source is sufficient:
Running the code that lorri uses internally to gather sources to watch shows that no reference to
I haven't tried this with the latest version on master yet, so the results may have changed. On a slightly unrelated note, |
@anka-213, in your example, |
@dudebout Aha, I see. However, the fact that nothing is logged in my example is probably the cause for not being able to track the sources through IFD. No info about what sources are being copied is being logged. I am also a bit confused why manual filtering makes any difference when using callCabal2nix, since that already does filtering. For example:
will track the whole directory and
while
will not print such a copy statement and not track anything but the nix-file itself, Is this caused by NixOS/nixpkgs#51079? If so, adding an empty filter around src seems to be an extremely hacky workaround to that issue. |
I think what your are after is point 2. in #6 (comment) |
I have also come across this. Looking at Nix' source code, I got as far as follows:
But it looks like the following are true:
As a result, lorri adds the former to the watch list, but not the latter. We had discussions about changing Nix' output some time ago, I think it is time to revive those discussions. |
(Sorry about the spam, I just need a place to record this somewhere ...) Grepping through the Nix codebase, here's what I've found: the
So in order to capture which files, post- |
Remove varlink and bring back the native server/client socket serialization
After @dudebout solved my problem in #6 of it watching too many paths, I'm encountering the opposite problem: it doesn't watch all paths it should.
A simple example:
This uses import-from-derivation (IFD) by first building a derivation for knowing the dependencies, depending on a file
./pkg
throughbuiltins.filterSource
(touch
that file), then puts those dependencies in the build inputs. Lorri ends up not watching the file, as seen from the log:Meaning I can change the contents of the file
./pkg
, which would have an influence onnix-shell
, but lorri doesn't budge. And because there's no way to either forcefully include a file or forcefully reload everything, the only way to have it change the environment is by restartinglorri watch
(or changing a different file).While this may sound rather theoretical, that's actually how almost all functions in nixpkgs for developing Haskell packages work, including
developPackage
,callHackage
,callCabal2nix
, and more.I am encountering this with my project (after an adjustment). Namely it doesn't reload when I add a dependency to the
.cabal
file, which is something you do a lot in Haskell.The text was updated successfully, but these errors were encountered: