You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
GHC 8 added the new TemplateHaskellQuotes extension for the subset of TH that a stage 1 GHC supports: https://ghc.haskell.org/trac/ghc/ticket/11102. HaLVM uses a (modified) stage 1 GHC, except it hacks in TH support: https://github.com/GaloisInc/HaLVM/wiki/What-is-the-Difference-Between-GHC-and-the-HaLVM?#the-games-we-play-with-ghc. Those hacks aren't aware of the new treatment of the TemplateHaskell extension in GHC 8, and so TemplateHaskell is not listed by halvm-ghc --supported-languages. Cabal uses <Haskell compiler> --supported-languages to determine which extensions the Haskell compiler supports, so halvm-ghc can no longer be used to build Cabal packages that list TemplateHaskell in the extensions in the .cabal file.
Easy workaround (that doesn't work :P)
Patch halvm-ghc to treat --supported-languages specially:
--- /usr/bin/halvm-ghc.orig 2017-03-22 15:07:42.945173502 -0700+++ /usr/bin/halvm-ghc 2017-03-22 16:06:35.588340911 -0700@@ -16,6 +16,18 @@
then echo "2.4.0"; exit;
fi
+# In GHC 8, for stage 1 compilers, the TemplateHaskellQuote extension+# was added and the TemplateHaskell extension was removed from the+# list of supported extensions. Cabal uses the list of supported+# extensions returned by '--supported-extensions' to check that the+# extensions listed in the .cabal file are supported.+for arg in "$@"; do+ if [[ "$arg" == "--supported-extensions" ||+ "$arg" == "--supported-languages" ]]; then+ echo TemplateHaskell+ fi+done+
GHCBIN="${bindir}/x86_64-unknown-HaLVM-ghc"
LINKSCRIPTOPT="-pgml ${libdir}/ldkernel -optl -static -rtsopts"
LIBDIROPT="-L${libdir}"
I've tested this hacky fix. UPDATE: it allows halvm-cabal to succeed, but then halvm-ghc rejects any files with TemplateHaskell in a LANGUAGE pragma.
Problem
GHC 8 added the new
TemplateHaskellQuotes
extension for the subset of TH that a stage 1 GHC supports: https://ghc.haskell.org/trac/ghc/ticket/11102. HaLVM uses a (modified) stage 1 GHC, except it hacks in TH support: https://github.com/GaloisInc/HaLVM/wiki/What-is-the-Difference-Between-GHC-and-the-HaLVM?#the-games-we-play-with-ghc. Those hacks aren't aware of the new treatment of theTemplateHaskell
extension in GHC 8, and soTemplateHaskell
is not listed byhalvm-ghc --supported-languages
. Cabal uses<Haskell compiler> --supported-languages
to determine which extensions the Haskell compiler supports, sohalvm-ghc
can no longer be used to build Cabal packages that listTemplateHaskell
in the extensions in the.cabal
file.Easy workaround (that doesn't work :P)
Patch
halvm-ghc
to treat--supported-languages
specially:I've tested this hacky fix. UPDATE: it allows
halvm-cabal
to succeed, but thenhalvm-ghc
rejects any files withTemplateHaskell
in aLANGUAGE
pragma.Proper (?) fix
Reverse the logic added to GHC 8 to not list
TemplateHaskell
as supported for stage 1 GHCs: https://git.haskell.org/ghc.git/commitdiff/98a4fa5fb740ce43a1787eb5730e35b463a2de79.The text was updated successfully, but these errors were encountered: