Skip to content

Commit 037506e

Browse files
simonmarfacebook-github-bot
authored andcommitted
Fix build failure with text-2.1.2 (#161) (#162)
Summary: Pull Request resolved: #162 Reviewed By: malanka Differential Revision: D74318069 Pulled By: jjuliamolin fbshipit-source-id: d49893e4a436a261949285dd0eadf3d7ff5401e6
1 parent 04a3537 commit 037506e

2 files changed

Lines changed: 25 additions & 21 deletions

File tree

.github/workflows/haskell-ci.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#
77
# haskell-ci regenerate
88
#
9-
# For more information, see https://github.com/andreasabel/haskell-ci
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20241111
11+
# version: 0.19.20250411
1212
#
13-
# REGENDATA ("0.19.20241111",["--no-cabal-check","github","haxl.cabal"])
13+
# REGENDATA ("0.19.20250411",["--no-cabal-check","github","haxl.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -19,7 +19,7 @@ on:
1919
jobs:
2020
linux:
2121
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-24.04
2323
timeout-minutes:
2424
60
2525
container:
@@ -80,16 +80,29 @@ jobs:
8080
allow-failure: false
8181
fail-fast: false
8282
steps:
83-
- name: apt
83+
- name: apt-get install
8484
run: |
8585
apt-get update
8686
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
87+
- name: Install GHCup
88+
run: |
8789
mkdir -p "$HOME/.ghcup/bin"
88-
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
90+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
8991
chmod a+x "$HOME/.ghcup/bin/ghcup"
90-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
92+
- name: Install cabal-install
93+
run: |
94+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
95+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
96+
- name: Install GHC (GHCup)
97+
if: matrix.setup-method == 'ghcup'
98+
run: |
9199
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
92-
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
100+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
101+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
102+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
103+
echo "HC=$HC" >> "$GITHUB_ENV"
104+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
105+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
93106
env:
94107
HCKIND: ${{ matrix.compilerKind }}
95108
HCNAME: ${{ matrix.compiler }}
@@ -100,21 +113,12 @@ jobs:
100113
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
101114
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
102115
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
103-
HCDIR=/opt/$HCKIND/$HCVER
104-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
105-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
106-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
107-
echo "HC=$HC" >> "$GITHUB_ENV"
108-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
109-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
110-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
111116
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
112117
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
113118
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
114119
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
115120
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
116121
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
117-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
118122
env:
119123
HCKIND: ${{ matrix.compilerKind }}
120124
HCNAME: ${{ matrix.compiler }}
@@ -226,8 +230,8 @@ jobs:
226230
rm -f cabal.project.local
227231
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
228232
- name: save cache
229-
uses: actions/cache/save@v4
230233
if: always()
234+
uses: actions/cache/save@v4
231235
with:
232236
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
233237
path: ~/.cabal/store

tests/DataCacheTest.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Data.Typeable
2525
import Prelude hiding (mapM)
2626
import Test.HUnit
2727
import Data.IORef
28-
import Data.Text
28+
import qualified Data.Text as Text
2929
import Unsafe.Coerce
3030

3131
data TestReq a where
@@ -42,7 +42,7 @@ instance DataSource u TestReq where
4242
fetch = error "no fetch defined"
4343

4444
instance DataSourceName TestReq where
45-
dataSourceName _ = pack "TestReq"
45+
dataSourceName _ = Text.pack "TestReq"
4646

4747
instance StateKey TestReq where
4848
data State TestReq = TestReqState
@@ -179,7 +179,7 @@ dcFallbackTest = TestLabel "DataCache fallback" $ TestList
179179
| otherwise = return Nothing
180180

181181
doReq :: TestReq Int -> ResultVal Int (WriteTree Int)
182-
doReq (Req 999) = ThrowHaxl (toException $ NotFound empty) Nothing
182+
doReq (Req 999) = ThrowHaxl (toException $ NotFound Text.empty) Nothing
183183
doReq (Req r) = Ok r Nothing
184184

185185
doCache :: CacheableReq Int -> ResultVal Int (WriteTree Int)

0 commit comments

Comments
 (0)