Skip to content

Conversation

@thomasjm
Copy link
Contributor

Bumps a few bounds to build with GHC 9.8 on the latest Stackage resolver (nightly-2024-07-22).

Also fixes the support for base64 > 0.4. The initial support was landed in #91, but seems not to match what eventually happened in the base64 package. Version 0.5 never existed, as the version was bumped all the way to 1.0 with a breaking API change.

Also checks in a small stack.yaml file to make it easy to test with the latest resolver.

@thomasjm
Copy link
Contributor Author

thomasjm commented Feb 7, 2025

Hi @qnikst, any chance you could take a look at this? It would be great to get a GHC 9.8 compatible version on Hackage.

supersven added a commit to wireapp/HaskellNet that referenced this pull request May 8, 2025
Changes taken from qnikst#98 (but we
don't want to rely on foreign forks.)
Copy link

@intricate intricate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @qnikst, would you be open to looking at this?

If there are any changes that you'd suggest for this PR, and @thomasjm isn't available to implement them, I'd be happy to do it.

@qnikst
Copy link
Owner

qnikst commented May 24, 2025

Thanks for PR! I agree with comments of @intricate.

<0.5 was for purpose, the same is <1.1 in the current. For the support we should either drop all CPP checks of base64 in the codebase or extend it to keep support of the wider range. In the current case I don’t see a huge need in the wider range.

for splitting PR I’m ok with updating stack and base64 in one PR, as commits are separate and they are logically related.

once that will be done I’ll be happy to merge, fix CI and release a new version.

@thomasjm
Copy link
Contributor Author

Cool!

<0.5 was for purpose, the same is <1.1 in the current. For the support we should either drop all CPP checks of base64 in the codebase or extend it to keep support of the wider range.

Now that I look at this again, I'm not sure why I removed some of the CPP. I think it might be slightly incorrect on master due to #91. Anyway, I think I'd actually favor keeping the wider range. This package makes pretty minor use of base64, so we can do this at the cost of only a few lines of CPP.

I think this is worth doing, since current Stackage release generations still use base64-0.4.2.4 or similar -- such as LTS 22.44 for the GHC 9.6 series, released 3 weeks ago.

Does that sound okay @qnikst ? Let me know and I'll add (correct) CPP to support all versions.

@qnikst
Copy link
Owner

qnikst commented May 24, 2025

Sounds great, thanks @thomasjm!

@thomasjm thomasjm force-pushed the ghc98-and-fix-base64-support branch from 8f87a8e to f91e223 Compare May 27, 2025 00:26
@thomasjm
Copy link
Contributor Author

Okay @qnikst, this is ready for another look. I figured out why I removed the CPP, it is not necessary for the encode direction since the API didn't change; it remains needed for the decode direction.

I did a couple more things which you can see commit by commit:

  • Fix some minor warnings. A name shadowing issue, a redundant import, and some redundant cases that are detected and warned about by modern GHCs.
  • I exported the functions fetchPeek and fetchRPeek, which are not used locally and not exported. They sort of look intended for external consumption. You can ignore this commit if you don't want to export them.
  • I took the liberty of modernizing the CI, using the approach I use in my other projects. The matrix tests Cabal and Stack. Cabal gets tested on Linux and MacOS. GHC versions are all green from 8.10.7 to 9.12.2.

Copy link

@intricate intricate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

edit: Nevermind my comment about non-exhaustive pattern matches.

Comment on lines -162 to -164
(AUTH _ _ _) -> error "BUG: AUTH should not get matched here"
(RETR _) -> error "BUG: RETR should not get matched here"
(TOP _ _) -> error "BUG: TOP should not get matched here"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about my previous comment on these non-exhaustive pattern matches.

I didn't notice that some of these patterns are being matched at the sendCommand function-definition "level" and then redundantly being matched in this case again.

I wonder if this should be further addressed in a follow up. To make this code more clear, it seems like there should only be one definition of sendCommand and a single case pattern match on command.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recent GHC versions understand these matches are redundant and warn about them, so I was just fixing a couple warnings. Further refactoring could certainly happen as a follow-up.

@thomasjm
Copy link
Contributor Author

thomasjm commented Jun 2, 2025

Hi @qnikst, this should be ready to go!

@qnikst
Copy link
Owner

qnikst commented Jun 8, 2025

Great job, thanks!

@qnikst qnikst merged commit f19c889 into qnikst:master Jun 8, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants