Skip to content

Commit a94764e

Browse files
committed
Document choosing the Cabal version for a setup script.
1 parent 4eb8e4f commit a94764e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cabal-install/Distribution/Client/SetupWrapper.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,18 @@ externalSetupMethod verbosity options pkg bt mkargs = do
389389
Nothing -> getInstalledPackages verbosity
390390
comp (usePackageDB options') conf
391391

392+
-- Choose the version of Cabal to use if the setup script has a dependency on
393+
-- Cabal, and possibly update the setup script options. The version also
394+
-- determines how to filter the flags to Setup.
395+
--
396+
-- We first check whether the dependency solver has specified a Cabal version.
397+
-- If it has, we use the solver's version without looking at the installed
398+
-- package index (See issue #3436). Otherwise, we pick the Cabal version by
399+
-- checking 'useCabalSpecVersion', then the saved version, and finally the
400+
-- versions available in the index.
401+
--
402+
-- The version chosen here must match the one used in 'compileSetupExecutable'
403+
-- (See issue #3433).
392404
cabalLibVersionToUse :: IO (Version, Maybe ComponentId
393405
,SetupScriptOptions)
394406
cabalLibVersionToUse =

0 commit comments

Comments
 (0)