Open
Description
Describe the bug
In case that cabal's new-build and new-install compile the package's custom Setup.hs, ghc-options in ~/.cabal/config
is not passed to ghc.
To Reproduce
Steps to reproduce the behavior:
- Put
ghc-options: -dynamic
inprogram-default-options
section in~/.cabal/config
- Untar cabal-install source tarball
- In that directory, cabal v2-build -v
- Find the
/usr/bin/ghc
command-line for cabal-install'ssetup.hs
does not have-dynamic option
$ cabal v2-build -v
...
creating
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0
creating
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5
creating
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux
creating
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5
creating
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0
creating
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/cache
creating
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup
copy /home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/./Setup.hs to
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup/setup.hs
/usr/bin/ghc --make -fbuilding-cabal-package -odir /home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup -hidir /home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup -i -i/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/. -optP-include -optP/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup/setup_macros.h -hide-all-packages -no-user-package-db -package-db /home/esrevinu/.cabal/store/ghc-8.6.5/package.db -package-db /home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/packagedb/ghc-8.6.5 -package-id Cabal-3.0.0.0-46bddd9dcdb0614f6b3d4b9186e1471e15bdb76d345f3381c71918ee64d5fd9d -package-id base-4.12.0.0 -package-id filepath-1.4.2.1 -package-id process-1.6.5.0 /home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup/setup.hs -o /home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup/setup -threaded
[1 of 1] Compiling Main ( /home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup/setup.hs, /home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup/Main.o )
/home/esrevinu/tmp/cabal-install/cabal-install-3.0.0.0/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cabal-install-3.0.0.0/setup/setup.hs:1:1: error:
Could not find module ‘Prelude’
There are files missing in the ‘base-4.12.0.0’ package,
try running 'ghc-pkg check'.
Use -v to see a list of the files searched for.
|
1 | import Distribution.PackageDescription ( PackageDescription )
| ^
Expected behavior
-dynamic
option should be passed to ghc so that ghc can compile that setup.hs
on Arch Linux without static library.
System information
- Operating system: Arch Linux
cabal
,ghc
versions: cabal-install version 3.0.0.0
compiled using version 3.0.0.0 of the Cabal library, ghc 8.6.5; also cabal-install 2.4.0.0 and Cabal 2.4.0.1
Additional context
With cabal-install 3.0.0.0, --ghc-options=-dynamic
command-line option passes the option to ghc.
Building library package Cabal-3.0.0.0 does not fail. I think that it is because Cabal package is built Using self-exec internal setup method with build-type Simple and args
.