Skip to content

Commit

Permalink
Bump to lts-22.13 (ghc 9.6.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhrcek committed Mar 21, 2024
1 parent d4d792e commit ef163f7
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 53 deletions.
98 changes: 64 additions & 34 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,71 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.11.20201230
# version: 0.18.1
#
# REGENDATA ("0.11.20201230",["github","fundeps.cabal"])
# REGENDATA ("0.18.1",["github","fundeps.cabal"])
#
name: Haskell-CI
on:
- push
- pull_request
jobs:
linux:
name: Haskell-CI Linux - GHC ${{ matrix.ghc }}
runs-on: ubuntu-18.04
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- ghc: 8.10.3
- compiler: ghc-9.6.4
compilerKind: ghc
compilerVersion: 9.6.4
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y ghc-$GHC_VERSION cabal-install-3.2
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
GHC_VERSION: ${{ matrix.ghc }}
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "LANG=C.UTF-8" >> $GITHUB_ENV
echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
HC=/opt/ghc/$GHC_VERSION/bin/ghc
echo "HC=$HC" >> $GITHUB_ENV
echo "HCPKG=/opt/ghc/$GHC_VERSION/bin/ghc-pkg" >> $GITHUB_ENV
echo "HADDOCK=/opt/ghc/$GHC_VERSION/bin/haddock" >> $GITHUB_ENV
echo "CABAL=/opt/cabal/3.2/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
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
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"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
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 "ARG_COMPILER=--ghc --with-compiler=/opt/ghc/$GHC_VERSION/bin/ghc" >> $GITHUB_ENV
echo "GHCJSARITH=0" >> $GITHUB_ENV
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:
GHC_VERSION: ${{ matrix.ghc }}
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: env
run: |
env
Expand All @@ -80,6 +95,10 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
EOF
cat $CABAL_CONFIG
- name: versions
run: |
Expand All @@ -92,20 +111,24 @@ 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@v3
with:
path: source
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
cat cabal.project
- name: sdist
run: |
mkdir -p sdist
cd source || false
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
- name: unpack
run: |
Expand All @@ -114,7 +137,8 @@ jobs:
- name: generate cabal.project
run: |
PKGDIR_fundeps="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/fundeps-[0-9.]*')"
echo "PKGDIR_fundeps=${PKGDIR_fundeps}" >> $GITHUB_ENV
echo "PKGDIR_fundeps=${PKGDIR_fundeps}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_fundeps}" >> cabal.project
Expand All @@ -129,12 +153,12 @@ jobs:
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@v3
with:
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
- name: install dependencies
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
Expand All @@ -154,8 +178,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
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
4 changes: 2 additions & 2 deletions fundeps.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description:
category: Web
build-type: Simple
extra-source-files: README.md
tested-with: GHC ==9.2.8
tested-with: GHC ==9.6.4

source-repository head
type: git
Expand Down Expand Up @@ -87,6 +87,7 @@ library
, turtle
, vector
, vty
, vty-unix
, wai
, warp

Expand Down Expand Up @@ -117,4 +118,3 @@ test-suite fundeps-test
, fundeps
, graphviz
, hspec
, hspec-expectations
4 changes: 2 additions & 2 deletions src/FunDeps/Graphviz.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Data.Monoid (Endo (..))
import Data.Text.Lazy qualified as LText
import Settings (DependencyMode (..), Settings (..))
import TUI.Ansi (cliWarn)
import Turtle (FilePath, d, encodeString, fp, printf, (%))
import Turtle (FilePath, d, fp, printf, (%))
import Prelude hiding (FilePath)


Expand All @@ -48,7 +48,7 @@ executeGraphAction gvCommand graph action = case action of
gvCommand
graph
gvOutput
(Turtle.encodeString file)
file


-- TODO rename this as it's not always doing DFS
Expand Down
11 changes: 6 additions & 5 deletions src/FunDeps/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}


