Closed
Description
General summary/comments (optional)
It looks like some combination of Hpack, OverloadedLists, OverloadedString, and RebindableSyntax results in the generation of an invalid "Paths_*" module for the project. In particular, it doesn't import GHC.Exts to compensate for the lack of "fromListN" and "fromString" within scope.
I'm not sure whether this is an issue with stack or cabal's "Distribution.Simple.defaultMain" so I'm asking here first.
Steps to reproduce
Basic: stack build
within the attached example project.
Suspected:
- Have a project where hpack adds the autogenerated "paths_" to the cabal file (I'm not clear on the condition needed for this)
- Ensure you have OverloadedStrings and RebindableSyntax extensions enabled.
- Have an exported module.
- Build the package.
Expected
Build Succeeds
Actual
Trimmed output below, full output at http://lpaste.net/361747
$ stack build edg-prelude
edg-prelude-0.1.0.0: build (lib)
Preprocessing library for edg-prelude-0.1.0.0..
Building library for edg-prelude-0.1.0.0..
[2 of 2] Compiling Paths_edg_prelude ( .stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/autogen/Paths_edg_prelude.hs, .stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/Paths_edg_prelude.o )
/home/rkr/Workspace/edg-1.5/edg-prelude/.stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/autogen/Paths_edg_prelude.hs:29:19: error:
Not in scope: ‘fromListN’
|
29 | version = Version [0,1,0,0] []
| ^^^^^^^^^
{.. snip ..}
/home/rkr/Workspace/edg-1.5/edg-prelude/.stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/autogen/Paths_edg_prelude.hs:50:18: error:
Not in scope: ‘fromString’
Perhaps you meant ‘showString’ (imported from Prelude)
|
50 | return (dir ++ "/" ++ name)
| ^^^
-- While building custom Setup.hs for package edg-prelude-0.1.0.0 using:
/home/rkr/.stack/setup-exe-cache/x86_64-linux-nopie/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0 build lib:edg-prelude --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Stack version
$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0
Method of installation
curl -sSL https://get.haskellstack.org/ | sh
with a recentstack upgrade