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
feuerbach opened this issue Dec 22, 2015 · 5 comments
Closed

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

feuerbach opened this issue Dec 22, 2015 · 5 comments

Comments

@feuerbach
Copy link
Contributor

@feuerbach feuerbach commented Dec 22, 2015

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

@feuerbach feuerbach commented Dec 22, 2015

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

@feuerbach
Copy link
Contributor Author

@feuerbach feuerbach commented Dec 22, 2015

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 mgsloan commented Dec 23, 2015

Good point, looks like a bug.

@mgsloan mgsloan added this to the P1: Must milestone Dec 23, 2015
@luigy
Copy link
Contributor

@luigy 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 added a commit that referenced this issue Dec 29, 2015
@mgsloan
Copy link
Contributor

@mgsloan 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 Dec 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.