[prev in list] [next in list] [prev in thread] [next in thread] 

List:       darcs-devel
Subject:    [darcs-devel] [issue1824] PACKAGE_VERSION is not a string
From:       Gracjan Polak <bugs () darcs ! net>
Date:       2010-04-27 17:46:46
Message-ID: 1272390406.03.0.633927655389.issue1824 () darcs ! net
[Download RAW message or body]


Gracjan Polak <gracjanpolak@gmail.com> added the comment:

Food for thought:

TL;DR: use rawSystem in place of system.

c:\Sources>ghci
GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
Prelude> :m +System.Process
Prelude System.Process> system "ghc --make -DPACKAGE_VERSION=\"1.2.3\"
pkgver.hs -fforce-recomp"
[1 of 1] Compiling Main             ( pkgver.hs, pkgver.o )

pkgver.hs:2:7:
    Couldn't match expected type `b -> c' against inferred type `IO ()'
    In the first argument of `(.)', namely `print 1.2'
    In the expression: print 1.2 . 3
    In the definition of `main': main = print 1.2 . 3
ExitFailure 1
Prelude System.Process> system "ghc --make
-DPACKAGE_VERSION=\\\"1.2.3\\\" pkgver.hs -fforce-recomp"
[1 of 1] Compiling Main             ( pkgver.hs, pkgver.o )
Linking pkgver.exe ...
ExitSuccess
Prelude System.Process> rawSystem "ghc" ["--make",
"-DPACKAGE_VERSION=\"1.2.3\"", "pkgver.hs", "-fforce-recomp"]
[1 of 1] Compiling Main             ( pkgver.hs, pkgver.o )
Linking pkgver.exe ...
ExitSuccess
Prelude System.Process>


Although I don't really know where deep inside cabal is the call to
system that should be changed to rawSystem.

__________________________________
Darcs bug tracker <bugs@darcs.net>
<http://bugs.darcs.net/issue1824>
__________________________________
_______________________________________________
darcs-devel mailing list (AUTOMATIC POSTINGS ONLY PLEASE!)
darcs-devel@darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic