Skip to content

Commit 0fbcf6f

Browse files
committed
v0.95.2.2: Drop support for GHC 7, make Prelude imports explicit
1 parent e6c1f34 commit 0fbcf6f

File tree

7 files changed

+105
-107
lines changed

7 files changed

+105
-107
lines changed

.github/workflows/haskell-ci.yml

+53-80
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.16.6.20230729
11+
# version: 0.19.20250216
1212
#
13-
# REGENDATA ("0.16.6.20230729",["github","regex-compat.cabal"])
13+
# REGENDATA ("0.19.20250216",["github","regex-compat.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,23 +23,38 @@ on:
2323
jobs:
2424
linux:
2525
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-24.04
2727
timeout-minutes:
2828
60
2929
container:
30-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.6.2
35+
- compiler: ghc-9.12.1
3636
compilerKind: ghc
37-
compilerVersion: 9.6.2
37+
compilerVersion: 9.12.1
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.4.5
40+
- compiler: ghc-9.10.1
4141
compilerKind: ghc
42-
compilerVersion: 9.4.5
42+
compilerVersion: 9.10.1
43+
setup-method: ghcup
44+
allow-failure: false
45+
- compiler: ghc-9.8.4
46+
compilerKind: ghc
47+
compilerVersion: 9.8.4
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.6.6
51+
compilerKind: ghc
52+
compilerVersion: 9.6.6
53+
setup-method: ghcup
54+
allow-failure: false
55+
- compiler: ghc-9.4.8
56+
compilerKind: ghc
57+
compilerVersion: 9.4.8
4358
setup-method: ghcup
4459
allow-failure: false
4560
- compiler: ghc-9.2.8
@@ -60,79 +75,53 @@ jobs:
6075
- compiler: ghc-8.8.4
6176
compilerKind: ghc
6277
compilerVersion: 8.8.4
63-
setup-method: hvr-ppa
78+
setup-method: ghcup
6479
allow-failure: false
6580
- compiler: ghc-8.6.5
6681
compilerKind: ghc
6782
compilerVersion: 8.6.5
68-
setup-method: hvr-ppa
83+
setup-method: ghcup
6984
allow-failure: false
7085
- compiler: ghc-8.4.4
7186
compilerKind: ghc
7287
compilerVersion: 8.4.4
73-
setup-method: hvr-ppa
88+
setup-method: ghcup
7489
allow-failure: false
7590
- compiler: ghc-8.2.2
7691
compilerKind: ghc
7792
compilerVersion: 8.2.2
78-
setup-method: hvr-ppa
93+
setup-method: ghcup
7994
allow-failure: false
8095
- compiler: ghc-8.0.2
8196
compilerKind: ghc
8297
compilerVersion: 8.0.2
83-
setup-method: hvr-ppa
84-
allow-failure: false
85-
- compiler: ghc-7.10.3
86-
compilerKind: ghc
87-
compilerVersion: 7.10.3
88-
setup-method: hvr-ppa
89-
allow-failure: false
90-
- compiler: ghc-7.8.4
91-
compilerKind: ghc
92-
compilerVersion: 7.8.4
93-
setup-method: hvr-ppa
94-
allow-failure: false
95-
- compiler: ghc-7.6.3
96-
compilerKind: ghc
97-
compilerVersion: 7.6.3
98-
setup-method: hvr-ppa
99-
allow-failure: false
100-
- compiler: ghc-7.4.2
101-
compilerKind: ghc
102-
compilerVersion: 7.4.2
103-
setup-method: hvr-ppa
104-
allow-failure: false
105-
- compiler: ghc-7.2.2
106-
compilerKind: ghc
107-
compilerVersion: 7.2.2
108-
setup-method: hvr-ppa
109-
allow-failure: false
110-
- compiler: ghc-7.0.4
111-
compilerKind: ghc
112-
compilerVersion: 7.0.4
113-
setup-method: hvr-ppa
98+
setup-method: ghcup
11499
allow-failure: false
115100
fail-fast: false
116101
steps:
117-
- name: apt
102+
- name: apt-get install
118103
run: |
119104
apt-get update
120-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
121-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
122-
mkdir -p "$HOME/.ghcup/bin"
123-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
124-
chmod a+x "$HOME/.ghcup/bin/ghcup"
125-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
126-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
127-
else
128-
apt-add-repository -y 'ppa:hvr/ghc'
129-
apt-get update
130-
apt-get install -y "$HCNAME"
131-
mkdir -p "$HOME/.ghcup/bin"
132-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
133-
chmod a+x "$HOME/.ghcup/bin/ghcup"
134-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
135-
fi
105+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
106+
- name: Install GHCup
107+
run: |
108+
mkdir -p "$HOME/.ghcup/bin"
109+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
110+
chmod a+x "$HOME/.ghcup/bin/ghcup"
111+
- name: Install cabal-install
112+
run: |
113+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
114+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
115+
- name: Install GHC (GHCup)
116+
if: matrix.setup-method == 'ghcup'
117+
run: |
118+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
119+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
120+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
121+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
122+
echo "HC=$HC" >> "$GITHUB_ENV"
123+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
124+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
136125
env:
137126
HCKIND: ${{ matrix.compilerKind }}
138127
HCNAME: ${{ matrix.compiler }}
@@ -143,28 +132,12 @@ jobs:
143132
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
144133
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
145134
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
146-
HCDIR=/opt/$HCKIND/$HCVER
147-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
148-
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
149-
echo "HC=$HC" >> "$GITHUB_ENV"
150-
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
151-
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
152-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
153-
else
154-
HC=$HCDIR/bin/$HCKIND
155-
echo "HC=$HC" >> "$GITHUB_ENV"
156-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
157-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
158-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
159-
fi
160-
161135
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
162136
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
163137
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
164138
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
165139
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
166140
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
167-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
168141
env:
169142
HCKIND: ${{ matrix.compilerKind }}
170143
HCNAME: ${{ matrix.compiler }}
@@ -214,7 +187,7 @@ jobs:
214187
chmod a+x $HOME/.cabal/bin/cabal-plan
215188
cabal-plan --version
216189
- name: checkout
217-
uses: actions/checkout@v3
190+
uses: actions/checkout@v4
218191
with:
219192
path: source
220193
- name: initial cabal.project for sdist
@@ -242,15 +215,15 @@ jobs:
242215
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
243216
cat >> cabal.project <<EOF
244217
EOF
245-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(regex-compat)$/; }' >> cabal.project.local
218+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(regex-compat)$/; }' >> cabal.project.local
246219
cat cabal.project
247220
cat cabal.project.local
248221
- name: dump install plan
249222
run: |
250223
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
251224
cabal-plan
252225
- name: restore cache
253-
uses: actions/cache/restore@v3
226+
uses: actions/cache/restore@v4
254227
with:
255228
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
256229
path: ~/.cabal/store
@@ -277,8 +250,8 @@ jobs:
277250
rm -f cabal.project.local
278251
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
279252
- name: save cache
280-
uses: actions/cache/save@v3
281253
if: always()
254+
uses: actions/cache/save@v4
282255
with:
283256
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
284257
path: ~/.cabal/store

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/dist-newstyle/
33
/cabal.project.local
44
/.ghc.environment.*
5+
*~

ChangeLog.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
See also http://pvp.haskell.org/faq
1+
## 0.95.2.2
2+
3+
_2025-03-02 Andreas Abel_
4+
5+
- Drop support for GHC 7
6+
- Make `Prelude` imports explicit, add `LANGUAGE NoImplicitPrelude`
7+
- Make upper bounds of dependencies major-major (all are shipped with GHC)
8+
- Tested with GHC 8.0 - 9.12.1
29

310
## 0.95.2.1 revision 2
411

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[![Hackage version](https://img.shields.io/hackage/v/regex-compat.svg?label=Hackage&color=informational)](http://hackage.haskell.org/package/regex-compat)
2+
[![Stackage Nightly](http://stackage.org/package/regex-compat/badge/nightly)](http://stackage.org/nightly/package/regex-compat)
3+
[![Stackage LTS](http://stackage.org/package/regex-compat/badge/lts)](http://stackage.org/lts/package/regex-compat)
4+
[![Haskell-CI](https://github.com/haskell-hvr/regex-compat/actions/workflows/haskell-ci.yml/badge.svg?branch=master&event=push)](https://github.com/haskell-hvr/regex-compat/actions/workflows/haskell-ci.yml)
5+
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
6+
regex-compat
7+
============
8+
9+
[Documentation](https://hackage.haskell.org/package/regex-compat/docs/Text-Regex.html) on hackage.

Setup.hs

-2
This file was deleted.

Text/Regex.hs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
1+
{-# OPTIONS_GHC -Wno-name-shadowing #-}
22
-----------------------------------------------------------------------------
33
-- |
44
-- Module : Text.Regex
@@ -29,6 +29,14 @@ module Text.Regex (
2929
splitRegex
3030
) where
3131

32+
import Prelude
33+
( Bool
34+
, Maybe
35+
, String
36+
, ($), (.), id, fst, snd, seq, read
37+
, (+), (-)
38+
, (++), drop, fmap, map, null, take
39+
)
3240
import Data.Array((!))
3341
import Data.Bits((.|.))
3442
import Text.Regex.Base(RegexMaker(makeRegexOpts),defaultExecOpt,RegexLike(matchAll,matchAllText),RegexContext(matchM),MatchText)

regex-compat.cabal

+25-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
cabal-version: 1.12
1+
cabal-version: 1.24
22
name: regex-compat
3-
version: 0.95.2.1
4-
x-revision: 2
3+
version: 0.95.2.2
54

65
build-type: Simple
76
license: BSD3
@@ -18,12 +17,16 @@ description:
1817
.
1918
See also <https://wiki.haskell.org/Regular_expressions> for more information.
2019

21-
extra-source-files:
20+
extra-doc-files:
2221
ChangeLog.md
22+
README.md
2323

2424
tested-with:
25-
GHC == 9.6.2
26-
GHC == 9.4.5
25+
GHC == 9.12.1
26+
GHC == 9.10.1
27+
GHC == 9.8.4
28+
GHC == 9.6.6
29+
GHC == 9.4.8
2730
GHC == 9.2.8
2831
GHC == 9.0.2
2932
GHC == 8.10.7
@@ -32,12 +35,6 @@ tested-with:
3235
GHC == 8.4.4
3336
GHC == 8.2.2
3437
GHC == 8.0.2
35-
GHC == 7.10.3
36-
GHC == 7.8.4
37-
GHC == 7.6.3
38-
GHC == 7.4.2
39-
GHC == 7.2.2
40-
GHC == 7.0.4
4138

4239
source-repository head
4340
type: git
@@ -46,20 +43,25 @@ source-repository head
4643
source-repository this
4744
type: git
4845
location: https://github.com/haskell-hvr/regex-compat.git
49-
tag: v0.95.2.1-r2
46+
tag: v0.95.2.2
5047

5148
library
5249
exposed-modules: Text.Regex
5350

54-
build-depends: base >= 4.3 && < 5
55-
, regex-base == 0.94.*
56-
, regex-posix == 0.96.*
57-
, array >= 0.3 && < 0.6
51+
build-depends:
52+
base >= 4.9 && < 5
53+
, regex-base == 0.94.*
54+
, regex-posix == 0.96.*
55+
, array >= 0.5 && < 1
5856

59-
default-language: Haskell2010
60-
default-extensions: MultiParamTypeClasses, FunctionalDependencies
57+
default-language:
58+
Haskell2010
59+
default-extensions:
60+
NoImplicitPrelude
61+
Trustworthy
62+
MultiParamTypeClasses
63+
FunctionalDependencies
6164

62-
if impl(ghc >= 7.2)
63-
default-extensions: Trustworthy
64-
65-
ghc-options: -Wall
65+
ghc-options:
66+
-Wall
67+
-Wcompat

0 commit comments

Comments
 (0)