I develop a haskell program but found a bug in a third-party (haskell) library thus I am editing both at once to debug the issue at hand.
Thus I am in my program haskell environment created via haskell.shellFor and would like ghc to pick up the library from my local fork rather than from the ghc environment.
The usual approach would be to use ghc-pkg (un)register
I believe but this doesn’t work on nix because the global database is Read Only. My idea is thus to add another package database (more about databases 5.9. Packages — Glasgow Haskell Compiler 9.0.1 User's Guide) via export GHC_PACKAGE_PATH="/home/teto/myfork:".
Then I try to create the local database via ghc-pkg -v -f /home/teto/myfork recache
but this cache is empty. When I list the packages ghc-pkg list -v
, I can that my database is taken into account but the package is not listed
db stack: ["/home/teto/myfork","/nix/store/vw0miqzi5jnf657g9ydd0qbz7sznd8b6-ghc-8.6.4-with-packages/lib/ghc-8.6.4/package.conf.d"]
...
/home/teto/myfork
(no packages)
My current question is thus “how to generate a local database containing my local haskell library fork /home/teto/myfork”.
The original goal being to edit 2 local haskell packages (one being a dependency of the other) at the same time without having to exit/recreate nix-shell environments to take into account changes from the packages.
cheers