-
Notifications
You must be signed in to change notification settings - Fork 697
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
Avoid partial Data.List.last
in autogenerated Paths_<pkg>.hs
#10432
Conversation
Would it work if Cabal is driving a very old GHC (or non-GHC Haskell implementation) which does not yet have
(The existence of |
I did think about that, but I also think nobody bothers to care about non-GHC any more (I think Data.List.NonEmpty is in all the ghcs we support). That ship sailed long ago, sadly. |
The stated GHC support window for The Cabal project does not identify any support for non-GHC compilers of Haskell. |
My understanding always was that this is a support window for GHC to compile Cabal sources, not which GHC can be driven by Cabal. Changing IIRC Cabal 3.12 was happily able to drive GHC 7.0 and such. |
We stopped being able to test anything before 8.0 because ghcup's only 7-series for Ubuntu segfaults during install. |
@Bodigrim, you are correct - I misunderstood As we know that lastChar c [] = c
lastChar _ (c:cs) = lastChar c cs |
@geekosaur, second attempt at this submitted, hopefully meeting @Bodigrim's observation. The 'required' CI 'Quick jobs / Meta checks' is failing at step 'Check that diff is clean'. I do not know what that is testing, or why it is failing. |
I saw that, and I don't know either (I can't figure out how a commit pushed to GitHub could fail that check??). |
And I just checked out your branch locally, and it's clean here. (Both the diff against @Mikolaj, @Kleidukos do either of you know what's going on here? |
@mpilgrem you'll have to update https://github.com/haskell/cabal/blob/master/templates/Paths_pkg.template.hs according to your changes to Z.hs. See, for example, the previous instance of such a coordinated update: cc8d5df |
Thinking aloud, if it's driving a compiler, not compiling with it, Also thinking aloud, tests would be great, but there's no way to test this, except for adding a STAN run to CI or checking for a new GHC warnings to the same effect (though I don't remember if the new warnings complain about |
4186325
to
e4e3f60
Compare
@ulysses4ever, many thanks. This (final) version now passes the CI. |
Sigh. Still got merged prematurely. |
Motivation (in part):
Data.List.last
I have reasoned that this minor refactoring is correct, but I am not sure how to test it. EDIT: What I have done is:
unit tested
lastChar
in GHCi; andtested that a separate copy of the module does compile.
Patches conform to the coding conventions.
Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions). N/A