Thiago Negri | 11 Sep 03:27 2013
Picon

GLFW not working in Cabal 1.18

The package GLFW is not building in Cabal 1.18.

Setup.hs [1] depends on `rawSystemStdInOut` [2] that changed signature between 1.16 and 1.18.

Is this considered a public API of Cabal?


Cabal 1.16
rawSystemStdInOut
 :: Verbosity
 -> FilePath
 -> [String]
 -> Maybe (String, Bool)
 -> Bool
 -> IO (String, String, ExitCode)


Cabal 1.18
rawSystemStdInOut
 :: Verbosity
 -> FilePath
 -> [String]
 -> Maybe FilePath -- new arg
 -> Maybe [(String, String)] -- new arg
 -> Maybe (String, Bool)
 -> Bool
 -> IO (String, String, ExitCode)



Compilation output:

[1 of 1] Compiling Main             ( /tmp/GLFW-0.5.1.0-4035/GLFW-0.5.1.0/Setup.hs, /tmp/GLFW-0.5.1.0-4035/GLFW-0.5.1.0/dist/setup/Main.o )

/tmp/GLFW-0.5.1.0-4035/GLFW-0.5.1.0/Setup.hs:167:33:
    Couldn't match expected type `IO (t0, t1, ExitCode)'
                with actual type `Maybe (String, Bool)
                                  -> Bool -> IO (String, String, ExitCode)'
    In the return type of a call of `rawSystemStdInOut'
    Probable cause: `rawSystemStdInOut' is applied to too few arguments
    In a stmt of a 'do' block:
      (out, err, exitCode) <- rawSystemStdInOut
                                verbosity "cc" (["-c", path, "-o", objPath] ++ flags) Nothing False
    In the expression:
      do { hClose outHandle;
           hPutStr inHandle contents;
           hClose inHandle;
           (out, err, exitCode) <- rawSystemStdInOut
                                     verbosity "cc" (["-c", path, ....] ++ flags) Nothing False;
           .... }

/tmp/GLFW-0.5.1.0-4035/GLFW-0.5.1.0/Setup.hs:167:113:
    Couldn't match expected type `Maybe [(String, String)]'
                with actual type `Bool'
    In the fifth argument of `rawSystemStdInOut', namely `False'
    In a stmt of a 'do' block:
      (out, err, exitCode) <- rawSystemStdInOut
                                verbosity "cc" (["-c", path, "-o", objPath] ++ flags) Nothing False
    In the expression:
      do { hClose outHandle;
           hPutStr inHandle contents;
           hClose inHandle;
           (out, err, exitCode) <- rawSystemStdInOut
                                     verbosity "cc" (["-c", path, ....] ++ flags) Nothing False;
           .... }
Failed to install GLFW-0.5.1.0



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Carter Schonwald | 11 Sep 04:23 2013
Picon

Re: GLFW not working in Cabal 1.18

the work around i did for cabal 1.18 compatibility for llvm-base can be found here: 

this used the fact that cabal exposes the cabal version as a library value to generate a correct wrapper for either API version

alternatively, you can change your setup.hs so that api isn't needed.

also: before emailing cafe, its always good to email the listed maintainers first! (i've included them on CC for this email)



On Tue, Sep 10, 2013 at 9:27 PM, Thiago Negri <evohunz <at> gmail.com> wrote:
The package GLFW is not building in Cabal 1.18.

Setup.hs [1] depends on `rawSystemStdInOut` [2] that changed signature between 1.16 and 1.18.

Is this considered a public API of Cabal?


Cabal 1.16
rawSystemStdInOut
 :: Verbosity
 -> FilePath
 -> [String]
 -> Maybe (String, Bool)
 -> Bool
 -> IO (String, String, ExitCode)


Cabal 1.18
rawSystemStdInOut
 :: Verbosity
 -> FilePath
 -> [String]
 -> Maybe FilePath -- new arg
 -> Maybe [(String, String)] -- new arg
 -> Maybe (String, Bool)
 -> Bool
 -> IO (String, String, ExitCode)



Compilation output:

[1 of 1] Compiling Main             ( /tmp/GLFW-0.5.1.0-4035/GLFW-0.5.1.0/Setup.hs, /tmp/GLFW-0.5.1.0-4035/GLFW-0.5.1.0/dist/setup/Main.o )

/tmp/GLFW-0.5.1.0-4035/GLFW-0.5.1.0/Setup.hs:167:33:
    Couldn't match expected type `IO (t0, t1, ExitCode)'
                with actual type `Maybe (String, Bool)
                                  -> Bool -> IO (String, String, ExitCode)'
    In the return type of a call of `rawSystemStdInOut'
    Probable cause: `rawSystemStdInOut' is applied to too few arguments
    In a stmt of a 'do' block:
      (out, err, exitCode) <- rawSystemStdInOut
                                verbosity "cc" (["-c", path, "-o", objPath] ++ flags) Nothing False
    In the expression:
      do { hClose outHandle;
           hPutStr inHandle contents;
           hClose inHandle;
           (out, err, exitCode) <- rawSystemStdInOut
                                     verbosity "cc" (["-c", path, ....] ++ flags) Nothing False;
           .... }

/tmp/GLFW-0.5.1.0-4035/GLFW-0.5.1.0/Setup.hs:167:113:
    Couldn't match expected type `Maybe [(String, String)]'
                with actual type `Bool'
    In the fifth argument of `rawSystemStdInOut', namely `False'
    In a stmt of a 'do' block:
      (out, err, exitCode) <- rawSystemStdInOut
                                verbosity "cc" (["-c", path, "-o", objPath] ++ flags) Nothing False
    In the expression:
      do { hClose outHandle;
           hPutStr inHandle contents;
           hClose inHandle;
           (out, err, exitCode) <- rawSystemStdInOut
                                     verbosity "cc" (["-c", path, ....] ++ flags) Nothing False;
           .... }
Failed to install GLFW-0.5.1.0




_______________________________________________
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
Albert Y. C. Lai | 13 Sep 00:42 2013
Picon

Re: GLFW not working in Cabal 1.18

On 13-09-10 09:27 PM, Thiago Negri wrote:
> The package GLFW is not building in Cabal 1.18.
>
> Setup.hs [1] depends on `rawSystemStdInOut` [2] that changed signature
> between 1.16 and 1.18.

Consider "cabal install --cabal-lib-version=1.16".

Replace 1.16 by the correct number. Use "ghc-pkg list Cabal" to find the 
correct number.

http://www.haskell.org/haskellwiki/PVP allows 1.16->1.18 to change 
public API.

Gmane