stack build exiting with 'cannot find package' error when external packages are involved

186 views
Skip to first unread message

jackes...@gmail.com

unread,
Oct 20, 2017, 12:57:37 AM10/20/17
to haskell-stack
I just got started learning Haskell. And I chose to work with it on my PC through stack. First day, I worked with Chris Allen's tutorial and got stuck at the `stack build` part of it. The command exited with an error as shown below:

    C:\Users\USER\haskellProjects\bassbull>stack build
    primitive-0.6.2.0: download
    integer-logarithms-1.0.2: download
    primitive-0.6.2.0: configure
    primitive-0.6.2.0: build
    integer-logarithms-1.0.2: configure
    integer-logarithms-1.0.2: build
    primitive-0.6.2.0: copy/register
    integer-logarithms-1.0.2: copy/register
    Progress: 2/11Running C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\
    ghc-8.0.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapsho
    ts\1602ab97\pkgdb describe --simple-output integer-logarithms --expand-pkgroot e
    xited with ExitFailure 1

    WARNING: cache is out of date: C:/Users/USER/AppData/Local/Programs/stack/x86_64
    -windows/ghc-8.0.2\lib\package.conf.d\package.cache
    ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix.
    ghc-pkg.EXE: cannot find package integer-logarithms

    Running C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\
    ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\1602ab97\pk
    gdb describe --simple-output primitive --expand-pkgroot exited with ExitFailure
    1

    WARNING: cache is out of date: C:/Users/USER/AppData/Local/Programs/stack/x86_64
    -windows/ghc-8.0.2\lib\package.conf.d\package.cache
    ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix.
    ghc-pkg.EXE: cannot find package primitive

    C:\Users\USER\haskellProjects\bassbull>stack exec ghc-pkg recache

    C:\Users\USER\haskellProjects\bassbull>stack build
    integer-logarithms-1.0.2: configure
    integer-logarithms-1.0.2: build
    primitive-0.6.2.0: configure
    primitive-0.6.2.0: build
    integer-logarithms-1.0.2: copy/register
    primitive-0.6.2.0: copy/register
    Progress: 2/11Running C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\
    ghc-8.0.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapsho
    ts\1602ab97\pkgdb describe --simple-output primitive --expand-pkgroot exited wit
    h ExitFailure 1

    ghc-pkg.EXE: cannot find package primitive

    Running C:\Users\USER\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\
    ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\1602ab97\pk
    gdb describe --simple-output integer-logarithms --expand-pkgroot exited with Exi
    tFailure 1

    ghc-pkg.EXE: cannot find package integer-logarithms

    C:\Users\USER\haskellProjects\bassbull>

After trying out other tutorials I concluded that this happened only when trying to install external packages and dependencies.

Please I need help getting past this challenge I am facing, as I am very much enthusiastic about learning to code in (and coding in) Haskell.

Michael Sloan

unread,
Oct 20, 2017, 1:17:42 AM10/20/17
to jackes...@gmail.com, haskell-stack
Hi!

Which version of stack are you using?  Seems similar to this old fixed bug https://github.com/commercialhaskell/stack/issues/1232

How was it installed?  If via the haskell platform, that sometimes doesn't work very well.  Usual installation is to just install stack, and it can install other tools.

If you are on an up-to-date version (1.5.1), then perhaps try deleting the dir at "stack path --stack-root", and also deleting the ".stack-work" in your current directory.

Hope that helps!
-Michael


--
You received this message because you are subscribed to the Google Groups "haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stack+unsubscribe@googlegroups.com.
To post to this group, send email to haskel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/950fceda-72e5-467e-ba9a-3f5d8dba78c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jack Essien

unread,
Oct 20, 2017, 7:57:53 AM10/20/17
to haskell-stack
Hello Michael,

Thank you for responding to my message.

In the light of your prescription and that of another friendly Haskeller on Google+ I decided to start afresh.

  • I had felt my antivirus was messing things up (in retrospect, the signs started showing up weeks back) so I updated it.
  • I did a clean uninstall of stack (never had the Haskell platform), hunted down its associated files/folders and wiped them off.
  • Then I reinstalled stack.
  • And started again with Chris Allen's tutorial.
  • I made sure to be connected to a steady network while doing `stack setup` for the first time, so that everything got downloaded with ease (the other time, connection timed out endlessly while fetching ghc and msys).
  • When that was done, I restarted the shell.
  • ... and `stack build` completed successfully.

Now, I don't know exactly what did it for me, but I would love to. If it helps, I was (and I'm still) using stack-1.5.1 on a 64-bit windows7 PC.

Thank you for your kind disposition. Now I don't have to dump Haskell for F#.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.

Michael Sloan

unread,
Oct 20, 2017, 7:59:34 AM10/20/17
to Jack Essien, haskell-stack
Great, glad it worked out!

Happy haskelling!
-Michael

To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stack+unsubscribe@googlegroups.com.

To post to this group, send email to haskel...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages