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

stack does not allow using an external package from ghci #1557

Closed
UnkindPartition opened this issue Dec 22, 2015 · 5 comments
Closed

stack does not allow using an external package from ghci #1557

UnkindPartition opened this issue Dec 22, 2015 · 5 comments

Comments

@UnkindPartition
Copy link
Contributor

I have a library that I want to debug. For that, I need a package that's not among the library's dependencies (base16-bytestring). But stack ghci would not allow me to do that, even if I pass --package:

% stack ghci --package base16-bytestring presta-lib:lib 
The following GHC options are incompatible with GHCi and have not been passed to it: -O0
Configuring GHCi with the following packages: presta-lib
GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
...
Ok, modules loaded: ...
> :m +Data.ByteString.Base16 Data.SafeCopy Data.Serialize

<no location info>:
    Could not find module ‘Data.ByteString.Base16’
    It is a member of the hidden package ‘base16-bytestring-0.1.1.6@base1_LGFgY5jaffY4IePNqJx55U’.

% stack --version
Version 0.1.11.0, Git revision 189d677ca6d63012ebe56083c9bee49f635bcc0d (dirty) (2919 commits) x86_64
@UnkindPartition
Copy link
Contributor Author

I just discovered --no-package-hiding, but it doesn't quite work either. I guess I'll open a separate issue for that.

@UnkindPartition
Copy link
Contributor Author

Ok, so one problem with --no-package-hiding isn't really a bug, just unfortunate expected behaviour:

    Ambiguous module name ‘Crypto.MAC.HMAC’:
      it was found in multiple packages:
      cryptonite-0.6@crypt_1A87AV0e5C8BaBsLLV3mNF cryptohash-0.11.6@crypt_5epyAhdyCoGIBkp2icUC24

@mgsloan
Copy link
Contributor

mgsloan commented Dec 23, 2015

Good point, looks like a bug.

@luigy
Copy link
Contributor

luigy commented Dec 23, 2015

In the meantime I think you can get around it by:

stack ghci --ghci-options "-package base16-bytestring" --package base16-bytestring presta-lib:lib

@mgsloan I wonder if it should be the default to pass a formatted ghciAdditionalPackages to ghci
Are there any edge cases to consider, though?

@mgsloan
Copy link
Contributor

mgsloan commented Dec 29, 2015

@luigy I don't think there are any funky edge cases. I've pushed a couple commits resolving this.

Feel free to re-open if the problem is still around after these changes.

@mgsloan mgsloan closed this as completed Dec 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants