Stack solver --resolver lts-21.9 not working

hh@192 src % stack solver --resolver lts-21.9
Invalid argument `solver'
Auxiliary command not found in path `stack-solver'
File does not exist or is not a regular file `solver'

Usage: stack [--help] [--version] [--numeric-version] [--hpack-numeric-version] 
             [--docker*] [--nix*] 
             [--verbosity VERBOSITY | (-v|--verbose) | --silent] 
             [--[no-]time-in-log] [--stack-root STACK-ROOT] 
             [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc] 
             [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD] 
             [-j|--jobs JOBS] [--extra-include-dirs DIR] [--extra-lib-dirs DIR] 
             [--custom-preprocessor-extensions EXT] [--with-gcc PATH-TO-GCC] 
             [--with-hpack HPACK] [--[no-]skip-ghc-check] [--[no-]skip-msys] 
             [--local-bin-path DIR] [--setup-info-yaml URL] 
             [--[no-]modify-code-page] [--[no-]allow-different-user] 
             [--[no-]dump-logs] [--color|--colour WHEN] 
             [--snapshot-location-base URL] [--resolver RESOLVER] 
             [--compiler COMPILER] [--[no-]terminal] 
             [--stack-colors|--stack-colours STYLES] [--terminal-width INT] 
             [--stack-yaml STACK-YAML] [--lock-file ARG] COMMAND|FILE
hh@192 src % 

stack.yaml:

# This file was automatically generated by 'stack init'
#
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# https://docs.haskellstack.org/en/stable/yaml_configuration/

# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
#
# resolver: lts-3.5
# resolver: nightly-2015-09-21
# resolver: ghc-7.10.2
# resolver: ghcjs-0.1.0_ghc-7.10.2
# resolver:
#  name: custom-snapshot
#  location: "./custom-snapshot.yaml"
resolver: lts-16.23

# User packages to be built.
# Various formats can be used as shown in the example below.
#
# packages:
# - some-directory
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
# - location:
#    git: https://github.com/commercialhaskell/stack.git
#    commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a
#   extra-dep: true
#  subdirs:
#  - auto-update
#  - wai
#
# A package marked 'extra-dep: true' will only be built if demanded by a
# non-dependency (i.e. a user package), and its test suites and benchmarks
# will not be run. This is useful for tweaking upstream packages.
packages:
- .
- common
- optimization

# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
  - QuickCheck-GenT-0.2.2
  - megaparsec-8.0.0
  - parser-combinators-1.2.1
  - libBF-0.6.2@sha256:7bffc0e4dbc9bd9e851ba5c29255b62fd2c288dbc9a401cd3761b740f013775e,1770
  - sbv-8.15
  # - git: https://github.com/LeventErkok/sbv.git
  #   commit: 4c246e1201e003ed8698a8c31b0b2f5e59c3312a
  - git: https://github.com/serokell/haskell-with-utf8
    commit: 63b26842bec2da71f4b822d2dff14640e63a63e5
  - monadlist-0.0.2@sha256:978305e3f03dd5f65c673b551124dac0c39a247c2c14d84739ca9a3405fbb63a,904

# Override default flag values for local packages and extra-deps
# flags: {}

# Extra package databases containing global packages
# extra-package-dbs: []

# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=1.6"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor

# local-bin-path: ../dist/build

There’s no such command. What do you expect it to do?

mine project use lts-16.23 , i wants to upgrade it to lts-21.9

Got below error if updating the stack.yaml manually

In that S-4804 error message, the ‘Stack configuration’ refers to the set of package versions in the specified snapshot (resolver) plus specified extra-deps, specified in your Stack project-level configuration file (stack.yaml). For example, megaparsec-8.0.0 needs bytestring >=0.2 && <0.11 but you have (effectively) specified bytestring-0.11.5.1.

In respect of the S-2673 error, I anticipate that stack purge will clean things up.

EDIT: If you are making a big jump in the snapshot (resolver) (here, from lts-16.23 (GHC 8.8.4) to lts-21.9 (GHC 9.4.6)) my advice would be to first ‘comment out’ the existing extra-deps and then re-introduce what Stack suggests might be needed.

2 Likes

stack solver was removed in Stack 2.1.1 (in 2019) - see Version history - The Haskell Tool Stack. Stack now focusses on the " ‘curated package set’ use case" - see Contributor's guide - The Haskell Tool Stack - which, in practice, means Stack focusses on the use of the sets of package versions that work well together that are published by Stackage.

2 Likes