Skip to content

Commit

Permalink
Fix a spot where ghc-pkg is used with GHCJS #1665
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Jan 19, 2016
1 parent dca69c6 commit 418d429
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Stack/Build/Execute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,7 @@ singleBuild runInBase ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} in
_ -> return Nothing

copyPreCompiled (PrecompiledCache mlib exes) = do
wc <- getWhichCompiler
announceTask task "using precompiled package"
forM_ mlib $ \libpath -> do
menv <- getMinimalEnvOverride
Expand All @@ -991,8 +992,9 @@ singleBuild runInBase ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} in

-- In case a build of the library with different flags already exists, unregister it
-- before copying.
let ghcPkgExe = ghcPkgExeName wc
catch
(readProcessNull Nothing menv' "ghc-pkg"
(readProcessNull Nothing menv' ghcPkgExe
[ "unregister"
, "--force"
, packageIdentifierString taskProvides
Expand All @@ -1001,7 +1003,7 @@ singleBuild runInBase ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} in
ReadProcessException{} -> return ()
_ -> throwM ex)

readProcessNull Nothing menv' "ghc-pkg"
readProcessNull Nothing menv' ghcPkgExe
[ "register"
, "--force"
, libpath
Expand All @@ -1015,7 +1017,6 @@ singleBuild runInBase ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} in
_ -> return ()

-- Find the package in the database
wc <- getWhichCompiler
let pkgDbs = [bcoSnapDB eeBaseConfigOpts]

case mlib of
Expand Down

0 comments on commit 418d429

Please sign in to comment.