Skip to content
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
126 changes: 70 additions & 56 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.13.20220102
# version: 0.19.20250115
#
# REGENDATA ("0.13.20220102",["github","cabal.project"])
# REGENDATA ("0.19.20250115",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -19,15 +19,40 @@ on:
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.12.1
compilerKind: ghc
compilerVersion: 9.12.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.1
compilerKind: ghc
compilerVersion: 9.2.1
Expand All @@ -36,64 +61,63 @@ jobs:
- compiler: ghc-9.0.1
compilerKind: ghc
compilerVersion: 9.0.1
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.4
compilerKind: ghc
compilerVersion: 8.10.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.8.3
compilerKind: ghc
compilerVersion: 8.8.3
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.6.5
compilerKind: ghc
compilerVersion: 8.6.5
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.4.4
compilerKind: ghc
compilerVersion: 8.4.4
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.2.2
compilerKind: ghc
compilerVersion: 8.2.2
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.0.2
compilerKind: ghc
compilerVersion: 8.0.2
setup-method: hvr-ppa
allow-failure: false
- compiler: ghc-7.10.3
compilerKind: ghc
compilerVersion: 7.10.3
setup-method: hvr-ppa
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME"
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
fi
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -104,28 +128,12 @@ jobs:
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi

HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -168,14 +176,14 @@ jobs:
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -209,15 +217,15 @@ jobs:
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(ghc-dump-core|ghc-dump-util)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(ghc-dump-core|ghc-dump-util)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: cache
uses: actions/cache@v2
- name: restore cache
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -240,8 +248,14 @@ jobs:
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
7 changes: 4 additions & 3 deletions ghc-dump-core/GhcDump/Ast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ import GHC.Types.Unique (mkUnique)
import Unique (mkUnique)
#endif
import Prelude
import Data.Word (Word64)

data Unique = Unique !Char !Int
data Unique = Unique !Char !Word64
deriving (Eq, Ord, Generic)
instance Serialise Unique

-- | This is dependent upon GHC
instance Show Unique where
show (Unique c n) = show $ mkUnique c n
show (Unique c n) = show $ mkUnique c (fromIntegral n)

data ExternalName' bndr var = ExternalName { externalModuleName :: !ModuleName
, externalName :: !T.Text
Expand All @@ -37,7 +38,7 @@ data ExternalName' bndr var = ExternalName { externalModuleName :: !ModuleName
| ForeignCall
deriving (Eq, Ord, Generic, Show)

type SExternalName = ExternalName' SBinder BinderId
type SExternalName = ExternalName' SBinder BinderId
type ExternalName = ExternalName' Binder Binder

