Open wolfgangwalther opened 2 months ago
Describe the bug
When using Setup.hs's configure + build steps a GHC option passed in the configure is not applied in the build step, when the build step uses the --with-ghc option.
Setup.hs
configure
build
--with-ghc
To Reproduce
Using the hello world package from hackage.
$ runhaskell Setup.hs configure --ghc-options=-j2 $ runhaskell Setup.hs build -v --with-ghc=ghc [...] Running: [...]/ghc --make -no-link -fbuilding-cabal-package -O -static -outputdir dist/build/hello/hello-tmp -odir dist/build/hello/hello-tmp -hidir dist/build/hello/hello-tmp -hiedir dist/build/hello/hello-tmp/extra-compilation-artifacts/hie -stubdir dist/build/hello/hello-tmp -i -isrc -idist/build/hello/hello-tmp -idist/build/hello/autogen -idist/build/global-autogen -Idist/build/hello/autogen -Idist/build/global-autogen -Idist/build/hello/hello-tmp -optP-include -optPdist/build/hello/autogen/cabal_macros.h -this-unit-id hello-1.0.0.2-9svDvC3HZPN7tI0quUyWXf-hello -hide-all-packages -Wmissing-home-modules -no-user-package-db -package-db dist/package.conf.inplace -package-id base-4.20.0.0-18ae -XHaskell98 src/hello.hs [...]
The -j2 is not passed.
-j2
Expected behavior
-j2 should be passed to ghc. The same output when running build without --with-ghc:
ghc
Running: [...]/ghc --make -no-link -fbuilding-cabal-package -O -static -outputdir dist/build/hello/hello-tmp -odir dist/build/hello/hello-tmp -hidir dist/build/hello/hello-tmp -hiedir dist/build/hello/hello-tmp/extra-compilation-artifacts/hie -stubdir dist/build/hello/hello-tmp -i -isrc -idist/build/hello/hello-tmp -idist/build/hello/autogen -idist/build/global-autogen -Idist/build/hello/autogen -Idist/build/global-autogen -Idist/build/hello/hello-tmp -optP-include -optPdist/build/hello/autogen/cabal_macros.h -this-unit-id hello-1.0.0.2-9svDvC3HZPN7tI0quUyWXf-hello -hide-all-packages -Wmissing-home-modules -no-user-package-db -package-db dist/package.conf.inplace -package-id base-4.20.0.0-18ae -XHaskell98 src/hello.hs -j2
Note the additional -j2 at the end.
System information
Tested with various cabal and GHC versions. Still present in cabal 3.10.3.0, but was also there in 3.8.x.
Additional context
First noticed in nixpkgs when cross-compiling.
Workaround: Remove --with-ghc from build step - it's added in configure anyway.
The documentation lists --with-PROG= as an option specific to Setup.hs configure, so maybe Setup.hs build should just reject it?
--with-PROG=
Setup.hs configure
Setup.hs build
Describe the bug
When using
Setup.hs
'sconfigure
+build
steps a GHC option passed in the configure is not applied in the build step, when the build step uses the--with-ghc
option.To Reproduce
Using the hello world package from hackage.
The
-j2
is not passed.Expected behavior
-j2
should be passed toghc
. The same output when running build without--with-ghc
:Note the additional
-j2
at the end.System information
Tested with various cabal and GHC versions. Still present in cabal 3.10.3.0, but was also there in 3.8.x.
Additional context
First noticed in nixpkgs when cross-compiling.
Workaround: Remove
--with-ghc
frombuild
step - it's added inconfigure
anyway.