ghc-cabal: Use fromFlagOrDefault instead of fromFlag
authorBen Gamari <ben@smart-cactus.org>
Sat, 20 Jul 2019 01:33:55 +0000 (21:33 -0400)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Sun, 21 Jul 2019 09:04:53 +0000 (05:04 -0400)
As fromFlag is partial. The only case where we used fromFlag is when
determining whether to strip libraries; we now assume that we shouldn't.

utils/ghc-cabal/Main.hs

index 7f2cf91..5827331 100644 (file)
@@ -14,7 +14,7 @@ import Distribution.Simple.LocalBuildInfo
 import Distribution.Simple.GHC
 import Distribution.Simple.Program
 import Distribution.Simple.Program.HcPkg
-import Distribution.Simple.Setup (ConfigFlags(configStripLibs), fromFlag, toFlag)
+import Distribution.Simple.Setup (ConfigFlags(configStripLibs), fromFlagOrDefault, toFlag)
 import Distribution.Simple.Utils (defaultPackageDesc, findHookedPackageDesc, writeFileAtomic,
                                   toUTF8LBS)
 import Distribution.Simple.Build (writeAutogenFiles)
@@ -168,7 +168,7 @@ doCopy directory distDir
                                withPrograms = progs',
                                installDirTemplates = idts,
                                configFlags = cfg,
-                               stripLibs = fromFlag (configStripLibs cfg),
+                               stripLibs = fromFlagOrDefault False (configStripLibs cfg),
                                withSharedLib = withSharedLibs
                            }