-
Notifications
You must be signed in to change notification settings - Fork 103
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
Feature request: add option to omit hash #380
Comments
Yes please! This would absolutely be a more useful default for me when using stack. Regenerating based on modification time would be just fine, and I don’t need to know which version of hpack it was. This would mean I no longer have to commit cabal file updates separately to avoid conflicts. (And committing cabal files is essential for interop with the non hpack world, and for calming the anti-hpack drumbeat in #haskell btw). |
#390 addresses my request. |
As already hinted at #390 (comment), I'm tempted to remove the |
Problem
The generated cabal file has a hash at the top. Example:
The hash is useful for checking whether or not to regenerate the cabal file and save directory traversals and the other work hpack does.
However, it forces a source-control conflict every time the backed
package.yaml
is updated in separate commits and if the generated cabal file is in source control.Having the generated file in source control has its tradeoffs, but there are reasons why one would want to do so. One reason is to avoid unnecessary work. Another reason is having consistent builds, which may be affected by having to generate files. I mention these reasons not because everyone should do this, but because there are reasonable reasons to check-in the generated cabal file, and doing so has the effect of frequent source conflicts.
Proposed solution
Add option
Add an option in the
package.yaml
file to omit generating the hash.Proposed option:
hpack-hash
specified as an optional top-level attribute of type boolean with default value oftrue
.Other choices:
generated-hash
or justhash
.Behavior
In terms of hpack behavior, always regenerate the cabal file seems the most correct course of action. However it is not the most efficient. But perhaps that is the tradeoff of using this feature.
The text was updated successfully, but these errors were encountered: