-
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
Doctest is failing in CI #9307
Comments
One observation is that the
has appeared before but didn't seem to hurt. It almost looks like GHC < 9.4 interpreted Needs more thought... |
I feel like |
Could you try with 9.2? My experiment was as follows: ❯ cat main.hs
main = print 42
❯ ghc-9.4.4 -fforce-recomp -Wall -Werror -w main.hs
[1 of 2] Compiling Main ( main.hs, main.o )
[2 of 2] Linking main [Objects changed]
❯ ghc-9.2.7 -fforce-recomp -Wall -Werror -w main.hs
[1 of 1] Compiling Main ( main.hs, main.o )
Linking main ...
❯ ghc-9.4.4 -fforce-recomp -w -Wall -Werror main.hs
[1 of 2] Compiling Main ( main.hs, main.o )
main.hs:1:1: error: [-Wmissing-signatures, -Werror=missing-signatures]
Top-level binding with no type signature: main :: IO ()
|
1 | main = print 42
| ^^^^
main.hs:1:8: error: [-Wtype-defaults, -Werror=type-defaults]
• Defaulting the type variable ‘a0’ to type ‘Integer’ in the following constraints
(Show a0) arising from a use of ‘print’ at main.hs:1:8-12
(Num a0) arising from the literal ‘42’ at main.hs:1:14-15
• In the expression: print 42
In an equation for ‘main’: main = print 42
|
1 | main = print 42
| ^^^^^
❯ ghc-9.2.7 -fforce-recomp -w -Wall -Werror main.hs
[1 of 1] Compiling Main ( main.hs, main.o )
main.hs:1:1: error: [-Wmissing-signatures, -Werror=missing-signatures]
Top-level binding with no type signature: main :: IO ()
|
1 | main = print 42
| ^^^^
main.hs:1:8: error: [-Wtype-defaults, -Werror=type-defaults]
• Defaulting the following constraints to type ‘Integer’
(Show a0) arising from a use of ‘print’ at main.hs:1:8-12
(Num a0) arising from the literal ‘42’ at main.hs:1:14-15
• In the expression: print 42
In an equation for ‘main’: main = print 42
|
1 | main = print 42
| ^^^^^ So, I don't see a difference between 9.2 and 9.4. Perhaps it's too simple of an example. |
I'm not seeing a difference here. My test was based on ghci and in fact the specific error being raised…
And with 9.4:
The precise error message changes though; I don't know if that could be relevant. |
Either way it looks like |
That I tried that locally and it seemed to have moved further but it still reports 3 not-in-scope errors for Cabal-syntax somehow. |
I am also reaching the same conclusions but it looks like there are multiple elements at play, mostly caused by differences in cabal.project and cabal.project.validate and changes between ghc-9.2 and ghc-9.4. |
The plan generated by cabal.project.validate has text-2.0.2 with ghc-9.4.7 and text-1.2.5.0 with ghc-9.2.8. This difference is not present with cabal.project which has (index-state: 2023-10-03T04:02:05Z) |
I get the warnings turning into errors but I cannot figure out how this can happen ...
|
5 hours later ... That happens because the module does not load because of a type error and doctest is hiding the message. When doctest says
what happens is actually this (
Given this only happens with doctest, I am thinking that it's |
I tried to fix this in dc08acb. Let's see if it works. |
@andreabedini close. Could you create a copy of the project file, remove -Werror and point the doctest make rule to it? I think that should fix the rest of errors. |
@andreabedini I checked this idea and it worked. That's when applied on top of your branch, because you fixed several actual issues in the code. Do you want me to push my part in your branch? |
This became necessary after an upgrade to GHC 9.4, which, apparently, has a subtle change in how -W/-w-related things get interpreted.
* Bump base in cabal-dev-scripts.cabal Bump base in cabal-dev-scripts.cabal. We are now using GHC 9.4.7 in CI, which ships with base 4.17.2.0. I am bumping all the way to <4.19 after testing everything compiles with GHC 9.6.3 (base-4.18.1.0). (cherry picked from commit 033e8e0) * Avoid OverloadedStrings when it causes troubles (cherry picked from commit dc08acb) # Conflicts: # Cabal-syntax/src/Distribution/Fields/Parser.hs * doctest: provide a separate project file without -Werror (fix #9307) This became necessary after an upgrade to GHC 9.4, which, apparently, has a subtle change in how -W/-w-related things get interpreted. (cherry picked from commit ccce7c3) * fixup! resolve a conflict --------- Co-authored-by: Andrea Bedini <andrea.bedini@tweag.io> Co-authored-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com>
It is not clear whether the first error leads to all the others, or if this derives from a change in the doctest CI.
The text was updated successfully, but these errors were encountered: