You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In elabProgramArgs, the <> perPkgOptionMapMappend pkgid packageConfigProgramArgs is what contains the flags twice, for example fromList [("ld",["-s","-s"])].
Found in https://github.com/haskell/cabal/pull/5451/files#r310417490:
Problem
When a flag like
--gcc-option
or the new--ld-option
is given tocabal build
, the eventual gcc/ld invocation will be given that flag twice.For example, if you
cabal build --gcc-option=-v
, thengcc -v -v
will be called.You can verify this by passing
-v
to cabal and ghc, or using strace.This is obviously problematic when giving a flag twice results in different behaviour from the tool than giving it once.
Environment
Cabal version:
3.0.0.0
built from commit 1b324a1, on Ubuntu 16.04.Reason
I've spent a couple hours figuring out where this comes from.
The problem is in
cabal/cabal-install/Distribution/Client/ProjectPlanning.hs
Lines 1851 to 1857 in 1b324a1
In
elabProgramArgs
, the<> perPkgOptionMapMappend pkgid packageConfigProgramArgs
is what contains the flags twice, for examplefromList [("ld",["-s","-s"])]
.This is due to
cabal/cabal-install/Distribution/Client/ProjectPlanning.hs
Line 1899 in 1b324a1
which does
cabal/cabal-install/Distribution/Client/ProjectPlanning.hs
Lines 1909 to 1922 in 1b324a1
In
global `mappend` local `mappend` perpkg
, eachglobal
andlocal
containMapMappend {getMapMappend = fromList [("ld",["-s"])]}
.This seems wrong.
The commit message of the commit that introduced this, 20d0026, says
This suggests that such options should only be in
local
. How comes they are also inglobal
?The text was updated successfully, but these errors were encountered: