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 ghci` tries to load multiple versions of `text` #867

Closed
zudov opened this Issue Aug 27, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@zudov
Contributor

zudov commented Aug 27, 2015

I am using stack to build purescript with lts-3.2. My ghc is installed system-wide, and I also have several libraries installed system-wide.

While stack build works flawlessly, stack ghci tries to use text-1.2.1.3
(from lts-3.2) and text-1.2.0.6 simultaneously which causes an error:

[ 13 of 110] Compiling Language.PureScript.Names ( Language/PureScript/Names.hs, interpreted )

Language/PureScript/Names.hs:91:52:
    Couldn't match expected type T.Text
                with actual type text-1.2.0.6:Data.Text.Internal.Text
    NB: T.Text
          is defined in Data.Text.Internal in package text-1.2.1.3
        text-1.2.0.6:Data.Text.Internal.Text
          is defined in Data.Text.Internal in package text-1.2.0.6
    In the first argument of T.unpack, namely str
    In the second argument of splitOn, namely (T.unpack str)
zudov@x200 ~/prog/haskell/purescript $ stack exec -- ghc-pkg list text
/usr/lib64/ghc-7.10.2/package.conf.d
   text-1.2.0.6
/home/zudov/.stack/snapshots/x86_64-linux/lts-3.2/7.10.2/pkgdb
   text-1.2.1.3
/home/zudov/prog/haskell/purescript/.stack-work/install/x86_64-linux/lts-3.2/7.10.2/pkgdb

Here is an output of stack ghci --verbose: paste.

I can reproduce it using latest stack release (0.1.3.1) and stack from master branch
(commit 478ca71).

@zudov

This comment has been minimized.

Contributor

zudov commented Aug 27, 2015

Related issue #127

@chrisdone

This comment has been minimized.

Member

chrisdone commented Aug 28, 2015

Interesting....

@snoyberg snoyberg added this to the GHCi milestone Aug 30, 2015

@borsboom borsboom modified the milestones: GHCi, P2, P1 Sep 12, 2015

@zudov

This comment has been minimized.

Contributor

zudov commented Sep 17, 2015

I've also got it appear with both transformers-0.4.2.0 and transformers-0.4.3.0 installed in a global database.

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Sep 30, 2015

My best bet here is that the usage of -package= instead of -package-id is giving GHC too much freedom in choosing specific installed instances of packages, leading to this confusion. @chrisdone is it possible to use GhcPkgIds instead?

snoyberg added a commit that referenced this issue Sep 30, 2015

@snoyberg snoyberg self-assigned this Sep 30, 2015

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Sep 30, 2015

@zudov I've just pushed a new branch, 867-ghci-package-id, which may fix the problem, can you test it?

@chrisdone See PR #1082

@zudov

This comment has been minimized.

Contributor

zudov commented Oct 1, 2015

I made sure that the problem is gone, created even more entropy in my global database than I originally had and reproduced it without a patch, then tried it with patched stack and it worked perfectly.

👍 Thanks a lot

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Oct 1, 2015

Cool, thanks for the confirmation. I'm going to close this issue, and any problems with the patch can be discussed in the PR.

@snoyberg snoyberg closed this Oct 1, 2015

@snoyberg snoyberg removed the in progress label Oct 1, 2015

snoyberg added a commit that referenced this issue Oct 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment