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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 8 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,30 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-latest
ghc:
- 7.0.1
- 7.0.4
- 7.2.2
- 7.4.1
- 7.4.2
- 7.6.3
- 7.8.4
- 7.10.3
- 8.0.2
- 8.2.2
- 8.4.1
- 8.4.2
- 8.4.3
- 8.4.4
- 8.6.1
- 8.6.2
- 8.6.3
- 8.6.4
- 8.6.5
- 8.8.1
- 8.8.2
- 8.8.3
- 8.8.4
- 8.10.1
- 8.10.2
- 8.10.3
- 8.10.4
- 8.10.5
- 8.10.6
- 8.10.7
- 9.0.1
- 9.0.2
- 9.2.1
- 9.2.2
- 9.2.8
- 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...

include:
- os: macos-latest
ghc: latest
- os: windows-latest
ghc: latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: hspec/setup-haskell@v1
with:
ghc-version: ${{ matrix.ghc }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/dist/
/HunitTest.tmp
/.stack-work/
/dist-newstyle/
/stack*.yaml.lock
6 changes: 3 additions & 3 deletions HUnit.cabal
Original file line number Diff line number Diff line change
@@ -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.

--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -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?

call-stack >=0.3.0,
deepseq
exposed-modules:
Expand All @@ -52,7 +52,7 @@ test-suite tests
examples
build-depends:
HUnit,
base ==4.*,
base >=4.9,
call-stack >=0.3.0,
deepseq,
filepath
Expand Down
3 changes: 2 additions & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ extra-source-files:
- README.md

dependencies:
- base == 4.*
# GHC >= 8.0 required for -Wno-unrecognised-warning-flags
- base >= 4.9
- deepseq
- call-stack >= 0.3.0

Expand Down
3 changes: 1 addition & 2 deletions src/Test/HUnit/Terminal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ ta f (b:bs) as ('\b':cs) = ta f bs (b:as) cs
ta _ "" _ ('\b': _) = error "'\\b' at beginning of line"
ta f bs as (c:cs)
| not (isPrint c) = error "invalid nonprinting character"
| null as = ta f (c:bs) "" cs
| otherwise = ta f (c:bs) (tail as) cs
| otherwise = ta f (c:bs) (drop 1 as) cs
ta f bs as "" = f (reverse bs ++ as)
3 changes: 3 additions & 0 deletions tests/HUnitTestExtended.hs
Original file line number Diff line number Diff line change
@@ -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.


module HUnitTestExtended (extendedTests) where

import Test.HUnit
Expand Down
Loading