Allows stack.yaml files to use !include directives - #6880
Merged
Merged
Conversation
This allows projects that maintain multiple `stack.yaml` files (e.g. for testing against multiple LTS versions) to reduce the duplication between them by using includes to share common parts. `!include` may also be used in `config.yaml` files. The use of `!include` interferes with the ability of the `config set` command to determine where to change a setting that has been read while parsing JSON, so thes makes `config set` raise error if `!include` appears in the file being updated. Fixes commercialhaskell#6879
2 tasks
Member
|
@qxjit, I am wondering if it is a bit harsh for
|
Contributor
Author
|
@mpilgrem I think that's a good idea. I'll make that change when I get a moment. |
This moves the check for `!include` when executing `config set` to after the detection of keys in the config so that values directly present in the file can be set even when `!include` is present.
mpilgrem
reviewed
Apr 22, 2026
mpilgrem
left a comment
Member
There was a problem hiding this comment.
Some further comments prompted by the failing CI.
Contributor
Author
|
@mpilgrem Thanks for taking care of the integration test failure. I was hoping to get to that today, but you beat me. ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows projects that maintain multiple
stack.yamlfiles (e.g. for testing against multiple LTS versions) to reduce the duplication between them by using includes to share common parts.!includemay also be used inconfig.yamlfiles.The use of
!includeinterferes with the ability of theconfig setcommand to determine where to change a setting that has been read while parsing JSON, so thes makesconfig setraise error if!includeappears in the file being updated.Note: Fixes for the online documentation of the current Stack release
(https://docs.haskellstack.org/en/stable/) should target the 'stable' branch,
not the 'master' branch.
Please include the following checklist in your pull request:
Please also shortly describe how you tested your change. Bonus points for added tests!
Integration tests were added!
Fixes #6879