diff --git a/cabal-install/Distribution/Client/SetupWrapper.hs b/cabal-install/Distribution/Client/SetupWrapper.hs index 47814a62c71..64a2bb2f5c7 100644 --- a/cabal-install/Distribution/Client/SetupWrapper.hs +++ b/cabal-install/Distribution/Client/SetupWrapper.hs @@ -568,7 +568,9 @@ externalSetupMethod verbosity options pkg bt mkargs = do , ghcOptObjDir = Flag setupDir , ghcOptHiDir = Flag setupDir , ghcOptSourcePathClear = Flag True - , ghcOptSourcePath = toNubListR [workingDir] + , ghcOptSourcePath = case bt of + Custom -> toNubListR [workingDir] + _ -> mempty , ghcOptPackageDBs = usePackageDB options'' , ghcOptHideAllPackages = Flag newPedanticDeps , ghcOptCabal = Flag newPedanticDeps