Skip to content

Commit

Permalink
Include environment PATH with --ide-backend-tools-path
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Jul 24, 2015
1 parent 8812948 commit 5bb316f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Stack/Ide.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import Stack.Exec (defaultEnvSettings)
import Stack.Package
import Stack.Types
import System.Directory (doesFileExist)
import System.Environment (lookupEnv)
import System.Exit
import System.IO
import qualified System.Process as P
Expand Down Expand Up @@ -108,13 +109,14 @@ ide targets useropts = do
else return Nothing
localdb <- packageDatabaseLocal
depsdb <- packageDatabaseDeps
mpath <- liftIO $ lookupEnv "PATH"
bindirs <- extraBinDirs `ap` return True {- include local bin -}
let pkgopts = concat (map _2 pkgs)
srcfiles = concatMap (map toFilePath . _3) pkgs
pkgdbs =
["--package-db=" <> toFilePath depsdb <> ":" <> toFilePath localdb]
paths =
["--ide-backend-tools-path=" <> intercalate ":" (map toFilePath bindirs)
["--ide-backend-tools-path=" <> intercalate ":" (map toFilePath bindirs) <> (maybe "" (':':) mpath)
]
exec
"stack-ide"
Expand Down

2 comments on commit 5bb316f

@mgsloan
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinging @jcpetruzza - this makes it more likely to find a ide-backend-server. I realize that this also makes it more likely that it'll use the wrong GHC, but I think that's ok until #662 is implemented, or some other form of stack streamlining the usage of stack-ide. If there's confusion about which ide-backend-server it's using, hopefully the logging I've added will help.

@jcpetruzza
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it makes sense to reduce sudden breakage at this time

Please sign in to comment.