-
Notifications
You must be signed in to change notification settings - Fork 20
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
IFD-less evaluation of local packages #144
Comments
Alternatively, is it possible to make |
The But I got rid of it because I didn't have the bandwidth to think about how the pathing should work (pkgs/myPkg.nix should refer to ../something/myPkg or so) and also the workflow was rubbish without a way to check for staleness of the data. In the case of hpack staleness is obvious because the cabal file can be regenerated purely and cheaply, but in the case of cabal2nix over a gazillion projects - checking for staleness is just as expensive as the IFD it replaces. A lockfile would also confuse the matter here, where as a lockfile for urls, tarballs and hackage works fine because any change to those would dirty the lockfile and hence trigger a new cabal2nix regen for that item, where as with a FromLocal, the entry wouldn't change, so it would still require a call to cabal2nix everytime. So I think IFD is the only real option for local packages unfortunately. Example of a horizon overlay style here: https://gitlab.horizon-haskell.net/package-sets/horizon-plutus-apps |
@srid I use https://github.com/cachix/pre-commit-hooks.nix to keep the |
IFD can really slow down the evaluation of the flake, such as to make the launching of
nix develop
noticeably slow -- this is currently the case for https://github.com/nammayatri/nammayatri which has gazillion local packages with lots of dependencies.The idea here is to do something similar to the
hpack -> cabal
workflow, but forcabal -> nix
. ie., usecabal2nix
to generate adefault.nix
in the local package directory (example), for which we provide anix run
'able flake app that the developer will run anytime changing the .cabal file.There will also be a flake check (analogous to #97) to make sure that generated(pre-commit-hooks-nix can do this).default.nix
is in sync with the .cabal file (useful in CI).We could actually rename the
default.nix
to something unique to haskell-flake:haskell-package.nix
.Then, the following configuration:
... would look for
haskell-packages.nix
and use that; if not, it looks for the .cabal file falling back to using IFD (callCabal2nix
).cc @roberth @locallycompact @NorfairKing for feedback/suggestions/ideas.
The text was updated successfully, but these errors were encountered: