Skip to content

Why parse only to ignore --stack-yaml in a script? #6600

Closed
@philderbeast

Description

@philderbeast

If a --stack-yaml option in a stack script is ignored then why is it parsed?

"Ignoring override stack.yaml file for script command: "

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions