Commit b5f9dacf authored by Edward Z. Yang's avatar Edward Z. Yang

Axe cabalPackageCacheDirectory, use projectConfigCacheDir, fixing #3392

I am not sure why the original code did something insane,
which may indicate a lurking bug.
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 70098ef0
......@@ -100,7 +100,6 @@ data CabalDirLayout = CabalDirLayout {
cabalStorePackageDBPath :: CompilerId -> FilePath,
cabalStorePackageDB :: CompilerId -> PackageDB,
cabalPackageCacheDirectory :: FilePath,
cabalLogsDirectory :: FilePath,
cabalWorldFile :: FilePath
}
......@@ -162,8 +161,6 @@ defaultCabalDirLayout cabalDir =
cabalStorePackageDB =
SpecificPackageDB . cabalStorePackageDBPath
cabalPackageCacheDirectory = cabalDir </> "packages"
cabalLogsDirectory = cabalDir </> "logs"
cabalWorldFile = cabalDir </> "world"
......
......@@ -75,7 +75,7 @@ import Distribution.Simple.Program
( ConfiguredProgram(..) )
import Distribution.Simple.Setup
( Flag(Flag), toFlag, flagToMaybe, flagToList
, fromFlag, AllowNewer(..), AllowOlder(..), RelaxDeps(..) )
, fromFlag, fromFlagOrDefault, AllowNewer(..), AllowOlder(..), RelaxDeps(..) )
import Distribution.Client.Setup
( defaultSolver, defaultMaxBackjumps, )
import Distribution.Simple.InstallDirs
......@@ -153,18 +153,18 @@ projectConfigWithBuilderRepoContext verbosity BuildTimeSettings{..} =
-- to the 'BuildTimeSettings'
--
projectConfigWithSolverRepoContext :: Verbosity
-> FilePath
-> ProjectConfigShared
-> ProjectConfigBuildOnly
-> (RepoContext -> IO a) -> IO a
projectConfigWithSolverRepoContext verbosity downloadCacheRootDir
projectConfigWithSolverRepoContext verbosity
ProjectConfigShared{..}
ProjectConfigBuildOnly{..} =
withRepoContext'
verbosity
(fromNubList projectConfigRemoteRepos)
(fromNubList projectConfigLocalRepos)
downloadCacheRootDir
(fromFlagOrDefault (error "projectConfigWithSolverRepoContext: projectConfigCacheDir")
projectConfigCacheDir)
(flagToMaybe projectConfigHttpTransport)
(flagToMaybe projectConfigIgnoreExpiry)
......@@ -236,8 +236,7 @@ resolveBuildTimeSettings :: Verbosity
-> BuildTimeSettings
resolveBuildTimeSettings verbosity
CabalDirLayout {
cabalLogsDirectory,
cabalPackageCacheDirectory
cabalLogsDirectory
}
ProjectConfigShared {
projectConfigRemoteRepos,
......@@ -261,7 +260,7 @@ resolveBuildTimeSettings verbosity
buildSettingKeepTempFiles = fromFlag projectConfigKeepTempFiles
buildSettingRemoteRepos = fromNubList projectConfigRemoteRepos
buildSettingLocalRepos = fromNubList projectConfigLocalRepos
buildSettingCacheDir = cabalPackageCacheDirectory
buildSettingCacheDir = fromFlag projectConfigCacheDir
buildSettingHttpTransport = flagToMaybe projectConfigHttpTransport
buildSettingIgnoreExpiry = fromFlag projectConfigIgnoreExpiry
buildSettingReportPlanningFailure
......
......@@ -281,7 +281,6 @@ rebuildInstallPlan verbosity
distProjectCacheDirectory
}
cabalDirLayout@CabalDirLayout {
cabalPackageCacheDirectory,
cabalStoreDirectory,
cabalStorePackageDB
}
......@@ -468,7 +467,7 @@ rebuildInstallPlan verbosity
(compiler, platform, progdb)
localPackages =
rerunIfChanged verbosity fileMonitorSolverPlan
(solverSettings, cabalPackageCacheDirectory,
(solverSettings,
localPackages, localPackagesEnabledStanzas,
compiler, platform, programDbSignature progdb) $ do
......@@ -496,7 +495,6 @@ rebuildInstallPlan verbosity
where
corePackageDbs = [GlobalPackageDB]
withRepoCtx = projectConfigWithSolverRepoContext verbosity
cabalPackageCacheDirectory
projectConfigShared
projectConfigBuildOnly
solverSettings = resolveSolverSettings projectConfig
......@@ -563,7 +561,6 @@ rebuildInstallPlan verbosity
return (elaboratedPlan, elaboratedShared)
where
withRepoCtx = projectConfigWithSolverRepoContext verbosity
cabalPackageCacheDirectory
projectConfigShared
projectConfigBuildOnly
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment