Skip to content
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

Please ensure cabal does not warn for incomplete-uni-patterns #6355

Closed
10 tasks
tomjaguarpaw opened this issue Nov 14, 2019 · 7 comments
Closed
10 tasks

Please ensure cabal does not warn for incomplete-uni-patterns #6355

tomjaguarpaw opened this issue Nov 14, 2019 · 7 comments
Assignees
Milestone

Comments

@tomjaguarpaw
Copy link
Member

tomjaguarpaw commented Nov 14, 2019

As per this accepted GHC proposal, GHC will add incomplete-uni-patterns and incomplete-record-updates to -Wall. Could you please ensure that the following files do not give any warnings for incomplete-uni-patterns, perhaps by setting the pragma below? (A clean compile of cabal is needed to build GHC.)

{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}

  • Cabal/Distribution/Backpack/Configure.hs
  • Cabal/Distribution/Parsec.hs
  • Cabal/Distribution/Simple/Build/Macros.hs
  • Cabal/Distribution/Simple/GHC.hs
  • Cabal/Distribution/Simple/GHCJS.hs
  • Cabal/Distribution/Simple/UHC.hs
  • Cabal/Distribution/Simple/Test/LibV09.hs
  • Cabal/Distribution/Simple/BuildTarget.hs
  • Cabal/Distribution/Simple/ShowBuildInfo.hs
  • Cabal/Cabal/Distribution/Simple/Haddock.hs
@dwijnand
Copy link
Contributor

When you say "Could you please ensure that the following files do not give any warnings" and then give a list specifying 1 particular file, I assume you found that file to have warnings. But I'm having a hard time reproducing that, after adding that pragma and running cabal build Cabal. Is there some step I'm missing?

@tomjaguarpaw
Copy link
Member Author

I am currently implementing the above-mentioned proposal in GHC, i.e. that -Wincomplete-uni-patterns is added to -Wall. However, that file emits warnings under -Wincomplete-uni-patterns, breaking the build of GHC. I'm asking that -Wno-incomplete-uni-patterns is added on that file so that it will not break the build of GHC. Does that make sense?

@dwijnand
Copy link
Contributor

If you have a look at https://travis-ci.com/dwijnand/cabal/builds/136806769 and the commit it builds from (which builds on current HEAD), and ignore the failures on older GHCs, you'll see that compilation didn't fail (and I believe warnings are set to fatal), so I do still need some information as to what Parsec.hs needs or how to get it to fail...

@tomjaguarpaw
Copy link
Member Author

I'm saying that it will fail under -Wincomplete-uni-patterns and that warning will be included under -Wall under future GHCs, therefore Parsec.hs needs -Wno-incomplete-uni-patterns applied. In other words, what I'm asking you to do is exactly to merge dwijnand@4e6b2c5!

@dwijnand
Copy link
Contributor

so I do still need some information

Thanks to @phadej I found out that the information I was missing is that the "no" in -Wno-incomplete-uni-patterns suppresses the warning. (I expanded on this in https://twitter.com/dwijnand/status/1195908792686391296.)

@tomjaguarpaw
Copy link
Member Author

[Edited the list to include many more cases I found!]

@phadej
Copy link
Collaborator

phadej commented Dec 14, 2019

Just out of curiosity, is there work on hadrian / shake to make them -Wincomplete-uni-patterns clean?
I opened to track that https://gitlab.haskell.org/ghc/ghc/issues/17577

@phadej phadej self-assigned this Dec 14, 2019
@phadej phadej added this to the 3.2.0.0 milestone Dec 14, 2019
phadej added a commit to phadej/cabal that referenced this issue Dec 15, 2019
Or replace

    Just foo = rhs

with

    foo = fromMaybe (error "...") rhs

which there are plenty. I didn't tried to refactor these errors away,
let cabal panic, if it hits them.
phadej added a commit to phadej/cabal that referenced this issue Dec 15, 2019
Or replace

    Just foo = rhs

with

    foo = fromMaybe (error "...") rhs

which there are plenty. I didn't tried to refactor these errors away,
let cabal panic, if it hits them.
phadej added a commit to phadej/cabal that referenced this issue Dec 15, 2019
Or replace

    Just foo = rhs

with

    foo = fromMaybe (error "...") rhs

which there are plenty. I didn't tried to refactor these errors away,
let cabal panic, if it hits them.
@phadej phadej closed this as completed in 6a5cd87 Dec 15, 2019
phadej added a commit that referenced this issue Dec 15, 2019
Resolve #6355: Fix most incomplete-uni-patterns
phadej added a commit to phadej/cabal that referenced this issue Dec 15, 2019
Or replace

    Just foo = rhs

with

    foo = fromMaybe (error "...") rhs

which there are plenty. I didn't tried to refactor these errors away,
let cabal panic, if it hits them.
tomjaguarpaw pushed a commit to tomjaguarpaw/cabal that referenced this issue Oct 30, 2020
to be extra safe, prior to this warning being added to -Wall. See also

* https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* haskell#6355
tomjaguarpaw pushed a commit to tomjaguarpaw/cabal that referenced this issue Oct 30, 2020
to be extra safe, prior to this warning being added to -Wall. See also

* https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* haskell#6355
tomjaguarpaw pushed a commit to tomjaguarpaw/cabal that referenced this issue Oct 30, 2020
to be extra safe, prior to this warning being added to -Wall. See also

* https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* haskell#6355
tomjaguarpaw pushed a commit to tomjaguarpaw/cabal that referenced this issue Oct 30, 2020
to be extra safe, prior to this warning being added to -Wall. See also

* https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* haskell#6355
tomjaguarpaw pushed a commit to tomjaguarpaw/cabal that referenced this issue Oct 30, 2020
to be extra safe, prior to this warning being added to -Wall. See also

* https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* haskell#6355
phadej pushed a commit to phadej/cabal that referenced this issue Nov 1, 2020
to be extra safe, prior to this warning being added to -Wall. See also

* https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* haskell#6355
hololeap pushed a commit to hololeap/cabal that referenced this issue Apr 24, 2022
to be extra safe, prior to this warning being added to -Wall. See also

* https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* haskell#6355
hololeap pushed a commit to hololeap/cabal that referenced this issue Apr 24, 2022
to be extra safe, prior to this warning being added to -Wall. See also

* https://gitlab.haskell.org/ghc/ghc/-/issues/15656
* haskell#6355
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

No branches or pull requests

3 participants