I notice that Stack supports using a package.yaml
file that it will use to generate a .cabal
file. For example, yi-core/package.yaml. Its structure seems very similar to a Cabal file, but not quite the same. Some of the keys have been renamed (for example, Stack uses source-dirs
instead of hs-source-dirs
).
I haven't found any documentation on this feature. The Stack docs don't seem to mention package.yaml
at all. Does a specification exist?
yaml file, which specifies how to build a set of packages. We define package to be a package with a Cabal file or an Hpack package. yaml file. In your project-specific options, you specify both which local packages to build and which dependencies to use when building these packages.
stack. yaml contains project-level configuration for Stack, and may contain project-specific options and non-project-specific options. package. yaml contains a description of a package in the Hpack format. Hpack, including Stack's built-in version, uses the file to create a Cabal file.
Stack installs the Stackage libraries in ~/. stack and any project libraries or extra dependencies in a . stack-work directory within each project's directory.
stack build takes a list of one or more optional targets to be built. The supported syntaxes for targets are: package, e.g. stack build foobar , is the most commonly used target. It will try to find the package in the following locations: local packages, extra deps, snapshots, and package index (e.g. Hackage).
This is hpack, available here: https://github.com/sol/hpack
It's a slightly different package format, and, as you say, can be used to generate cabal files. It isn't directly tied to stack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With