Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit b5e388a

Browse files
committed
Correct stack local install path and use a more precise name for the ugly hack
1 parent d1e442b commit b5e388a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

install/src/Cabal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ execCabal_ :: [String] -> Action ()
2424
execCabal_ = execCabalWithOriginalPath
2525

2626
execCabalWithOriginalPath :: CmdResult r => [String] -> Action r
27-
execCabalWithOriginalPath = withOriginalPath . (command [] "cabal")
27+
execCabalWithOriginalPath = withoutStackCachedBinaries . (command [] "cabal")
2828

2929
cabalBuildData :: Action ()
3030
cabalBuildData = do
@@ -77,7 +77,7 @@ cabalInstallHie versionNumber = do
7777
installCabalWithStack :: Action ()
7878
installCabalWithStack = do
7979
-- try to find existing `cabal` executable with appropriate version
80-
mbc <- withOriginalPath (liftIO (findExecutable "cabal"))
80+
mbc <- withoutStackCachedBinaries (liftIO (findExecutable "cabal"))
8181

8282
case mbc of
8383
Just c -> do

install/src/Stack.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ stackBuildFailMsg =
9999
++ "If this does not work, open an issue at \n"
100100
++ "\thttps://github.com/haskell/haskell-ide-engine"
101101

102-
-- | Run actions with the original user path, without stack additions
103-
withOriginalPath :: Action a -> Action a
104-
withOriginalPath action = do
102+
-- |Run actions without the stack cached binaries
103+
withoutStackCachedBinaries :: Action a -> Action a
104+
withoutStackCachedBinaries action = do
105105
mbPath <- liftIO (lookupEnv "PATH")
106106

107107
case (mbPath, isRunFromStack) of
108108

109109
(Just paths, True) -> do
110110
snapshotDir <- trimmedStdout <$> execStackShake ["path", "--snapshot-install-root"]
111-
localInstallDir <- trimmedStdout <$> execStackShake ["path", "--local-install-dir"]
111+
localInstallDir <- trimmedStdout <$> execStackShake ["path", "--local-install-root"]
112112

113113
let cacheBinPaths = [snapshotDir </> "bin", localInstallDir </> "bin"]
114114
let origPaths = removePathsContaining cacheBinPaths paths

0 commit comments

Comments
 (0)