-
Notifications
You must be signed in to change notification settings - Fork 84
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
Use -XNoStrictData in generated parser (#273) #289
Merged
Changes from all commits
Commits
Show all changes
2 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 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
This file contains 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
This file contains 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.
-X(No)StrictData
is available since GHC-8.0, so this change means thathappy
won't anymore generate code which works with older GHCs.As far as I'm concerned, that is fine, but it's probably a good idea to tell explicitly in the changelog.
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.
... you don't test
master
with older than GHC-8.0, though it might be still buildable with older GHCs? If it weren't, then using new happy with old GHCs will become very unlikely.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.
The trouble is that it has become quite hard to test 7.10 and below in CI.
ghcup
doesn't provide it and I'm not a huge fan of manually setting it up. Besides it is not unlikely that it won't work due to some glibc incompatibility.Besides, GHC 8.0 is quite ancient at this point and I would be happy to drop support for 7.10 and below. The cabal file says as much already, but perhaps we should announce it in the release notes as well.
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 doesn't
It only says that you test with GHC-8.0 and up, not that you don't support oldere GHCs. E.g. you have
so technically cabal would try compile even with GHC-7.0 etc.
And it actually fails, if you test it:
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.
Anyone stuck on GHC < 8.0 is probably also fine with happy < 2.0. Let's not waste time on legacy compiler versions.
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.
@int-index Correct the metadata. Write lower-bounds.
base >=4.9
. Not a hard thing to do. It's not a waste of time.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.
Dependency bounds for the generator itself and dependency bounds for the generated code aren't the same thing.
base >=4.9
is correct as long ashappy
itself builds withbase >=4.9
.I agree that we should bump this bound because, as you point out,
happy-backend-glr
doesn't build with older GHCs. However it's a separate problem unrelated to this PR.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.
As I said, if
happy
itself is not buildable with older GHCs then it's make sense it isn't able to generate code for older GHCs.It could be so that
happy
is buildable only with newer GHCs (say even GHC-9+ only) but supports code generation for older GHCs. (It would be trickier to test but not impossible. E.g.cabal
is buildable with only newer GHCs, but can work with older than that).It would be somewhat confusing if
happy
would be buildable with old GHCs, but not be able to generate code for those old GHCs. Given thatcabal-install
buildshappy
itself (doesn't reuse some global installation), those users would find themselves if complicated situations.So, IMHO, it makes everything somewhat simpler if
happy
itself and generated code has the same support GHC windows. "If you can build ahappy
version with GHC-x.y, thathappy
will generate code which GHC-x.y will handle".In particular, if/when GHC introduces a change, such that
happy
itself is still buildable, but code is not, I'd argue thathappy
shouldn't be buildable.There is no way to declare in
happy.cabal
dependency metadata for the generated code, so at large it's simpler ifhappy
's own build metadata is (re)used also as the generated code dependency metadata. (Similarly as we are currently imprecise in multi-staged or cross-compilation scenarios, using the same bounds for all stages and host&target).