Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
b60fb2da
Commit
b60fb2da
authored
Nov 06, 2013
by
Mikhail Glushenkov
Browse files
Cache the setup executable for 'Make' and 'Configure' build types.
Can improve 'install -j' times a little bit for large install plans.
parent
38e66c74
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/SetupWrapper.hs
View file @
b60fb2da
...
...
@@ -215,13 +215,11 @@ externalSetupMethod verbosity options pkg bt mkargs = do
createDirectoryIfMissingVerbose
verbosity
True
setupDir
(
cabalLibVersion
,
mCabalLibInstalledPkgId
,
options'
)
<-
cabalLibVersionToUse
debug
verbosity
$
"Using Cabal library version "
++
display
cabalLibVersion
path
<-
case
bt
of
-- TODO: Should we also cache the setup exe for the Make and Configure build
-- types?
Simple
->
getCachedSetupExecutable
options'
cabalLibVersion
mCabalLibInstalledPkgId
_
->
compileSetupExecutable
options'
cabalLibVersion
mCabalLibInstalledPkgId
False
path
<-
if
useCachedSetupExecutable
then
getCachedSetupExecutable
options'
cabalLibVersion
mCabalLibInstalledPkgId
else
compileSetupExecutable
options'
cabalLibVersion
mCabalLibInstalledPkgId
False
invokeSetupScript
options'
path
(
mkargs
cabalLibVersion
)
where
...
...
@@ -233,6 +231,8 @@ externalSetupMethod verbosity options pkg bt mkargs = do
setupHs
=
setupDir
</>
"setup"
<.>
"hs"
setupProgFile
=
setupDir
</>
"setup"
<.>
exeExtension
useCachedSetupExecutable
=
(
bt
==
Simple
||
bt
==
Configure
||
bt
==
Make
)
maybeGetInstalledPackages
::
SetupScriptOptions
->
Compiler
->
ProgramConfiguration
->
IO
PackageIndex
maybeGetInstalledPackages
options'
comp
conf
=
...
...
@@ -255,11 +255,12 @@ externalSetupMethod verbosity options pkg bt mkargs = do
_
->
installedVersion
where
canUseExistingSetup
::
Version
->
IO
Bool
canUseExistingSetup
version
=
case
bt
of
Simple
->
do
canUseExistingSetup
version
=
if
useCachedSetupExecutable
then
do
(
_
,
cachedSetupProgFile
)
<-
cachedSetupDirAndProg
options
version
doesFileExist
cachedSetupProgFile
_
->
else
(
&&
)
<$>
setupProgFile
`
existsAndIsMoreRecentThan
`
setupHs
<*>
setupProgFile
`
existsAndIsMoreRecentThan
`
setupVersionFile
...
...
@@ -410,12 +411,14 @@ externalSetupMethod verbosity options pkg bt mkargs = do
cabalDir
<-
defaultCabalDir
let
setupCacheDir
=
cabalDir
</>
"setup-exe-cache"
cachedSetupProgFile
=
setupCacheDir
</>
(
"setup-"
++
cabalVersionString
++
"-"
</>
(
"setup-"
++
buildTypeString
++
"-"
++
cabalVersionString
++
"-"
++
platformString
++
"-"
++
compilerVersionString
)
<.>
exeExtension
return
(
setupCacheDir
,
cachedSetupProgFile
)
where
buildTypeString
=
show
bt
cabalVersionString
=
"Cabal-"
++
(
display
cabalLibVersion
)
compilerVersionString
=
display
$
fromMaybe
buildCompilerId
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment