snack
snack copied to clipboard
Ghci does not read package dependencies.
Example: in this project,
cd tests/library
snack ghci
will create an warning as
snack/tests/library/src/FooBar.hs:3:1: error:
Could not find module ‘Conduit’
Perhaps you haven't installed the "dyn" libraries for package ‘conduit-1.3.1.1’?
Use -v to see a list of the files searched for.
|
3 | import Conduit
| ^^^^^^^^^^^^^^
Failed, no modules loaded.
Prelude>
I think we shall pass packageDependencies somewhere in ghci.nix
@nmattia I think we just need to add dependency in https://github.com/nmattia/snack/blob/069f7d01fbb2400b8f8bd43dbff16478e3cd4d0e/snack-lib/ghci.nix#L33
But I do not how to find document of nix functions as writeScriptBin and makeWrapper. Can I know where I can find it?
writeScriptBin
is fairly straightforward: it simply wraps writeText
.
The following:
writeScriptBin “foo” “bar”
will write bar
to $out/bin/foo
and make foo
executable.
The documentation for makeWrapper
is a bit hard to find: https://github.com/NixOS/nixpkgs/blob/b339f29a277cd430c7fdd1677bcbb59ca6619945/pkgs/build-support/setup-hooks/make-wrapper.sh#L10-L29 (note that makeWrapper
is not a “nix” function but a bash function).