Hadrian doesn't seem to handle integer-simple properly
Summary
When trying to build ghc-8.8.1-rc1 branch using Hadrian and requesting to use the integer-simple
library, the flags don't get properly propagated. To be precise, the library text
can't build because it gets -optP-DINTEGER_GMP
as a flag.
Steps to reproduce
Redefine userFlavour
in hadrian/src/UserSettings.hs
:
userFlavour :: Flavour
userFlavour = defaultFlavour { name = "simple", integerLibrary = pure integerSimple }
and then:
./hadrian/build.sh -c -j --flavour=simple
And while building, this error arises:
Command line: /usr/local/bin/ghc -M -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db _build/stage0/lib/package.conf.d' '-this-unit-id text-1.2.3.1' '-package-id array-0.5.3.0' '-package-id base-4.12.0.0' '-package-id binary-0.8.7.0' '-package-id bytestring-0.10.8.2' '-package-id deepseq-1.4.4.0' '-package-id ghc-prim-0.5.3' '-package-id integer-simple-0.1.1.1' -i -i_build/stage0/libraries/text/build -i_build/stage0/libraries/text/build/autogen -ilibraries/text/. -I_build/generated -I_build/stage0/libraries/text/build -I_build/stage0/libraries/text/build/include -Ilibraries/text/include -I/usr/local/lib/ghc-8.6.5/bytestring-0.10.8.2/include -I/usr/local/lib/ghc-8.6.5/base-4.12.0.0/include -I/usr/local/lib/ghc-8.6.5/include -I_build/generated -optc-I_build/generated -optP-include -optP_build/stage0/libraries/text/build/autogen/cabal_macros.h -optP-DINTEGER_GMP -outputdir _build/stage0/libraries/text/build -include-pkg-deps -dep-makefile _build/stage0/libraries/text/.dependencies.mk -dep-suffix '' libraries/text/Data/Text.hs libraries/text/Data/Text/Array.hs libraries/text/Data/Text/Encoding.hs libraries/text/Data/Text/Encoding/Error.hs libraries/text/Data/Text/Foreign.hs libraries/text/Data/Text/IO.hs libraries/text/Data/Text/Internal.hs libraries/text/Data/Text/Internal/Builder.hs libraries/text/Data/Text/Internal/Builder/Functions.hs libraries/text/Data/Text/Internal/Builder/Int/Digits.hs libraries/text/Data/Text/Internal/Builder/RealFloat/Functions.hs libraries/text/Data/Text/Internal/Encoding/Fusion.hs libraries/text/Data/Text/Internal/Encoding/Fusion/Common.hs libraries/text/Data/Text/Internal/Encoding/Utf16.hs libraries/text/Data/Text/Internal/Encoding/Utf32.hs libraries/text/Data/Text/Internal/Encoding/Utf8.hs libraries/text/Data/Text/Internal/Functions.hs libraries/text/Data/Text/Internal/Fusion.hs libraries/text/Data/Text/Internal/Fusion/CaseMapping.hs libraries/text/Data/Text/Internal/Fusion/Common.hs libraries/text/Data/Text/Internal/Fusion/Size.hs libraries/text/Data/Text/Internal/Fusion/Types.hs libraries/text/Data/Text/Internal/IO.hs libraries/text/Data/Text/Internal/Lazy.hs libraries/text/Data/Text/Internal/Lazy/Encoding/Fusion.hs libraries/text/Data/Text/Internal/Lazy/Fusion.hs libraries/text/Data/Text/Internal/Lazy/Search.hs libraries/text/Data/Text/Internal/Private.hs libraries/text/Data/Text/Internal/Read.hs libraries/text/Data/Text/Internal/Search.hs libraries/text/Data/Text/Internal/Unsafe.hs libraries/text/Data/Text/Internal/Unsafe/Char.hs libraries/text/Data/Text/Internal/Unsafe/Shift.hs libraries/text/Data/Text/Lazy.hs libraries/text/Data/Text/Lazy/Builder.hs libraries/text/Data/Text/Lazy/Builder/Int.hs libraries/text/Data/Text/Lazy/Builder/RealFloat.hs libraries/text/Data/Text/Lazy/Encoding.hs libraries/text/Data/Text/Lazy/IO.hs libraries/text/Data/Text/Lazy/Internal.hs libraries/text/Data/Text/Lazy/Read.hs libraries/text/Data/Text/Read.hs libraries/text/Data/Text/Show.hs libraries/text/Data/Text/Unsafe.hs -O -H32m -Wall -fwarn-tabs -funbox-strict-fields -O2 -XHaskell98 -fno-warn-deprecated-flags
Exit code: 1
Stderr:
libraries/text/Data/Text/Lazy/Builder/Int.hs:40:8: error:
Could not find module ‘GHC.Integer.GMP.Internals’
Perhaps you meant
GHC.Integer.Simple.Internals (from integer-simple-0.1.1.1)
Use -v to see a list of the files searched for.
|
40 | import GHC.Integer.GMP.Internals (Integer(S#))
| ^^^^^^^^^^^^^^^^^^^^^^^^^
The flag -optP-DINTEGER_GMP
is being passed to the library and this shouldn't be the case.
Expected behavior
I would expect the libraries to build without issues.
Environment
- GHC version used:
> cabal --version
cabal-install version 2.4.0.0
> ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
- Operating System: Ubuntu 19.04