Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What goes in a Stack package.yaml file?

Tags:

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?

like image 758
Chris Martin Avatar asked Oct 30 '16 18:10

Chris Martin


People also ask

What is a package Yaml file?

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.

What is stack Yaml?

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.

Where does stack install packages?

Stack installs the Stackage libraries in ~/. stack and any project libraries or extra dependencies in a . stack-work directory within each project's directory.

What does stack build do?

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).


1 Answers

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.

like image 197
kosmikus Avatar answered Sep 21 '22 07:09

kosmikus