Skip to content
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

Support hpack includes #47

Open
TeofilC opened this issue Apr 18, 2024 · 0 comments · May be fixed by #48
Open

Support hpack includes #47

TeofilC opened this issue Apr 18, 2024 · 0 comments · May be fixed by #48

Comments

@TeofilC
Copy link
Contributor

TeofilC commented Apr 18, 2024

Hpack supports "!include" directives to inline the source of other yaml files. See: https://github.com/sol/hpack?tab=readme-ov-file#not-repeating-yourself

This raises two issues:

  • "!include" is a non-standard extension of YAML and isn't supported by "remarshal" so the readYAML function will fail.
  • Usually you will have the included YAML files at the top-level or in a different sub-directory to the package.yaml file and we currently don't have a way to provide this

I have a potential solution and I will create an MR soon.

TeofilC added a commit to TeofilC/stacklock2nix that referenced this issue Apr 18, 2024
Add a `generateCabalFile` argument that allows us to pre-genereate the
cabal file, thus allowing us to create an environment where hpack can
successfully find included files.

We also just read the package.yaml file directly to get the name rather
than by calling readYAML, since include directives lead to unparseable
YAML.

Resolves cdepillabout#47
@TeofilC TeofilC linked a pull request Apr 18, 2024 that will close this issue
TeofilC added a commit to TeofilC/stacklock2nix that referenced this issue Apr 18, 2024
Add a `generateCabalFile` argument that allows us to pre-genereate the
cabal file, thus allowing us to create an environment where hpack can
successfully find included files.

We also just read the package.yaml file directly to get the name rather
than by calling readYAML, since include directives lead to unparseable
YAML.

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

Successfully merging a pull request may close this issue.

1 participant