#ifdef WithJS
{-# LANGUAGE TemplateHaskell #-}
#endif
Expand Down Expand Up @@ -38,7 +39,7 @@ import Servant.HTML.Lucid (HTML)
import Servant.Server (Handler, Server, serve)
import Servant.Server.StaticFiles (serveDirectoryWebApp)
import Settings (Settings)
import Turtle (encodeString, fp, (%), (<.>), (</>))
import Turtle (fp, (%), (<.>), (</>))
import Turtle qualified


Expand Down Expand Up @@ -80,8 +81,8 @@ data RenderGraphRequest = RenderGraphRequest
instance FromJSON RenderGraphRequest where
parseJSON = withObject "RenderGraphRequest" $ \o ->
RenderGraphRequest
<$> o .: "settings"
<*> o .: "nodes"
<$> (o .: "settings")
<*> (o .: "nodes")


type DeclMap = Map PackageName (Map ModuleName (Map FunctionName G.Node))
Expand Down Expand Up @@ -120,15 +121,15 @@ funDepsHandlers port depGraph =
:<|> elmApp
:<|> pure decls
:<|> renderGraphHandler depGraph
:<|> serveDirectoryWebApp (encodeString imageDir)
:<|> serveDirectoryWebApp imageDir
where
decls = toAllDecls $ declToNode depGraph


renderGraphHandler :: DepGraph -> RenderGraphRequest -> Handler Text
renderGraphHandler depGraph RenderGraphRequest{rgrSettings, rgrNodes} = do
utcTime <- Turtle.date
let graphFileName = (Turtle.decodeString . intercalate "_" . take 2 . words $ show utcTime) <.> "svg"
let graphFileName = (intercalate "_" . take 2 . words $ show utcTime) <.> "svg"
graphAction = GV.ExportToFile (imageDir </> graphFileName) Graphviz.Svg
liftIO $ GV.showDfsSubgraph graphAction depGraph rgrSettings rgrNodes
pure $ Turtle.format ("static/" % fp) graphFileName
Expand Down
2 changes: 1 addition & 1 deletion src/TUI/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ exportCommand = do


exportFile :: Parser FilePath
exportFile = Turtle.decodeString <$> P.many1 (P.satisfy (not . isSpace)) <* P.spaces
exportFile = P.many1 (P.satisfy (not . isSpace)) <* P.spaces


queryItems :: Parser [QueryItem]
Expand Down
7 changes: 3 additions & 4 deletions src/TUI/Settings/Editor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ import Brick.Util (on)
import Brick.Widgets.Border (border, borderWithLabel)
import Brick.Widgets.Center (center)
import Brick.Widgets.Edit (editAttr, editFocusedAttr)
import Data.Declaration
( NodeFormat (Function, ModuleFunction, PackageModuleFunction)
)
import Data.Declaration (NodeFormat (Function, ModuleFunction, PackageModuleFunction))
import Data.GraphViz.Attributes.Complete (RankDir (..))
import Data.GraphViz.Commands (GraphvizCommand (Circo, Dot, Neato, TwoPi))
import Data.Text (Text)
import Data.Void (Void)
import Graphics.Vty qualified as V
import Graphics.Vty.Attributes (black, blue, defAttr, red, white, yellow)
import Graphics.Vty.Platform.Unix qualified as V
import Lens.Micro (Lens')
import Settings (Settings)
import Settings qualified as S
Expand Down Expand Up @@ -182,7 +181,7 @@ handleEvent event = case event of
editSettings :: Settings -> IO Settings
editSettings settings = do
let buildVty = do
v <- V.mkVty =<< V.standardIOConfig
v <- V.mkVty V.defaultConfig
V.setMode (V.outputIface v) V.Mouse True
return v
form0 = mkForm settings
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resolver: lts-20.26
resolver: lts-22.13
packages:
- .
8 changes: 4 additions & 4 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages: []
snapshots:
- completed:
sha256: 5a59b2a405b3aba3c00188453be172b85893cab8ebc352b1ef58b0eae5d248a2
size: 650475
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/26.yaml
original: lts-20.26
sha256: 6f0bea3ba5b07360f25bc886e8cff8d847767557a492a6f7f6dcb06e3cc79ee9
size: 712905
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/13.yaml
original: lts-22.13

0 comments on commit ef163f7

Please sign in to comment.