Template Haskell and stage-1

Simon Peyton-Jones simonpj at microsoft.com
Wed Nov 6 13:43:02 UTC 2013


I'd like to make -XtemplateHaskell simply illegal in a stage-1 compiler. After all, it is!
But for some reason we use the stage1 compiler to generate dependencies for the DPH libraries; those libraries have {-# LANGUAGE TemplateHaskell #-}, so the dependency generation fails.  See below.
But WHY do we generate deps for DPH with stage1?  We don't *compile* the DPH libraries with stage1, because they need TH.  Can't we just generate deps with stage2?
For now I'll make it a warning, but could someone fix the build system?
Thanks
Simon



mv libraries/dph/dph-lifted-copy/dist-install/build/.depend-v-dyn.c_asm.tmp libraries/dph/dph-lifted-copy/dist-install/build/.depend-v-dyn.c_asm
"rm" -f libraries/dph/dph-lifted-copy/dist-install/build/.depend-v-dyn.haskell.tmp
"inplace/bin/ghc-stage1" -M -static  -H32m -O -Werror -Wall -H64m -O0    -package-name dph-lifted-copy-0.8.0.1 -hide-all-packages -i -ilibraries/dph/dph-lifted-copy/. -ilibraries/dph/dph-lifted-copy/dist-install/build -ilibraries/dph/dph-lifted-copy/dist-install/build/autogen -Ilibraries/dph/dph-lifted-copy/dist-install/build -Ilibraries/dph/dph-lifted-copy/dist-install/build/autogen -Ilibraries/dph/dph-lifted-copy/.    -optP-include -optPlibraries/dph/dph-lifted-copy/dist-install/build/autogen/cabal_macros.h -package array-0.5.0.0 -package base-4.7.0.0 -package dph-base-0.8.0.1 -package dph-prim-par-0.8.0.1 -package ghc-7.7.20131106 -package random-1.0.1.1 -package template-haskell-2.9.0.0 -package vector-0.10.9.1 -Odph -funbox-strict-fields -fcpr-off -fno-warn-orphans -fno-warn-missing-signatures -XHaskell98 -XTypeFamilies -XGADTs -XRankNTypes -XBangPatterns -XMagicHash -XUnboxedTuples -XTypeOperators -O2 -O -dcore-lint -fno-warn-amp  -fno-warn-deprecated-flags -Wwarn  -no-user-package-db -rtsopts      -odir libraries/dph/dph-lifted-copy/dist-install/build -hidir libraries/dph/dph-lifted-copy/dist-install/build -stubdir libraries/dph/dph-lifted-copy/dist-install/build -dep-makefile libraries/dph/dph-lifted-copy/dist-install/build/.depend-v-dyn.haskell.tmp -dep-suffix "" -dep-suffix "dyn_" -include-pkg-deps  libraries/dph/dph-lifted-copy/./Data/Array/Parallel.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Lifted.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Lifted/Closure.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Lifted/Combinators.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Lifted/PArray.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Lifted/Scalar.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Lifted/TH/Repr.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Lifted/Unboxed.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArr.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray/Base.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray/PData.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray/PDataInstances.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray/PRepr.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray/PReprInstances.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray/Scalar.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray/ScalarInstances.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/PArray/Types.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prelude.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prelude/Base.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prelude/Bool.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prelude/Double.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prelude/Float.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prelude/Int.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prelude/Tuple.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prelude/Word8.hs  libraries/dph/dph-lifted-copy/./Data/Array/Parallel/Prim.hs
ghc-stage1: libraries/dph/dph-lifted-copy/Data/Array/Parallel/Lifted/TH/Repr.hs:1:14-28: Template Haskell requires GHC with interpreter support
Perhaps you are using a stage-1 compiler?
Microsoft Research Limited (company number 03369488) is registered in England and Wales
Registered office is at 21 Station Road, Cambridge, CB1 2FB

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131106/86c8f08b/attachment-0001.html>


More information about the ghc-devs mailing list