Skip to content

Commit 69bbc21

Browse files
authored
Merge pull request #42 from liskin/system-ghc-fix-alternative
Fixed ghc lib dir lookup via stack for system installed ghc
2 parents a38ac7b + a436699 commit 69bbc21

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Stack.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ getStackGhcBinDir :: FilePath -> IO (Maybe FilePath)
5252
getStackGhcBinDir = fmap (fmap trim) . execStackInPath "path --compiler-bin"
5353

5454
getStackGhcLibDir :: FilePath -> IO (Maybe FilePath)
55-
getStackGhcLibDir = fmap (fmap takeDirectory) . execStackInPath "path --global-pkg-db"
55+
getStackGhcLibDir p = do
56+
ghc <- (trim <$>) <$> execStackInPath "path --compiler-exe" p
57+
case ghc of
58+
Just exe -> (trim <$>) <$> execInPath (exe ++ " --print-libdir") p
59+
Nothing -> return Nothing
5660

5761
getStackDist :: FilePath -> IO (Maybe FilePath)
5862
getStackDist p = (trim <$>) <$> execStackInPath "path --dist-dir" p

0 commit comments

Comments
 (0)