Skip to content

Commit e2cb8a7

Browse files
committed
refactor: jsem is irrelevant to fetching packages
This has to be cleaned up but it does not make sense to pass the compiler.
1 parent 26e7018 commit e2cb8a7

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ installAction flags@NixStyleFlags{extraFlags, configFlags, installFlags, project
467467
fetchAndReadSourcePackages
468468
verbosity
469469
distDirLayout
470-
(Just compiler)
471470
(projectConfigShared config)
472471
(projectConfigBuildOnly config)
473472
[ProjectPackageRemoteTarball uri | uri <- uris]

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,15 +1261,13 @@ mplusMaybeT ma mb = do
12611261
fetchAndReadSourcePackages
12621262
:: Verbosity
12631263
-> DistDirLayout
1264-
-> Maybe Compiler
12651264
-> ProjectConfigShared
12661265
-> ProjectConfigBuildOnly
12671266
-> [ProjectPackageLocation]
12681267
-> Rebuild [PackageSpecifier (SourcePackage UnresolvedPkgLoc)]
12691268
fetchAndReadSourcePackages
12701269
verbosity
12711270
distDirLayout
1272-
compiler
12731271
projectConfigShared
12741272
projectConfigBuildOnly
12751273
pkgLocations = do
@@ -1306,9 +1304,7 @@ fetchAndReadSourcePackages
13061304
syncAndReadSourcePackagesRemoteRepos
13071305
verbosity
13081306
distDirLayout
1309-
compiler
13101307
projectConfigShared
1311-
projectConfigBuildOnly
13121308
(fromFlag (projectConfigOfflineMode projectConfigBuildOnly))
13131309
[repo | ProjectPackageRemoteRepo repo <- pkgLocations]
13141310

@@ -1425,23 +1421,16 @@ fetchAndReadSourcePackageRemoteTarball
14251421
syncAndReadSourcePackagesRemoteRepos
14261422
:: Verbosity
14271423
-> DistDirLayout
1428-
-> Maybe Compiler
14291424
-> ProjectConfigShared
1430-
-> ProjectConfigBuildOnly
14311425
-> Bool
14321426
-> [SourceRepoList]
14331427
-> Rebuild [PackageSpecifier (SourcePackage UnresolvedPkgLoc)]
14341428
syncAndReadSourcePackagesRemoteRepos
14351429
verbosity
14361430
DistDirLayout{distDownloadSrcDirectory}
1437-
compiler
14381431
ProjectConfigShared
14391432
{ projectConfigProgPathExtra
14401433
}
1441-
ProjectConfigBuildOnly
1442-
{ projectConfigUseSemaphore
1443-
, projectConfigNumJobs
1444-
}
14451434
offlineMode
14461435
repos = do
14471436
repos' <-
@@ -1462,14 +1451,14 @@ syncAndReadSourcePackagesRemoteRepos
14621451
]
14631452

14641453
let progPathExtra = fromNubList projectConfigProgPathExtra
1454+
14651455
getConfiguredVCS <- delayInitSharedResources $ \repoType ->
14661456
let vcs = Map.findWithDefault (error $ "Unknown VCS: " ++ prettyShow repoType) repoType knownVCSs
14671457
in configureVCS verbosity progPathExtra vcs
14681458

1469-
concat
1470-
<$> rerunConcurrentlyIfChanged
1459+
x <- rerunConcurrentlyIfChanged
14711460
verbosity
1472-
(newJobControlFromParStrat verbosity compiler parStrat (Just maxNumFetchJobs))
1461+
(newParallelJobControl maxNumFetchJobs)
14731462
[ ( monitor
14741463
, repoGroup'
14751464
, do
@@ -1487,8 +1476,10 @@ syncAndReadSourcePackagesRemoteRepos
14871476
[PackageSpecifier (SourcePackage UnresolvedPkgLoc)]
14881477
monitor = newFileMonitor (pathStem <.> "cache")
14891478
]
1479+
1480+
return (concat x)
1481+
14901482
where
1491-
parStrat = resolveNumJobsSetting projectConfigUseSemaphore projectConfigNumJobs
14921483
syncRepoGroupAndReadSourcePackages
14931484
:: VCS ConfiguredProgram
14941485
-> FilePath

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,11 @@ rebuildProjectConfig
401401
(compiler, Platform arch os, _) <- configureCompiler verbosity distDirLayout (fst (PD.ignoreConditions projectConfigSkeleton) <> cliConfig)
402402
pure (os, arch, compiler)
403403

404-
(projectConfig, compiler) <- instantiateProjectConfigSkeletonFetchingCompiler fetchCompiler mempty projectConfigSkeleton
404+
(projectConfig, _compiler) <- instantiateProjectConfigSkeletonFetchingCompiler fetchCompiler mempty projectConfigSkeleton
405405
when (projectConfigDistDir (projectConfigShared $ projectConfig) /= NoFlag) $
406406
liftIO $
407407
warn verbosity "The builddir option is not supported in project and config files. It will be ignored."
408-
localPackages <- phaseReadLocalPackages compiler (projectConfig <> cliConfig)
408+
localPackages <- phaseReadLocalPackages (projectConfig <> cliConfig)
409409
return (projectConfig, localPackages)
410410

411411
let configfiles =
@@ -437,11 +437,9 @@ rebuildProjectConfig
437437
-- NOTE: These are all packages mentioned in the project configuration.
438438
-- Whether or not they will be considered local to the project will be decided by `shouldBeLocal`.
439439
phaseReadLocalPackages
440-
:: Maybe Compiler
441-
-> ProjectConfig
440+
:: ProjectConfig
442441
-> Rebuild [PackageSpecifier UnresolvedSourcePackage]
443442
phaseReadLocalPackages
444-
compiler
445443
projectConfig@ProjectConfig
446444
{ projectConfigShared
447445
, projectConfigBuildOnly
@@ -456,7 +454,6 @@ rebuildProjectConfig
456454
fetchAndReadSourcePackages
457455
verbosity
458456
distDirLayout
459-
compiler
460457
projectConfigShared
461458
projectConfigBuildOnly
462459
pkgLocations

0 commit comments

Comments
 (0)