-
Notifications
You must be signed in to change notification settings - Fork 3
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
Compatibility with optparse-applicative-0.18
#284
Compatibility with optparse-applicative-0.18
#284
Conversation
What's up with your CI? |
@andreasabel thank you for this PR. We are currently switching from Buildkite to GitHub Actions in #267. I hope we'll finish soon and then CI might start working in this PR after rebasing on the latest |
Thanks for the heads up, @gromakovsky ! I leave further handling of this PR to you, please use/modify it in any way you want. |
@@ -768,7 +768,7 @@ checkExternalResource followed config@Config{..} link | |||
other -> throwError $ ExternalResourceSomeError $ show other | |||
where | |||
retryAfterInfo :: Response a -> Maybe RetryAfter | |||
retryAfterInfo = readMaybe . decodeUtf8 <=< L.lookup hRetryAfter . responseHeaders | |||
retryAfterInfo = readMaybe . decodeUtf8 @Text <=< L.lookup hRetryAfter . responseHeaders |
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.
In this case, readMaybe
comes from Text.Read
and takes a String
parameter, so it does not compile for me unless this type parameter application is removed.
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 was surprised that I had to add it, because it is orthogonal to the concern of this PR, namely optparse-applicative
.
Let me investigate some more...
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.
So indeed stack build
fails now (which uses LTS 19 which is GHC 9.0), but cabal build -w ghc-9.2.8
succeeds and needs this change.
I am gonna remove this patch, it is something to be sorted out when migrating from GHC 9.0 to 9.2 and up.
(Note that GHC 9.2.8 is the currently recommended version of GHC.)
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.
Yes, it should be updated at some point. I will create an issue referencing this comments thread. Thank you!
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.
NB: cabal build -w ghc-9.0.2
fails because of:
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 can reproduce it with the stack build, but it does not happen when built with GHC 9.2.8 on cabal. However, the stack build uses |
So all the points that I mentioned seem to be related to the GHC version difference. We will go back to this PR when upgrading the stack setup, probably after finishing the ongoing CI work! |
Not knowing about this PR, I ended up with a similar fix in 74ed941. So I think all relevant changes are now in |
optparse-applicative-0.18
switched toprettyprinter
, so some reexports are missing now.text
no longer exported fromOptions.Applicative.Help.Pretty
pcapriotti/optparse-applicative#481This PR restores compatibility with the latest
optparse-applicative
.I simplified the code to display the help text, but the rendering still looks fine:
So maybe the code was unnecessary complicated to begin with.
On hackage I added upper bound
optparse-applicative < 0.18
, e.g. https://hackage.haskell.org/package/xrefcheck-0.2.2/revisions/.