Closed zhujinxuan closed 4 years ago
Hi, @nmattia Can I know how to pass args to ghci? It seems that the args passed to runExe does not work.
Mh, right. There's some magic happening when running ghci: https://github.com/nmattia/snack/blob/a76301a911413a991a49a3254fe4c4385ad4954c/snack-lib/ghci.nix#L33
You'd probably want to call ghci (in ghci-with-files
) with $@
. The order of arguments may be a problem, you might need to reorder them.
Test with snack ghci -- -version
, and it is working.
Almost ready, but snack ghci -p package.yaml -- --version
cannot be parsed.
The parser error also exists for snack run
https://github.com/nmattia/snack/issues/167. Let us fix it in another PR.
This PR is ready for review now.
Looks great, thanks a lot!
Test is not added in this PR, can I know how to add test for it?
We could add a test that only runs snack ghci
(i.e. without snack build
) to compile some code that would only compile with e.g. -XOverloadedStrings
. Do you want to add that or should we merge as is?
Actually you can probably copy this test, removing the extensions from the package.{yaml,nix}
: https://github.com/nmattia/snack/tree/master/tests/extensions
Test added. Awaiting for the CI.
BTW, would you like to use 'Squash and Merge' to merge PR? Then I do not need to rebase to keep it one commit manually.
@zhujinxuan thanks for the great work!
BTW, would you like to use 'Squash and Merge' to merge PR?
Sure thing!
Fix #157 Test is not added in this PR, can I know how to add test for it?