Skip to content

Commit

Permalink
Compatebility with ghc 9.10 + Updated CI to test 9.6, 9.8, and 9.10 (#…
Browse files Browse the repository at this point in the history
…233)

* build with ghc 9.10; use a custom vector-circular for now

* updating tested-with stanzas

* bump haskell-ci version

* use latest version of cabal (to see if that helps the failure on 9.10)

* bump cabal version

* allow newer for entryopy

* updating the allow-newer thing

* using Line.General instead of our custom line type

* some work on the divide and conquer algorithm; or rather on dealing with degeneracies

* bound on entropy

* making the divide and conqer algo compile

- implemented intersection between VerticalOrLineEQ lines

* listing the skia/index.html file as a source file

* allow newer

* missing autogen-modules
  • Loading branch information
noinia authored Jun 30, 2024
1 parent ffacfb6 commit 1a87e84
Show file tree
Hide file tree
Showing 15 changed files with 317 additions and 111 deletions.
84 changes: 55 additions & 29 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.16.5
# version: 0.19.20240514
#
# REGENDATA ("0.16.5",["github","cabal.project"])
# REGENDATA ("0.19.20240514",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -23,37 +23,37 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.6.4
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.6.4
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.5
compilerKind: ghc
compilerVersion: 9.6.5
setup-method: ghcup
allow-failure: false
# - compiler: ghc-9.4.4
# compilerKind: ghc
# compilerVersion: 9.4.4
# setup-method: ghcup
# allow-failure: false
# - compiler: ghc-9.2.5
# compilerKind: ghc
# compilerVersion: 9.2.5
# 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 libtinfo5
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
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)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -65,11 +65,13 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$HOME/.ghcup/bin/$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=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.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"
Expand Down Expand Up @@ -126,14 +128,15 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/hgeometry-combinatorial" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/hgeometry" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/hgeometry-examples" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand All @@ -149,23 +152,40 @@ jobs:
echo "PKGDIR_hgeometry_combinatorial=${PKGDIR_hgeometry_combinatorial}" >> "$GITHUB_ENV"
PKGDIR_hgeometry="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hgeometry-[0-9.]*')"
echo "PKGDIR_hgeometry=${PKGDIR_hgeometry}" >> "$GITHUB_ENV"
PKGDIR_hgeometry_examples="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/hgeometry-examples-[0-9.]*')"
echo "PKGDIR_hgeometry_examples=${PKGDIR_hgeometry_examples}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_hgeometry_combinatorial}" >> cabal.project
echo "packages: ${PKGDIR_hgeometry}" >> cabal.project
echo "packages: ${PKGDIR_hgeometry_examples}" >> cabal.project
echo "package hgeometry-combinatorial" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package hgeometry" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo "package hgeometry-examples" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
allow-newer: vector-circular:vector
allow-newer: vector-circular:base
allow-newer: vector-circular:template-haskell
allow-newer: vector-circular:semigroupoids
allow-newer: miso:servant
allow-newer: vector-circular:primitive
allow-newer: vector-circular:deepseq
allow-newer: all:jsaddle
allow-newer: lucid-svg:transformerstext
allow-newer: servant-lucid:servant
allow-newer: lucid-svg:transformers
allow-newer: servant:base
allow-newer: vault:base
allow-newer: singleton-bool:base
allow-newer: lucid-svg:transformerstext
allow-newer: pretty:deepseq
allow-newer: pretty:dlist
allow-newer: hexpat:deepseq
allow-newer: websockets:all
allow-newer: jsaddle-warp:all
allow-newer: entropy:all
source-repository-package
type: git
Expand All @@ -175,20 +195,24 @@ jobs:
type: git
location: https://github.com/noinia/hspec-with-tempfile
source-repository-package
type: git
location: https://github.com/noinia/miso-bulma
source-repository-package
type: git
location: https://github.com/ghcjs/jsaddle
subdir: jsaddle
location: https://github.com/noinia/vector-circular
tag: 98090784e9ed97cf761cf69ad3f32b88dbdd30a2
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(hgeometry|hgeometry-combinatorial)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(hgeometry|hgeometry-combinatorial|hgeometry-examples)$/; }' >> 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: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -212,6 +236,8 @@ jobs:
${CABAL} -vnormal check
cd ${PKGDIR_hgeometry} || false
${CABAL} -vnormal check
cd ${PKGDIR_hgeometry_examples} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
Expand All @@ -220,7 +246,7 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
Expand Down
29 changes: 24 additions & 5 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ packages:
hgeometry-combinatorial
hgeometry
hgeometry-examples
../hiraffe
../miso-bulma
-- ../hiraffe
-- ../miso-bulma

