Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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