Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use with compiler flags in key of cached project config (backport #8819) #9027

Merged
merged 1 commit into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

}