Skip to content
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

Ghci does not read package dependencies. #164

Open
zhujinxuan opened this issue Nov 18, 2019 · 3 comments
Open

Ghci does not read package dependencies. #164

zhujinxuan opened this issue Nov 18, 2019 · 3 comments

Comments

@zhujinxuan
Copy link
Contributor

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>
@zhujinxuan
Copy link
Contributor Author

I think we shall pass packageDependencies somewhere in ghci.nix

@zhujinxuan
Copy link
Contributor Author

@nmattia I think we just need to add dependency in

writeScriptBin "ghci-with-files"

But I do not how to find document of nix functions as writeScriptBin and makeWrapper. Can I know where I can find it?

@nmattia
Copy link
Owner

nmattia commented Nov 23, 2019

writeScriptBin is fairly straightforward: it simply wraps writeText.

The following:

writeScriptBinfoo” “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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants