Skip to content

Commit

Permalink
Merge pull request #524 from jdnavarro/master
Browse files Browse the repository at this point in the history
Report `dist` path as `HASKELL_DIST_DIR` env variable
  • Loading branch information
snoyberg committed Jul 6, 2015
2 parents 64a95ea + f1145c4 commit aa6c55b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Stack/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import Path.IO
import Prelude -- Fix AMP warning
import Safe (headMay, readMay)
import Stack.Build.Types
import Stack.Constants (distRelativeDir)
import Stack.GhcPkg (createDatabase, getCabalPkgVer, getGlobalDB)
import Stack.Solver (getGhcVersion)
import Stack.Types
Expand Down Expand Up @@ -150,6 +151,7 @@ setupEnv = do
env1 = Map.delete "GHC_PACKAGE_PATH"
$ Map.delete "HASKELL_PACKAGE_SANDBOX"
$ Map.delete "HASKELL_PACKAGE_SANDBOXES"
$ Map.delete "HASKELL_DIST_DIR"
env0

menv1 <- mkEnvOverride platform env1
Expand Down Expand Up @@ -179,6 +181,8 @@ setupEnv = do
, [toFilePathNoTrailingSlash globalDB]
]

distDir <- runReaderT distRelativeDir envConfig0

executablePath <- liftIO getExecutablePath

envRef <- liftIO $ newIORef Map.empty
Expand Down Expand Up @@ -210,6 +214,7 @@ setupEnv = do
[ toFilePathNoTrailingSlash deps
, ""
])
$ Map.insert "HASKELL_DIST_DIR" (T.pack $ toFilePathNoTrailingSlash distDir)
$ env1
!() <- atomicModifyIORef envRef $ \m' ->
(Map.insert es eo m', ())
Expand Down

0 comments on commit aa6c55b

Please sign in to comment.