Template Haskell and stage-1

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

I also have a related request, if someone comes around with great build
system experience. I usually hack on GHC with BUILD_DOCS = NO, and it
always annoys me that the xhtml and co libraries are built even then,
without ever needing those, making my build slower.
Gergely
On Wed, 6 Nov 2013 13:43:02 +0000, Simon Peyton-Jones
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
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

On Wed, Nov 06, 2013 at 01:43:02PM +0000, Simon Peyton-Jones wrote:
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?
It's due to the build system phases: http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture/Idiom/PhaseOrderi... Stage2 doesn't exist during the phase in which DPH is configured. Changing it to use stage 2 would probably mean adding another phase for things that need to be configured by stage 2. This might mean slower builds due to loss of parallelism, I'm not sure. Perhaps the decision to build DPH with the GHC build system should be revisited? It causes some complication, and it seems that more and more people are disabling it anyway, in order to get faster builds. Thanks Ian

Maybe DPH just should be left out of being built in the default target?
Just an idea,
Gabor
On 11/6/13, Ian Lynagh
On Wed, Nov 06, 2013 at 01:43:02PM +0000, Simon Peyton-Jones wrote:
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?
It's due to the build system phases: http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture/Idiom/PhaseOrderi...
Stage2 doesn't exist during the phase in which DPH is configured. Changing it to use stage 2 would probably mean adding another phase for things that need to be configured by stage 2. This might mean slower builds due to loss of parallelism, I'm not sure.
Perhaps the decision to build DPH with the GHC build system should be revisited? It causes some complication, and it seems that more and more people are disabling it anyway, in order to get faster builds.
Thanks Ian
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

This sort of ties into some of the post 7.8 build system cleanup plans
perhaps?
On Wed, Nov 6, 2013 at 12:19 PM, Gabor Greif
Maybe DPH just should be left out of being built in the default target?
Just an idea,
Gabor
On 11/6/13, Ian Lynagh
wrote: On Wed, Nov 06, 2013 at 01:43:02PM +0000, Simon Peyton-Jones wrote:
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?
It's due to the build system phases:
http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture/Idiom/PhaseOrderi...
Stage2 doesn't exist during the phase in which DPH is configured. Changing it to use stage 2 would probably mean adding another phase for things that need to be configured by stage 2. This might mean slower builds due to loss of parallelism, I'm not sure.
Perhaps the decision to build DPH with the GHC build system should be revisited? It causes some complication, and it seems that more and more people are disabling it anyway, in order to get faster builds.
Thanks Ian
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
participants (5)
-
Carter Schonwald
-
Gabor Greif
-
Gergely Risko
-
Ian Lynagh
-
Simon Peyton-Jones