stack list available resolvers from command line

Created on 14 Aug 2016  Â·  5Comments  Â·  Source: commercialhaskell/stack

There is a JSON list of resolvers on stackage, but it is not exposed to the user:

https://github.com/commercialhaskell/stack/blob/4a560330bd447852171ad5e18d668732977d869c/src/Stack/Config/Urls.hs#L15

There is interest in this, see this stack overflow issue for example: http://stackoverflow.com/questions/33025071/list-available-stack-build-plans

How can I get the list of available build plans for stack? ... is there a way to get that on the cmdline?

discuss enhancement

Most helpful comment

@DestyNova I just discovered stack ls snapshots --lts remote:

$ stack ls snapshots --lts remote | cat
a month ago

Resolver name: lts-13.27
LTS Haskell 13.27 (ghc-8.6.5)

Resolver name: lts-13.26
LTS Haskell 13.26 (ghc-8.6.5)

Resolver name: lts-13.25
LTS Haskell 13.25 (ghc-8.6.5)

3 weeks ago

Resolver name: lts-13.28
LTS Haskell 13.28 (ghc-8.6.5)

2 weeks ago

Resolver name: lts-13.29
LTS Haskell 13.29 (ghc-8.6.5)

a week ago

Resolver name: lts-13.30
LTS Haskell 13.30 (ghc-8.6.5)

All 5 comments

Similarly it would be nice to be able to look up snapshots by compiler version. (That would have been useful for https://github.com/commercialhaskell/stack/issues/2473.)

Was this implemented? I can't figure out how to do it from the stack documentation, and it seems really awkward to have to switch to the browser and look up an arbitrary URL to find some information that is obviously already available to the stack CLI program.

@DestyNova I just discovered stack ls snapshots --lts remote:

$ stack ls snapshots --lts remote | cat
a month ago

Resolver name: lts-13.27
LTS Haskell 13.27 (ghc-8.6.5)

Resolver name: lts-13.26
LTS Haskell 13.26 (ghc-8.6.5)

Resolver name: lts-13.25
LTS Haskell 13.25 (ghc-8.6.5)

3 weeks ago

Resolver name: lts-13.28
LTS Haskell 13.28 (ghc-8.6.5)

2 weeks ago

Resolver name: lts-13.29
LTS Haskell 13.29 (ghc-8.6.5)

a week ago

Resolver name: lts-13.30
LTS Haskell 13.30 (ghc-8.6.5)

Thanks @sjakobi, that's really helpful! Did you find any documentation on those options? It'd be good if you could filter by GHC version etc, rather than just getting the last few snapshots.
That's exactly what I needed though :+1:

@DestyNova No, I couldn't find any documentation. ls snapshots remote seems to simply return a list of the most recent Stackage snapshots, and you can use --lts or --nightly to filter that list.

I don't think you can use it to find a snapshot for e.g. GHC-8.2 or so.

Was this page helpful?
0 / 5 - 0 ratings