Closed
Description
If a --stack-yaml
option in a stack script is ignored then why is it parsed?
Line 144 in 035ffea
If I comment out the resolver line then the parse fails:
message: "This is a stack.yaml file for a script."
allow-newer-deps:
- dhall
allow-newer: true
# resolver: nightly-2024-05-18
I struck this when trying to set the resolver on-the-fly with:
$ GHC_VERSION=9.8.2 STACKAGE_VERSION=nightly-2024-05-18 make -f project-files.mk stack.yaml
...
Ignoring override stack.yaml file for script command: /.../stack.script.yaml
Error: [S-6602]
Stack could not load and parse
/.../stack.script.yaml as a YAML configuraton file.
While loading and parsing, Stack encountered the following error:
Aeson exception:
Error in $: failed to parse field "snapshot": keys ["snapshot","resolver"] not present
For help about the content of Stack's YAML configuration files, see (for the most recent
release of Stack) http://docs.haskellstack.org/en/stable/yaml_configuration/.
...
This is the script header:
#!/usr/bin/env stack
-- stack script --resolver=nightly-2024-05-18 --package=base --package=dhall --package=filepath --package=text --stack-yaml=stack.script.yaml