Open demokritos opened 4 years ago
Looks like ghc-options: dynamic
in cabal.project is not honored either.
Isn't -dynamic a special case? Does the same happen with other flags like the -W ones?
Tested with -Weverything
flag and got same results. Non of flags in ~/.cabal/config
, project-name.cabal
, cabal.project
worked with custom build type project. I'm using cabal-install 3.4.0.0 rc7 with GHC 8.10.4.
I just tested program-default-options ghc-options: -dynamic
did work in v1- commands. Also having a global option for this is way more useful than having one in the custom-setup stanza (for reasons stated in #5038).
So this is a bug and a regression, and it isn't related to /fixed by #5038. And it's blocking arch linux users...
I just tried to repro this with cabal-install
version 3.2.0.0 as well as with my custom build of the repo with latest commit. In both cases, I tried creating a new repo with cabal init
and then just used cabal v2-build -v
with them to introspect the command passed to ghc
. I was able to find -dynamic
just like in my config file.
Just to double check, I added a dummy flag -blabla
into my config file, and got a compilation error from those.
Do other people still repro this issue ? Is it some kind of god fix ?
EDIT : ok after some tinkering with it, it's not actually fixed. When I try do install a package I don't have (for example cabal install yesod-bin
, I get the prelude missing error...)
A pity, In that case we are waiting for volunteers.
BTW, people reading this probably know that, but we encourage everybody to consider switching from using custom setups to alternative ways, inventing and implementing them, if needed. E.g., doctest no longer needs a custom setup.
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:
ghc-options: -dynamic
inprogram-default-options
section in~/.cabal/config
/usr/bin/ghc
command-line for cabal-install'ssetup.hs
does not have-dynamic option
Expected behavior
-dynamic
option should be passed to ghc so that ghc can compile thatsetup.hs
on Arch Linux without static library.System information
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.1Additional 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 builtUsing self-exec internal setup method with build-type Simple and args
.