Commit 1c0db3f4 authored by Francesco Gazzetta's avatar Francesco Gazzetta
Browse files

Correctly get the symlinkBinDir

parent e9cfb9b0
......@@ -22,7 +22,6 @@ import Distribution.Client.CmdErrorMessages
import Distribution.Client.Setup
( GlobalFlags, ConfigFlags(..), ConfigExFlags, InstallFlags )
import qualified Distribution.Client.Setup as Client
import Distribution.Client.Types
( PackageSpecifier(NamedPackage), UnresolvedSourcePackage )
import Distribution.Client.ProjectPlanning.Types
......@@ -187,11 +186,15 @@ installAction (configFlags, configExFlags, installFlags, haddockFlags)
(compilerId compiler)
-- If there are exes, symlink them
let defaultSymlinkBindir = error $
"TODO: how do I get the default ~/.cabal (or ~/.local) directory?"
++ " (use --symlink-bindir explicitly for now)" </> "bin"
symlinkBindir <- makeAbsolute $ fromFlagOrDefault defaultSymlinkBindir
(Client.installSymlinkBinDir installFlags)
let symlinkBindirUnknown =
"symlink-bindir is not defined. Set it in your cabal config file "
++ "or use --symlink-bindir=<path>"
symlinkBindir <- fromFlagOrDefault (die' verbosity symlinkBindirUnknown)
$ fmap makeAbsolute
$ projectConfigSymlinkBinDir
$ projectConfigBuildOnly
$ projectConfig $ baseCtx
createDirectoryIfMissingVerbose verbosity False symlinkBindir
traverse_ (symlinkBuiltPackage mkPkgBinDir symlinkBindir)
$ Map.toList $ targetsMap buildCtx
runProjectPostBuildPhase verbosity baseCtx buildCtx buildOutcomes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment