简体   繁体   English

stack.yaml文件应该被检入版本控制吗?

[英]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. 我是一个很新的堆栈 ,想知道是否git commit.gitignore该文件。

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. 我会说你应该提交stack.yaml ,因为这样可以更容易地以可重现的方式构建你的包。 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.). 如果您的存储库是公共的,并且如果您在stack.yaml使用更具异国情调的额外deps(指向Git存储库的指针,源树中的二级cabal包等),那么这一点尤为重要。

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 . 一个补充的观察是我们仍然应该为.cabal文件中的依赖项提供合理的版本边界,即使我们正在使用堆栈,否则会使那些不使用堆栈或拥有一组不同于由stack.yaml指定。

Yep. 是的。 stack.yaml has a whole bunch of (not always necessary) fields such as the extra dependencies that matter for consistent builds. stack.yaml有一大堆(并非总是必要的)字段,例如对于一致构建很重要的额外依赖项。 Check it in. 检查一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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