Upgrading Library in stack Project?

14 views
Skip to first unread message

Kevin Meredith

unread,
May 16, 2017, 7:14:33 AM5/16/17
to haskell-stack
What's the correct way to upgrade libraries in a stack project?

In my project, I have both a stack.yaml and cabal.config. The former only contains the Haskell version:

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-8.13

However, the cabal.config contains a bunch of libraries' versions:

$head cabal.config 
-- Please place this file next to your .cabal file as cabal.config
-- To only use tested packages, uncomment the following line:
-- remote-repo: stackage-lts-8.12:http://www.stackage.org/lts-8.12
constraints: abstract-deque ==0.3,
             abstract-par ==0.3.3,
             AC-Vector ==2.3.2,
             accelerate ==0.15.1.0,
             accuerr ==0.2.0.2,
             ace ==0.6,

If I wanted to upgrade a library in my project, how would I do that? 

Thanks,
Kevin

Adam Bergmark

unread,
May 16, 2017, 7:16:10 AM5/16/17
to Kevin Meredith, haskell-stack
I'm not sure if there's a better way to refer to cabal.configs, but you can replace it by the latset one: https://www.stackage.org/lts-8.13/cabal.config

--
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-stac...@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/9fa4682d-3c55-4cc5-a04f-7994d5786525%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Meredith

unread,
May 16, 2017, 7:53:09 AM5/16/17
to haskell-stack
I'll try that. Thanks, Adam.

For my own learning, what's the meaning of this file?

It seems to be a listing of all Haskell LTS 8.13 libraries? Is that because Hackage hosts all Haskell libraries? 

Adam Bergmark

unread,
May 16, 2017, 8:02:57 AM5/16/17
to Kevin Meredith, haskell-stack
When using stack you simply refer to a snapshot by name, it essentially contains the same information as this cabal.config (while adding a lot of extra information) and is downloaded only once and stored somewhere in ~/.stack. AFAIK cabal-install doesn't allow you to refer to snapshots like this (maybe you can refer to a URL somehow?), I think you need the actual contents in a local cabal.config.

All packages in a stackage snapshot must be available on hackage which is why you can use it for cabal-install as well. So for cabal-install there is no dependency towards stack/stackage infrastructure once you've gotten this file, as it has no support for it.


HTH,
Adam


Dan Burton

unread,
May 16, 2017, 11:23:53 AM5/16/17
to Adam Bergmark, Kevin Meredith, haskell-stack
Note that stack.yaml is used by stack and ignored by cabal-install, while cabal.config is used by cabal-install and ignored by stack. The only reason to have both in your project is if you are accommodating both stack and cabal-install for building your project from the source repository. If you are only using stack to build your project, then you can safely delete the cabal.config.

-- Dan Burton

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/95451ba7-a49a-45d8-892e-57c029908849%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.
Reply all
Reply to author
Forward
0 new messages