-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DISCUSS: Policy on including lock files in repo #4795
Comments
Our recommendation should probably be similar to that used by Rust's I agree it'd make sense to enforce no addition/modification of lock files in CI. Not sure if you already have thoughts on how to implement that, but here's what I'm coming up with: run something like Might it make sense to add an option to |
I was leaning in this direction. We may actually consider a forgotten .gitignore update to be a proper bug that blocks CI from passing.
I thought about this too. It should be pretty easy to add such a feature, essentially checking a flag before writing the lock file. I don't see a downside to this, so we may as well add it. How about having a
|
Actually, some more thoughts to go along with the |
I'm in favor of checking them in with a comment that they are autogenerated. And checking that no process writes to them during built. |
@mihaimaruseac why do you want to add some extra care for other processes writing to a lock file during builds? Prevent some race condition maybe? |
No issues yet, this is the discussion for whether we want the feature. The idea is that, in CI, we would want to prevent Stack from making updates to the lock file. Any such an update would indicate that the files in the repo do not guarantee a fully reproducible build. |
Oh, it's the other way around, aimed at reproducibility, that makes sense |
👍 from me — although the yaml package, for example, provides both the (Edit: I guess the main purpose is the library, so you'd probably avoid checking in the lock file?) |
I very quickly threw together a PR for a |
I suppose it comes down to what the primary purpose of the package is. In the case of Rust's documentation uses the term "end product" rather than "executable":
|
I'm going to move this from the Stack 2 milestone to P0. I suggest we complete this issue once Stack 2 is released, and we can update our own CI to demonstrate how things should work. |
There is an issue I ran into with committing lock files into the repository. Specifically when the dependency doesn't come from hackage and uses
As you can see, the git commit didn't change but the sha256 of cabal file did. Making it a policy of including the lock file into the repo would make it very inconvenient for the projects with many developer, who are very likely to be using different versions of stack and hpack. @snoyberg Any thoughts on this? One potential workaround I see around this, while still enforcing this policy would be to insert sha256 and size of |
Yeah, using the SHA of silently auto-generated file seems like a bad idea, and it does seem like it would make more sense to hash the actual source. I could see there being some weird edge cases though, so for example it'd be important to match Stack's build behaviour when there's a remote repo that has both a |
Oh yeah, I know that this ticket is not dedicated to the discussion of hpack and stack integration, but considering it directly affects reproducible builds, I think it is kinda related and somewhat important. My opinion is that this issue could be solved in two ways:
|
Stack 2.1.1 introduced lock files. I'm not sure whether to include them in the repository, here's some discussion on the subject: commercialhaskell/stack#4795
Stack 2.1.1 introduced lock files. I'm not sure whether to include them in the repository, here's some discussion on the subject: commercialhaskell/stack#4795
I've now changed my mind on whether we should include this file. It's caused real problems with clients already and they don't know that they can just remove the lock file when those happen. |
Per this comment, the recommendation is to not commit lock files for libraries: commercialhaskell/stack#4795 (comment)
.stack-work: These are temporary build files *.cabal: The cabal files are generated by stack stack.yaml.lock: commercialhaskell/stack#4795
.stack-work: These are temporary build files *.cabal: The cabal files are generated by stack stack.yaml.lock: commercialhaskell/stack#4795
There is a long discussion in commercialhaskell/stack/issues/4795 about whether this should be done or not (especially see comments in Jan 2020), but for a single-user like me where hpack version is stable, committing this to the repo saves 2½ minutes of the total CI build time, which is currently dominating (total time: 4m10s). So it is definitely worth doing…
I am going to close this issue, because lock files have been committed here for over a year, and nobody has complained about that practice. |
Now that lock files have landed (yay!), we need to establish a policy for the Stack repo on how to deal with them. We should also consider whether we make this policy a general recommendation for Stack users. Possible options I see:
CC @borsboom @qrilka @psibi
The text was updated successfully, but these errors were encountered: