Open hvr opened 5 years ago
Agreed that we should be consistent, and regenerating when build-tools
are present makes sense.
Another example is haskell-src-exts-1.13.5
which
build-tools: happy
happy
source: http://hackage.haskell.org/package/haskell-src-exts-1.13.5/src/src/Language/Haskell/Exts/InternalParser.lyAnd fails to build as a dependency built non-locally (i.e. via cabal repl -zb haskell-src-exts==1.13.5 -w ghc-7.8.4
) but would succeed when unpacked and build locally.
Problem manifestation
Here's a case I stumbled over where I'm not sure we have the proper semantics:
however, compare to
Diagnosis
The difference between the two builds is that in the first case, the pre-generated
scanner is compiled (NB: that
alex
was still provisioned byv2-build
to the build-process (in vain though) because it was declared viabuild-tools
; but it wasn't invoked) , which is not compatible with GHC 8.0.2; in the 2nd case however thebuild-tools: alex
declared in the package description is honored, and theis generated (and the pre-generated one in the
dist/build/
folder is ignored).So the issue here is whether re-running the pre-processors (when those are specified in
build-tools
) shall take priority over using pre-generated ones in the sdist inside the magicdist/build
folder.And this is currently handled inconsistently in the local (unpacked) vs non-local case by
v2-build
.Suggested resolution
If
build-tools
for the respective pre-processor is specified in the.cabal
file,v2-build
shall consistently always re-generate the respective source and use it, regardless of its existence in adist/build
folder.