简体   繁体   中英

Is the stack.yaml file supposed to be checked into version control?

I'm quite new to stack and wondering whether to git commit or .gitignore that file.

What are the implications of either of these choices?

I'd say you should commit stack.yaml , as that makes it much easier to build your package in a reproducible way. That is particularly relevant if your repository is public, and if you use the more exotic kinds of extra-deps in stack.yaml (pointers to Git repositories, secondary cabal packages within your source tree, etc.).

A complementary observation is that we should still provide reasonable version bounds for dependencies in the .cabal file even if we are using stack, as doing otherwise would make life harder for people who don't use stack or have a set of packages different than the specified by stack.yaml .

Yep. stack.yaml has a whole bunch of (not always necessary) fields such as the extra dependencies that matter for consistent builds. Check it in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM