Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should stack.yaml.lock be checked into source control?

Since stack v2, stack produces a stack.yaml.lock file.

Should this file be committed to source control, like stack.yaml? Or should it be .gitignored?

On the one hand it's generated content and isn't source, on the other hand it contains hashes of the dependencies from Hackage so it is necessary for a safe reproducible build..

like image 750
yairchu Avatar asked Nov 04 '20 14:11

yairchu


1 Answers

Yes. This is part of the reason that lock files exist: reproducible builds.

These files can be stored in source control Users on other machines can reuse these lock files and get identical build plans given that the used local packages and local snapshots are the same on those machines

https://docs.haskellstack.org/en/stable/lock_files/#lock-files

like image 51
Dan Burton Avatar answered Sep 23 '22 18:09

Dan Burton