Content-Length: 247202 | pFad | http://github.com/commercialhaskell/stack/issues/6697

12 Use of `--resolver` with `stack ls dependencies`? · Issue #6697 · commercialhaskell/stack · GitHub
Skip to content

Use of --resolver with stack ls dependencies? #6697

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

Open
sol opened this issue Mar 21, 2025 · 3 comments
Open

Use of --resolver with stack ls dependencies? #6697

sol opened this issue Mar 21, 2025 · 3 comments

Comments

@sol
Copy link
Contributor

sol commented Mar 21, 2025

stack ls dependencies does not accept --resolver, which I guess it should?!

@mpilgrem
Copy link
Member

@sol, thanks for reporting, but what are you experiencing? stack ls dependencies does accept, and is affected by, --snapshot/--resolver.

For example, I have:

> stack new test-ls-deps
> cd test-ls-deps
> stack ls dependencies
base 4.19.2.0
ghc-bignum 1.3
ghc-prim 0.11.0
rts 1.0.2
test-ls-deps 0.1.0.0

> stack --snapshot ghc-9.10.1 ls dependencies
base 4.20.0.0
ghc-bignum 1.3
ghc-internal 9.1001.0
ghc-prim 0.11.0
rts 1.0.2
test-ls-deps 0.1.0.0

> stack --resolver ghc-9.6.6 ls dependencies
base 4.18.2.1
ghc-bignum 1.3
ghc-prim 0.10.0
rts 1.0.2
test-ls-deps 0.1.0.0

@sol
Copy link
Contributor Author

sol commented Mar 22, 2025

This is what I tried:

$ stack ls dependencies --resolver lts
Invalid option `--resolver'

Usage: stack ls dependencies [COMMAND | [--[no-]license] [--separator SEP]
                               [--filter ITEM] [--[no-]external]
                               [--[no-]include-base] [--depth DEPTH]
                               [--prune PACKAGES] [TARGET]
                               [--flag PACKAGE:[-]FLAG] [--test] [--bench]
                               [--global-hints]]

  View the packages versions used for a project. Use a command if the first
  target specified has the name of a command. Targets other than project
  packages are ignored.

So I guess "global" stack options have to come before the "env" command here.

What adds to the confusion is that for the "dot" command this restriction does not apply, e.g.

stack dot --resolver nightly

seem to work just fine.

Feel free to close as won't fix.

@mpilgrem mpilgrem changed the title stack ls dependencies should accept --resolver Use of --resolver with stack ls dependencies? Mar 22, 2025
@mpilgrem
Copy link
Member

For convenience, most of the top-level commands have a 'hidden' (and undocumented) parser that parses the 'global' options 'a second time around'. That includes dot and, actually, ls. So you can command:

stack --snapshot nightly ls depencencies text
stack ls --snapshot nightly dependencies text

however, that UI 'trick' does not extend as far as the subcommands or the sub-subcommands. So you can't command:

stack ls dependencies --snapshot nightly text
stack ls dependencies text --snapshot nightly

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

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/commercialhaskell/stack/issues/6697

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy