From 666632f3880ec321df205db0e1c340601271a706 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Wed, 1 Feb 2017 15:31:02 -0800 Subject: [PATCH] Only run "cabal copy" if there are exes or lib #2862 --- src/Stack/Build/Execute.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Stack/Build/Execute.hs b/src/Stack/Build/Execute.hs index f0033caccf..46fa12d702 100644 --- a/src/Stack/Build/Execute.hs +++ b/src/Stack/Build/Execute.hs @@ -1306,7 +1306,8 @@ singleBuild runInBase ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} in cabal False (concat [["haddock", "--html", "--hoogle", "--html-location=../$pkg-$version/"] ,sourceFlag, ["--internal" | boptsHaddockInternal eeBuildOpts]]) - unless isFinalBuild $ withMVar eeInstallLock $ \() -> do + let shouldCopy = not isFinalBuild && (packageHasLibrary package || not (Set.null (packageExes package))) + when shouldCopy $ withMVar eeInstallLock $ \() -> do announce "copy/register" eres <- try $ cabal False ["copy"] case eres of