Skip to content

Commit

Permalink
use with compiler flags in key of cached project config (#8819)
Browse files Browse the repository at this point in the history
* use with compiler flags in key of cached project config

* changelog

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 9610438)
  • Loading branch information
gbaz authored and Kleidukos committed Jun 17, 2023
1 parent b71d7a3 commit 7cd58a5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
23 changes: 12 additions & 11 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,17 @@ rebuildProjectConfig verbosity
}
cliConfig = do

progsearchpath <- liftIO $ getSystemSearchPath

let fileMonitorProjectConfig = newFileMonitor (distProjectCacheFile "config")

fileMonitorProjectConfigKey <- do
configPath <- getConfigFilePath projectConfigConfigFile
return (configPath, distProjectFile "")
return (configPath, distProjectFile "",
(projectConfigHcFlavor, projectConfigHcPath, projectConfigHcPkg),
progsearchpath,
packageConfigProgramPaths,
packageConfigProgramPathExtra)

(projectConfig, localPackages) <-
runRebuild distProjectRootDirectory
Expand Down Expand Up @@ -354,18 +362,11 @@ rebuildProjectConfig verbosity

where

ProjectConfigShared { projectConfigConfigFile } =
projectConfigShared cliConfig

ProjectConfigShared { projectConfigIgnoreProject } =
ProjectConfigShared { projectConfigHcFlavor, projectConfigHcPath, projectConfigHcPkg, projectConfigIgnoreProject, projectConfigConfigFile } =
projectConfigShared cliConfig

fileMonitorProjectConfig ::
FileMonitor
(FilePath, FilePath)
(ProjectConfig, [PackageSpecifier UnresolvedSourcePackage])
fileMonitorProjectConfig =
newFileMonitor (distProjectCacheFile "config")
PackageConfig { packageConfigProgramPaths, packageConfigProgramPathExtra } =
projectConfigLocalPackages cliConfig

-- Read the cabal.project (or implicit config) and combine it with
-- arguments from the command line
Expand Down
9 changes: 9 additions & 0 deletions changelog.d/pr-8819
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
synopsis: Use compiler flags for caching project config
packages: cabal-install
prs: #8819

description: {

This ensures that cached project configs with conditionals re-execute the conditional logic when the compiler changes.

}

0 comments on commit 7cd58a5

Please sign in to comment.