allow-newer:
vector-circular:vector,
Expand All @@ -17,15 +17,30 @@ allow-newer:
vector-circular:deepseq,
all:jsaddle,
lucid-svg:transformers,text,
servant-lucid:servant,
servant:base,
vault:base,
singleton-bool:base,
lucid-svg:transformers,text,
pretty:deepseq,
pretty:dlist,
hexpat:deepseq,
websockets:all,
jsaddle-warp:all,
entropy:Cabal

-- source-repository-package
-- type: git
-- location: https://github.com/noinia/hiraffe
source-repository-package
type: git
location: https://github.com/noinia/hiraffe

source-repository-package
type: git
location: https://github.com/noinia/hspec-with-tempfile

source-repository-package
type: git
location: https://github.com/noinia/miso-bulma

-- source-repository-package
-- type: git
-- location: https://github.com/ghcjs/jsaddle
Expand All @@ -42,6 +57,10 @@ source-repository-package
-- location: https://github.com/noinia/miso
-- tag: 1d16ba220bcd6be28d1e89d141330cd6875c70ff

source-repository-package
type: git
location: https://github.com/noinia/vector-circular
tag: 98090784e9ed97cf761cf69ad3f32b88dbdd30a2

package miso
flags: +jsaddle
6 changes: 3 additions & 3 deletions hgeometry-combinatorial/hgeometry-combinatorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ extra-doc-files:
-- extra-source-files:

tested-with:
GHC == 9.2.5
, GHC == 9.4.4
, GHC == 9.6.1
GHC == 9.6.5
, GHC == 9.8.2
, GHC == 9.10.1

--------------------------------------------------------------------------------

Expand Down
11 changes: 7 additions & 4 deletions hgeometry-examples/hgeometry-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ maintainer: [email protected]
category: Geometry
build-type: Simple
extra-doc-files: CHANGELOG.md
-- extra-source-files:
data-files: data/**/*.in
data/**/*.out
extra-source-files:
skia/index.html
data-files:
data/**/*.in
data/**/*.out

tested-with:
GHC == 9.6.4
GHC == 9.6.5
, GHC == 9.8.2
, GHC == 9.10.1

source-repository head
type: git
Expand Down
1 change: 0 additions & 1 deletion hgeometry-examples/skia/StrokeAndFill.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module StrokeAndFill
( Status(..)
, _InActive, _Active
Expand Down
12 changes: 10 additions & 2 deletions hgeometry/hgeometry.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ data-files:
test-with-ipe/**/*.ipe

tested-with:
GHC == 9.6.4
GHC == 9.6.5
, GHC == 9.8.2
, GHC == 9.10.1

source-repository head
type: git
Expand Down Expand Up @@ -76,6 +77,8 @@ common all-setup
, ghc-typelits-natnormalise >= 0.7.7 && < 1
, ghc-typelits-knownnat >= 0.7.6 && < 1

, entropy >= 0.4.1.10

default-language: GHC2021

default-extensions:
Expand Down Expand Up @@ -432,6 +435,9 @@ library
-- HGeometry.Plane.LowerEnvelope.Sample


HGeometry.Plane.LowerEnvelope.DivideAndConquer
HGeometry.Plane.LowerEnvelope.EpsApproximation

-- HGeometry.Plane.LowerEnvelope.AtMostThree
-- HGeometry.Plane.LowerEnvelope.Triangulate

Expand Down Expand Up @@ -695,7 +701,9 @@ test-suite with-ipe-hspec
PlaneGraph.RenderSpec
HalfPlane.CommonIntersectionSpec
Line.LowerEnvelopeSpec

Paths_hgeometry
autogen-modules:
Paths_hgeometry
hs-source-dirs: test-with-ipe/test
build-depends:
hspec-with-tempfile >= 0.1
Expand Down
2 changes: 1 addition & 1 deletion hgeometry/kernel/src/HGeometry/Line.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module HGeometry.Line
( module HGeometry.Line.Class
, module HGeometry.Line.LineEQ
, module HGeometry.Line.PointAndVector
, LineLineIntersection(..)
, LineLineIntersection, LineLineIntersectionG(..)
) where

import Control.Lens
Expand Down
Loading

0 comments on commit 1a87e84

Please sign in to comment.