Skip to content

Commit 7ec6e5d

Browse files
committed
Do not filter GHC flags
1 parent 8365cec commit 7ec6e5d

File tree

5 files changed

+28
-11
lines changed

5 files changed

+28
-11
lines changed

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2379,6 +2379,17 @@ elaborateInstallPlan
23792379
]
23802380
)
23812381
(perPkgOptionMapMappend pkgid packageConfigProgramArgs)
2382+
elabNormalisedProgramArgs =
2383+
Map.unionWith
2384+
(++)
2385+
( Map.fromList
2386+
[ (programId prog, args)
2387+
| prog <- configuredPrograms compilerprogdb
2388+
, let args = programOverrideArgs $ addHaddockIfDocumentationEnabled prog
2389+
, not (null args)
2390+
]
2391+
)
2392+
(perPkgOptionMapMappend pkgid packageConfigProgramArgs)
23822393
elabProgramPathExtra = perPkgOptionNubList pkgid packageConfigProgramPathExtra
23832394
elabConfiguredPrograms = configuredPrograms compilerprogdb
23842395
elabConfigureScriptArgs = perPkgOptionList pkgid packageConfigConfigureArgs
@@ -4513,7 +4524,7 @@ packageHashConfigInputs shared@ElaboratedSharedConfig{..} pkg =
45134524
, pkgHashStripLibs = stripLibs
45144525
, pkgHashStripExes = stripExes
45154526
, pkgHashDebugInfo = withDebugInfo
4516-
, pkgHashProgramArgs = elabProgramArgs
4527+
, pkgHashProgramArgs = elabNormalisedProgramArgs
45174528
, pkgHashExtraLibDirs = elabExtraLibDirs
45184529
, pkgHashExtraLibDirsStatic = elabExtraLibDirsStatic
45194530
, pkgHashExtraFrameworkDirs = elabExtraFrameworkDirs

cabal-install/src/Distribution/Client/ProjectPlanning/Types.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ data ElaboratedConfiguredPackage = ElaboratedConfiguredPackage
274274
, elabDumpBuildInfo :: DumpBuildInfo
275275
, elabProgramPaths :: Map String FilePath
276276
, elabProgramArgs :: Map String [String]
277+
, elabNormalisedProgramArgs :: Map String [String]
277278
, elabProgramPathExtra :: [FilePath]
278279
, elabConfiguredPrograms :: [ConfiguredProgram]
279280
, elabConfigureScriptArgs :: [String]
@@ -345,7 +346,7 @@ normaliseConfiguredPackage
345346
-> ElaboratedConfiguredPackage
346347
-> ElaboratedConfiguredPackage
347348
normaliseConfiguredPackage ElaboratedSharedConfig{pkgConfigCompilerProgs} pkg =
348-
pkg{elabProgramArgs = Map.mapMaybeWithKey lookupFilter (elabProgramArgs pkg)}
349+
pkg{elabNormalisedProgramArgs = Map.mapMaybeWithKey lookupFilter (elabProgramArgs pkg)}
349350
where
350351
knownProgramDb = addKnownPrograms builtinPrograms pkgConfigCompilerProgs
351352

cabal-testsuite/PackageTests/CustomTestCoverage/cabal.out

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Build profile: -w ghc-<GHCVER> -O1
44
In order, the following will be built:
55
- plain-0.1.0.0 *test (first run)
66
Configuring plain-0.1.0.0...
7-
Preprocessing library for plain-0.1.0.0...
8-
Building library for plain-0.1.0.0...
9-
Preprocessing test suite 'test' for plain-0.1.0.0...
10-
Building test suite 'test' for plain-0.1.0.0...
7+
Preprocessing library for plain-0.1.0.0..
8+
Building library for plain-0.1.0.0..
9+
Preprocessing test suite 'test' for plain-0.1.0.0..
10+
Building test suite 'test' for plain-0.1.0.0..
1111
Running 1 test suites...
1212
Test suite test: RUNNING...
1313
Test suite test: PASS
14-
Test suite logged to: <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/test/plain-0.1.0.0-test.log
15-
Package coverage report written to <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/hpc_index.html
14+
Test suite logged to: cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/test/plain-0.1.0.0-test.log
15+
Test coverage report written to cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/test/hpc_index.html
1616
1 of 1 test suites (1 of 1 test cases) passed.
17-
Package coverage report written to <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/hpc_index.html
17+
Package coverage report written to cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/plain-0.1.0.0/hpc_index.html

cabal-testsuite/PackageTests/Regression/T9640/cabal.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ In order, the following will be built:
88
- one-custom-0.1.0.0 (lib:one-custom) (requires build)
99
- depend-on-custom-with-exe-0.1.0.0 (lib) (first run)
1010
Configuring one-custom-0.1.0.0...
11-
Preprocessing library for one-custom-0.1.0.0...
12-
Building library for one-custom-0.1.0.0...
11+
Preprocessing library for one-custom-0.1.0.0..
12+
Building library for one-custom-0.1.0.0..
1313
Installing library in <PATH>
1414
Warning: depend-on-custom-with-exe.cabal:16:1: Ignoring trailing fields after sections: "ghc-options"
1515
Configuring library for depend-on-custom-with-exe-0.1.0.0...

changelog.d/pr-11259.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
synopsis: Do not filter program arguments (e.g. for ghc, etc)
3+
packages: [Cabal]
4+
prs: 11259
5+
---

0 commit comments

Comments
 (0)