Skip to content

Commit e6710c4

Browse files
gbazmergify[bot]
authored andcommitted
use with compiler flags in key of cached project config (haskell#8819)
* use with compiler flags in key of cached project config * changelog --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent da5ed83 commit e6710c4

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,17 @@ rebuildProjectConfig verbosity
326326
}
327327
cliConfig = do
328328

329+
progsearchpath <- liftIO $ getSystemSearchPath
330+
331+
let fileMonitorProjectConfig = newFileMonitor (distProjectCacheFile "config")
332+
329333
fileMonitorProjectConfigKey <- do
330334
configPath <- getConfigFilePath projectConfigConfigFile
331-
return (configPath, distProjectFile "")
335+
return (configPath, distProjectFile "",
336+
(projectConfigHcFlavor, projectConfigHcPath, projectConfigHcPkg),
337+
progsearchpath,
338+
packageConfigProgramPaths,
339+
packageConfigProgramPathExtra)
332340

333341
(projectConfig, localPackages) <-
334342
runRebuild distProjectRootDirectory
@@ -359,18 +367,11 @@ rebuildProjectConfig verbosity
359367

360368
where
361369

362-
ProjectConfigShared { projectConfigConfigFile } =
363-
projectConfigShared cliConfig
364-
365-
ProjectConfigShared { projectConfigIgnoreProject } =
370+
ProjectConfigShared { projectConfigHcFlavor, projectConfigHcPath, projectConfigHcPkg, projectConfigIgnoreProject, projectConfigConfigFile } =
366371
projectConfigShared cliConfig
367372

368-
fileMonitorProjectConfig ::
369-
FileMonitor
370-
(FilePath, FilePath)
371-
(ProjectConfig, [PackageSpecifier UnresolvedSourcePackage])
372-
fileMonitorProjectConfig =
373-
newFileMonitor (distProjectCacheFile "config")
373+
PackageConfig { packageConfigProgramPaths, packageConfigProgramPathExtra } =
374+
projectConfigLocalPackages cliConfig
374375

375376
-- Read the cabal.project (or implicit config) and combine it with
376377
-- arguments from the command line

changelog.d/pr-8819

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
synopsis: Use compiler flags for caching project config
2+
packages: cabal-install
3+
prs: #8819
4+
5+
description: {
6+
7+
This ensures that cached project configs with conditionals re-execute the conditional logic when the compiler changes.
8+
9+
}

0 commit comments

Comments
 (0)