José Pedro Magalhães | 25 Oct 13:05 2012
Picon

createProcess fails to find executable in Windows

Hi all,

Consider the following program:

module Test where

import System.Process (readProcess)

main :: IO ()
main = readProcess "git" ["describe", "--tags"] "" >>= putStr

In Windows I get the following behaviour:

> git --version
git version 1.7.10.msysgit.1

> ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.1

> runghc Test
Test: git: createProcess: does not exist (No such file or directory)

The same happens with GHC 7.4.2. In Linux, however, it works as expected:

$ git --version
git version 1.7.9.5
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1
$ runghc Test.hs
Package-2.0-68-gacaf77a

Can anyone reproduce this result in Windows? Is this a bug or am I doing something wrong?


Thanks,
Pedro

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Jesse Schalken | 25 Oct 13:10 2012

Re: createProcess fails to find executable in Windows

What if you ran the program from within the directory that contains git.exe? Can you check that the PATH environment variable is set correctly from within the program?

On Thu, Oct 25, 2012 at 10:05 PM, José Pedro Magalhães <jpm <at> cs.uu.nl> wrote:
Hi all,

Consider the following program:

module Test where

import System.Process (readProcess)

main :: IO ()
main = readProcess "git" ["describe", "--tags"] "" >>= putStr

In Windows I get the following behaviour:

> git --version
git version 1.7.10.msysgit.1

> ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.1

> runghc Test
Test: git: createProcess: does not exist (No such file or directory)

The same happens with GHC 7.4.2. In Linux, however, it works as expected:

$ git --version
git version 1.7.9.5
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1
$ runghc Test.hs
Package-2.0-68-gacaf77a

Can anyone reproduce this result in Windows? Is this a bug or am I doing something wrong?


Thanks,
Pedro


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
José Pedro Magalhães | 25 Oct 13:15 2012
Picon

Re: createProcess fails to find executable in Windows



On Thu, Oct 25, 2012 at 12:10 PM, Jesse Schalken <me <at> jesseschalken.com> wrote:
What if you ran the program from within the directory that contains git.exe?

That seems to work.
 
 Can you check that the PATH environment variable is set correctly from within the program?

If I run `system "echo %PATH%"` it shows me the expected %PATH%, including the directory
where the git binary lives.


Thanks,
Pedro
 

On Thu, Oct 25, 2012 at 10:05 PM, José Pedro Magalhães <jpm <at> cs.uu.nl> wrote:
Hi all,

Consider the following program:

module Test where

import System.Process (readProcess)

main :: IO ()
main = readProcess "git" ["describe", "--tags"] "" >>= putStr

In Windows I get the following behaviour:

> git --version
git version 1.7.10.msysgit.1

> ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.1

> runghc Test
Test: git: createProcess: does not exist (No such file or directory)

The same happens with GHC 7.4.2. In Linux, however, it works as expected:

$ git --version
git version 1.7.9.5
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1
$ runghc Test.hs
Package-2.0-68-gacaf77a

Can anyone reproduce this result in Windows? Is this a bug or am I doing something wrong?


Thanks,
Pedro


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane