-
Notifications
You must be signed in to change notification settings - Fork 247
Add project.plan-nix.freeze
#1055
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do if the user supplied a freeze file? Does it overwrite it? That would be bad, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point it is running in a temp dir. It seems to do a
v2-configure
then save out the new version over the top.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems wrong? If the user gives us a freeze file (and this function takes one) then surely we should use that unequivocally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used by cabal. The existing freeze file may not include constraints for all the packages. The one cabal outputs will be more complete. For instance if I just include
constraints: any.base ==4.14.1.0
in freeze file:I get the same output for
constraints: any.base ==4.*
, but forconstraints: any.base ==5.*
cabal v2-freeze
fails to find a solution. I don't know if there is a way to tellcabal
to be more strict and require all the constraints to be in thecabal.project.freeze
file. I guess if there is not we could build one by comparing the original version with the one it spits out and returning an error if they differ.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, if it includes the constraints from the input freeze file and gives you one with strictly more constraints then I'm fine with it. Worth a comment, though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure it will be "strictly more constraints". I suspect that if the input freeze file includes a constraint on a package that is not picked at all (
Win32
for instance when building for linux), the output may not include a constraint at all.I don't think that is something we should fix in Haskell.Nix though (it seems more like a
cabal v2-freeze
problem). I have added a comment describing.freeze
asThe 'cabal.project.freeze' file created by 'cabal v2-freeze'
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added: