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

Handle GHC 9.8's x-partial warning, requires dropping GHC 7 #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andreasabel
Copy link

Fixing a use of tail in the library.
In the test-suite, tail [] is intended, so switch off the
x-partial there.

Ignoring -Wx-partial on older GHCs requires
-Wno-unrecognised-warning-flags, which entered GHC only in 8.0.
Thus, dropping GHC 7.

Closes #56.

Fixing a use of `tail` in the library.
In the test-suite, `tail []` is intended, so switch off the
`x-partial` there.

Ignoring `-Wx-partial` on older GHCs requires
`-Wno-unrecognised-warning-flags`, which entered GHC only in 8.0.
Thus, dropping GHC 7.

Closes hspec#56.
@andreasabel
Copy link
Author

CI run on my fork: andreasabel#1

macos-latest fails due to:

@sol
Copy link
Member

sol commented Aug 1, 2024

CI run on my fork: andreasabel#1

macos-latest fails due to:

I think this can be fixed by using macos-12.

@@ -1,3 +1,6 @@
{-# OPTIONS_GHC -Wno-unrecognised-warning-flags #-} -- since GHC 8.0
{-# OPTIONS_GHC -Wno-x-partial #-} -- since GHC 9.8
Copy link
Member

Choose a reason for hiding this comment

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

Is x-partial included in -Wdefault? If not, then maybe use -w -Wdefault.

Copy link
Member

Choose a reason for hiding this comment

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

Something I just noticed, all this tests are technically broken.

`seq` return ()

doesn't really work. This should be evaluate instead. If you wanna fix this too, then that would be more than welcome.

Copy link
Member

Choose a reason for hiding this comment

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

Is x-partial included in -Wdefault? If not, then maybe use -w -Wdefault.

Or maybe just delete the test case. Or alternatively replace it with one that uses read.

@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.34.3.
-- This file has been generated from package.yaml by hpack version 0.36.0.
Copy link
Member

Choose a reason for hiding this comment

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

Apparently the repository is missing a .gitattributes file, something like
https://github.com/sol/markdown-unlit/blob/main/.gitattributes.

If you wanna add that, then that would be more than welcome.

- 9.4.8
- 9.6.6
- 9.8.2
- 9.10.1
Copy link
Member

Choose a reason for hiding this comment

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

If we only want to test the latest minor version, then I think it is better to use something like - "9.10", etc...

@@ -30,7 +30,7 @@ library
hs-source-dirs:
src
build-depends:
base ==4.*,
base >=4.9,
Copy link
Member

Choose a reason for hiding this comment

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

Is Hackage accepting packages that don't specify an upper bound on base by now? I may be wrong on this, but I think that was not the case in the past?

@sol
Copy link
Member

sol commented Aug 1, 2024

If we drop support for GHC 7.* then there is some CPP that can be removed as well, e.g.

https://github.com/hspec/HUnit/blob/main/src/Test/HUnit/Lang.hs#L5

https://github.com/hspec/HUnit/blob/main/src/Test/HUnit/Base.hs#L6

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.

x-partial warnings with GHC 9.8
2 participants