Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building with GHC 9.6.2 #74

Merged
merged 7 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
# Workaround for 'No space left on device' error
- name: free disk space
run: |
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ SHELL [ "/bin/bash", "-c" ]
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
# Set the PATH variable to include a custom directory
ENV PATH="${PATH}:/root/.local/bin"

# install packages
RUN apt-get update \
&& apt-get install -y build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 locales \
&& echo "source /root/.ghcup/env" >> ~/.bashrc \
# install ghcup, ghc-9.4.4 and cabal-3.8.1.0
# install ghcup, ghc-9.6.2 and cabal-3.10.1.0
&& curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | \
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=9.4.4 BOOTSTRAP_HASKELL_CABAL_VERSION=3.8.1.0 \
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=9.6.2 BOOTSTRAP_HASKELL_CABAL_VERSION=3.10.1.0 \
BOOTSTRAP_HASKELL_INSTALL_STACK=1 BOOTSTRAP_HASKELL_INSTALL_HLS=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=P sh \
&& source /root/.ghcup/env \
&& cabal install hpack \
Expand Down
24 changes: 12 additions & 12 deletions lib/Language/Souffle/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ type family IsInput fact dir where
IsInput _ 'Input = ()
IsInput _ 'InputOutput = ()
IsInput fact dir = TypeError
( 'Text "You tried to use an " ':<>: 'ShowType (FormatDirection dir) ':<>: 'Text " fact of type " ':<>: 'ShowType fact ':<>: 'Text " as an input."
':$$: 'Text "Possible solution: change the FactDirection of " ':<>: 'ShowType fact
':<>: 'Text " to either 'Input' or 'InputOutput'."
( 'Text "You tried to use an " ' :<>: 'ShowType (FormatDirection dir) ' :<>: 'Text " fact of type " ' :<>: 'ShowType fact ' :<>: 'Text " as an input."
luc-tielen marked this conversation as resolved.
Show resolved Hide resolved
' :$$: 'Text "Possible solution: change the FactDirection of " ' :<>: 'ShowType fact
' :<>: 'Text " to either 'Input' or 'InputOutput'."
)

type IsOutput :: Type -> Direction -> Constraint
type family IsOutput fact dir where
IsOutput _ 'Output = ()
IsOutput _ 'InputOutput = ()
IsOutput fact dir = TypeError
( 'Text "You tried to use an " ':<>: 'ShowType (FormatDirection dir) ':<>: 'Text " fact of type " ':<>: 'ShowType fact ':<>: 'Text " as an output."
':$$: 'Text "Possible solution: change the FactDirection of " ':<>: 'ShowType fact
':<>: 'Text " to either 'Output' or 'InputOutput'."
( 'Text "You tried to use an " ' :<>: 'ShowType (FormatDirection dir) ' :<>: 'Text " fact of type " ' :<>: 'ShowType fact ' :<>: 'Text " as an output."
' :$$: 'Text "Possible solution: change the FactDirection of " ' :<>: 'ShowType fact
' :<>: 'Text " to either 'Output' or 'InputOutput'."
)

type FormatDirection :: Direction -> Symbol
Expand All @@ -96,12 +96,12 @@ type family ContainsFact prog fact where
type CheckContains :: Type -> [Type] -> Type -> Constraint
type family CheckContains prog facts fact :: Constraint where
CheckContains prog '[] fact =
TypeError ('Text "You tried to perform an action with a fact of type '" ':<>: 'ShowType fact
':<>: 'Text "' for program '" ':<>: 'ShowType prog ':<>: 'Text "'."
':$$: 'Text "The program contains the following facts: " ':<>: 'ShowType (ProgramFacts prog) ':<>: 'Text "."
':$$: 'Text "It does not contain fact: " ':<>: 'ShowType fact ':<>: 'Text "."
':$$: 'Text "You can fix this error by adding the type '" ':<>: 'ShowType fact
':<>: 'Text "' to the ProgramFacts type in the Program instance for " ':<>: 'ShowType prog ':<>: 'Text ".")
TypeError ('Text "You tried to perform an action with a fact of type '" ' :<>: 'ShowType fact
' :<>: 'Text "' for program '" ' :<>: 'ShowType prog ' :<>: 'Text "'."
' :$$: 'Text "The program contains the following facts: " ' :<>: 'ShowType (ProgramFacts prog) ' :<>: 'Text "."
' :$$: 'Text "It does not contain fact: " ' :<>: 'ShowType fact ' :<>: 'Text "."
' :$$: 'Text "You can fix this error by adding the type '" ' :<>: 'ShowType fact
' :<>: 'Text "' to the ProgramFacts type in the Program instance for " ' :<>: 'ShowType prog ' :<>: 'Text ".")
CheckContains _ (a ': _) a = ()
CheckContains prog (_ ': as) b = CheckContains prog as b

Expand Down
12 changes: 6 additions & 6 deletions lib/Language/Souffle/Marshal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ type family ProductLike t f where
ProductLike t (M1 _ _ a) = ProductLike t a
ProductLike _ (K1 _ _) = ()
ProductLike t (_ :+: _) =
TypeError ( 'Text "Error while deriving marshalling code for type " ':<>: 'ShowType t ':<>: 'Text ":"
':$$: 'Text "Cannot derive sum type, only product types are supported.")
TypeError ( 'Text "Error while deriving marshalling code for type " ' :<>: 'ShowType t ' :<>: 'Text ":"
' :$$: 'Text "Cannot derive sum type, only product types are supported.")
ProductLike t U1 =
TypeError ( 'Text "Error while deriving marshalling code for type " ':<>: 'ShowType t ':<>: 'Text ":"
':$$: 'Text "Cannot automatically derive code for 0 argument constructor.")
TypeError ( 'Text "Error while deriving marshalling code for type " ' :<>: 'ShowType t ' :<>: 'Text ":"
' :$$: 'Text "Cannot automatically derive code for 0 argument constructor.")
ProductLike t V1 =
TypeError ( 'Text "Error while deriving marshalling code for type " ':<>: 'ShowType t ':<>: 'Text ":"
':$$: 'Text "Cannot derive void type.")
TypeError ( 'Text "Error while deriving marshalling code for type " ' :<>: 'ShowType t ' :<>: 'Text ":"
' :$$: 'Text "Cannot derive void type.")

type OnlyMarshallableFields :: (Type -> Type) -> Constraint
type family OnlyMarshallableFields f where
Expand Down
Loading