Skip to content

Commit

Permalink
version: workaround build failure on Cabal-1.14
Browse files Browse the repository at this point in the history
Cabal-1.14 does not generate VERSION_pronk symbol in cabal_macros.h.
Likely a Cabal bug, but we can use base's facility to get the same.

    # ./Setup.lhs build
    [1 of 1] Compiling Main             ( app/App.hs, dist/build/pronk/pronk-tmp/Main.o )
    app/App.hs:88:41: Not in scope: data constructor `VERSION_pronk'

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information
Sergei Trofimovich committed Feb 6, 2012
1 parent afa124d commit 9d1bb7c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/App.hs
@@ -1,4 +1,4 @@
{-# LANGUAGE BangPatterns, CPP, DeriveDataTypeable, OverloadedStrings, {-# LANGUAGE BangPatterns, DeriveDataTypeable, OverloadedStrings,
RecordWildCards, ScopedTypeVariables #-} RecordWildCards, ScopedTypeVariables #-}


module Main (main) where module Main (main) where
Expand All @@ -14,11 +14,13 @@ import Data.Text (Text, pack)
import Data.Text.Encoding (encodeUtf8) import Data.Text.Encoding (encodeUtf8)
import Data.Text.Lazy.Builder (toLazyText) import Data.Text.Lazy.Builder (toLazyText)
import Data.Time.Clock.POSIX (getPOSIXTime) import Data.Time.Clock.POSIX (getPOSIXTime)
import Data.Version (showVersion)
import Network.HTTP.LoadTest (NetworkError(..), Req(..)) import Network.HTTP.LoadTest (NetworkError(..), Req(..))
import Network.HTTP.LoadTest.Analysis (analyseBasic, analyseFull) import Network.HTTP.LoadTest.Analysis (analyseBasic, analyseFull)
import Network.HTTP.LoadTest.Environment (environment) import Network.HTTP.LoadTest.Environment (environment)
import Network.HTTP.LoadTest.Report import Network.HTTP.LoadTest.Report
import Network.Socket (withSocketsDo) import Network.Socket (withSocketsDo)
import Paths_pronk (version)
import Prelude hiding (catch) import Prelude hiding (catch)
import System.CPUTime (getCPUTime) import System.CPUTime (getCPUTime)
import System.Console.CmdArgs import System.Console.CmdArgs
Expand Down Expand Up @@ -50,6 +52,9 @@ data Args = Args {
, json :: Maybe FilePath , json :: Maybe FilePath
} deriving (Eq, Show, Typeable, Data) } deriving (Eq, Show, Typeable, Data)


pronk_version :: String
pronk_version = showVersion version

defaultArgs :: Args defaultArgs :: Args
defaultArgs = Args { defaultArgs = Args {
concurrency = 1 concurrency = 1
Expand Down Expand Up @@ -85,7 +90,7 @@ defaultArgs = Args {
, json = def &= typ "FILE" , json = def &= typ "FILE"
&= help "Save analysis in JSON format" &= help "Save analysis in JSON format"
} &= verbosity } &= verbosity
&= summary ("Pronk " ++ VERSION_pronk ++ &= summary ("Pronk " ++ pronk_version ++
" - a modern HTTP load tester") " - a modern HTTP load tester")


fromArgs :: Args -> E.Request IO -> LoadTest.Config fromArgs :: Args -> E.Request IO -> LoadTest.Config
Expand Down

0 comments on commit 9d1bb7c

Please sign in to comment.