instance (Serialise bndr, Serialise var) => Serialise (ExternalName' bndr var)
Expand Down
36 changes: 34 additions & 2 deletions ghc-dump-core/GhcDump/Convert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import GHC.Types.Var (Var(..))
import qualified GHC.Types.Var as Var
import GHC.Types.Id (isFCallId)
import GHC.Unit.Module as Module (moduleName)
#if MIN_VERSION_ghc(9,6,0)
import Language.Haskell.Syntax.Module.Name as Module (ModuleName, moduleNameFS)
#else
import GHC.Unit.Module.Name as Module (ModuleName, moduleNameFS)
#endif
import GHC.Types.Name (getOccName, occNameFS, OccName, getName, nameModule_maybe, getSrcSpan)
import qualified GHC.Types.Id.Info as IdInfo
import qualified GHC.Types.Basic as OccInfo (OccInfo(..), isStrongLoopBreaker)
Expand Down Expand Up @@ -106,7 +110,7 @@ occNameToText = fastStringToText . occNameFS
cvtUnique :: Unique.Unique -> Ast.Unique
cvtUnique u =
let (a,b) = unpkUnique u
in Ast.Unique a b
in Ast.Unique a (fromIntegral b)

cvtVar :: Var -> BinderId
cvtVar = BinderId . cvtUnique . Var.varUnique
Expand Down Expand Up @@ -142,7 +146,11 @@ cvtIdInfo i =
OccInfo.IAmDead -> OccDead
OccInfo.OneOcc{} -> OccOneOcc
[email protected]{} -> OccLoopBreaker (OccInfo.isStrongLoopBreaker oi)
#if MIN_VERSION_ghc(9,4,0)
, idiStrictnessSig = cvtSDoc $ ppr $ IdInfo.dmdSigInfo i
#else
, idiStrictnessSig = cvtSDoc $ ppr $ IdInfo.strictnessInfo i
#endif
, idiDemandSig = cvtSDoc $ ppr $ IdInfo.demandInfo i
, idiCallArity = IdInfo.callArityInfo i
}
Expand All @@ -154,13 +162,23 @@ cvtUnfolding CoreSyn.BootUnfolding = Ast.BootUnfolding
#endif
cvtUnfolding (CoreSyn.OtherCon cons) = Ast.OtherCon (map cvtAltCon cons)
cvtUnfolding (CoreSyn.DFunUnfolding{}) = Ast.DFunUnfolding
#if MIN_VERSION_ghc(9,6,0)
cvtUnfolding (CoreSyn.CoreUnfolding{ CoreSyn.uf_tmpl = tmpl, CoreSyn.uf_guidance = guidance, CoreSyn.uf_cache = u}) =
Ast.CoreUnfolding { unfTemplate = cvtExpr $ tmpl
, unfIsValue = CoreSyn.uf_is_value u
, unfIsConLike = CoreSyn.uf_is_conlike u
, unfIsWorkFree = CoreSyn.uf_is_work_free u
, unfGuidance = cvtSDoc $ ppr guidance
}
#else
cvtUnfolding u@(CoreSyn.CoreUnfolding{}) =
Ast.CoreUnfolding { unfTemplate = cvtExpr $ CoreSyn.uf_tmpl u
, unfIsValue = CoreSyn.uf_is_value u
, unfIsConLike = CoreSyn.uf_is_conlike u
, unfIsWorkFree = CoreSyn.uf_is_work_free u
, unfGuidance = cvtSDoc $ ppr $ CoreSyn.uf_guidance u
}
#endif

cvtIdDetails :: HasEnv => IdInfo.IdDetails -> Ast.IdDetails
cvtIdDetails d =
Expand All @@ -174,10 +192,16 @@ cvtIdDetails d =
IdInfo.FCallId{} -> error "This shouldn't happen"
IdInfo.TickBoxOpId{} -> Ast.TickBoxOpId
IdInfo.DFunId{} -> Ast.DFunId
#if MIN_VERSION_ghc(9,10,0)
IdInfo.RepPolyId{} -> Ast.VanillaId
#endif
#if MIN_VERSION_ghc(8,0,0)
IdInfo.CoVarId{} -> Ast.CoVarId
#endif
#if MIN_VERSION_ghc(8,2,0)
#if MIN_VERSION_ghc(9,4,0)
IdInfo.WorkerLikeId _ -> Ast.VanillaId
IdInfo.JoinId n _ -> Ast.JoinId n
#elif MIN_VERSION_ghc(8,2,0)
IdInfo.JoinId n -> Ast.JoinId n
#endif

Expand Down Expand Up @@ -286,7 +310,11 @@ cvtLit l =
Literal.LitNullAddr -> Ast.MachNullAddr
Literal.LitFloat x -> Ast.MachFloat x
Literal.LitDouble x -> Ast.MachDouble x
#if MIN_VERSION_ghc(9,12,0)
Literal.LitLabel x _ -> Ast.MachLabel $ fastStringToText x
#else
Literal.LitLabel x _ _ -> Ast.MachLabel $ fastStringToText x
#endif
Literal.LitRubbish{} -> Ast.LitRubbish
#else
Literal.MachChar x -> Ast.MachChar x
Expand All @@ -307,8 +335,12 @@ cvtLit l =
Literal.LitNumInt64 -> Ast.MachInt64 n
Literal.LitNumWord -> Ast.MachWord n
Literal.LitNumWord64 -> Ast.MachWord64 n
#if MIN_VERSION_ghc(9,4,0)
Literal.LitNumBigNat -> Ast.LitNatural n
#else
Literal.LitNumInteger -> Ast.LitInteger n
Literal.LitNumNatural -> Ast.LitNatural n
#endif
#if MIN_VERSION_ghc(9,2,0)
-- Lossy
Literal.LitNumInt8 -> Ast.MachInt n
Expand Down
Loading
Loading