Skip to content

Commit a3837b5

Browse files
committed
Merge remote-tracking branch 'origin/master' into release
2 parents 567e568 + 8ee0dad commit a3837b5

File tree

5 files changed

+34
-16
lines changed

5 files changed

+34
-16
lines changed

.github/workflows/master.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,6 @@ jobs:
7878
./package/version.sh sub
7979
if git add --update && git commit --no-edit --allow-empty --message "Set Version: $(cat package/version)"; then
8080
git push origin release
81+
git tag "v$(cat package/version)" origin/master
82+
git push "v$(cat package/version)"
8183
fi

booster/library/Booster/CLOptions.hs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{-# LANGUAGE QuasiQuotes #-}
22
{-# LANGUAGE TemplateHaskell #-}
33

4+
{-# OPTIONS -fforce-recomp #-}
5+
46
module Booster.CLOptions (
57
CLOptions (..),
68
EquationOptions (..),
@@ -22,6 +24,7 @@ import Data.Map qualified as Map
2224
import Data.Maybe (fromMaybe)
2325
import Data.Text (Text, pack)
2426
import Data.Text.Encoding (decodeASCII)
27+
import Data.Version (Version (..), showVersion)
2528
import Options.Applicative
2629
import Text.Casing (fromHumps, fromKebab, toKebab, toPascal)
2730
import Text.Read (readMaybe)
@@ -34,6 +37,7 @@ import Booster.SMT.LowLevelCodec qualified as SMT (parseSExpr)
3437
import Booster.Trace (CustomUserEventType)
3538
import Booster.Util (Bound (..), encodeLabel)
3639
import Booster.VersionInfo (VersionInfo (..), versionInfo)
40+
import Paths_hs_backend_booster (version)
3741

3842
data CLOptions = CLOptions
3943
{ definitionFile :: FilePath
@@ -436,12 +440,15 @@ versionInfoParser =
436440
)
437441

438442
versionInfoStr :: String
439-
versionInfoStr =
440-
unlines
441-
[ "hs-backend-booster version:"
442-
, " revision:\t" <> gitHash <> if gitDirty then " (dirty)" else ""
443-
, " branch:\t" <> fromMaybe "<unknown>" gitBranch
444-
, " last commit:\t" <> gitCommitDate
445-
]
443+
versionInfoStr
444+
| version == dummyVersion =
445+
unlines
446+
[ "hs-backend-booster custom build:"
447+
, " revision:\t" <> gitHash <> if gitDirty then " (dirty)" else ""
448+
, " branch:\t" <> fromMaybe "<unknown>" gitBranch
449+
, " last commit:\t" <> gitCommitDate
450+
]
451+
| otherwise = showVersion version
446452
where
447453
VersionInfo{gitHash, gitDirty, gitBranch, gitCommitDate} = $versionInfo
454+
dummyVersion = Version [0, 1, 0] []

booster/tools/rpc-client/RpcClient.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import System.Time.Extra (Seconds, sleep)
5151
import Text.Casing (fromKebab, toPascal)
5252
import Text.Read (readMaybe)
5353

54+
import Booster.CLOptions (versionInfoParser)
5455
import Booster.JsonRpc (rpcJsonConfig)
5556
import Booster.JsonRpc.Utils (
5657
DiffResult (DifferentType),
@@ -336,7 +337,7 @@ parseCommonOptions =
336337
parseOptions :: ParserInfo Options
337338
parseOptions =
338339
info
339-
(parseOptions' <**> helper)
340+
(parseOptions' <**> versionInfoParser <**> helper)
340341
( fullDesc
341342
<> progDesc "Simple RPC test client"
342343
)

kore/app/share/GlobalMain.hs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{-# LANGUAGE TemplateHaskell #-}
22

3+
{-# OPTIONS -fforce-recomp #-}
4+
35
{- |
46
Copyright : (c) Runtime Verification, 2020-2022
57
License : BSD-3-Clause
@@ -70,6 +72,7 @@ import Data.Text (
7072
pack,
7173
)
7274
import Data.Text.IO qualified as Text
75+
import Data.Version (Version (..), showVersion)
7376
import GHC.Compact (getCompact)
7477
import GHC.Generics qualified as GHC
7578
import GHC.Stack (
@@ -178,6 +181,7 @@ import Options.SMT (
178181
KoreSolverOptions (..),
179182
Solver (..),
180183
)
184+
import Paths_kore (version)
181185
import Prelude.Kore
182186
import Pretty qualified as KorePretty
183187
import SMT (
@@ -358,14 +362,17 @@ mainGlobal exeName maybeEnv localOptionsParser modifiers = do
358362

359363
-- | main function to print version information
360364
mainVersion :: IO ()
361-
mainVersion =
362-
mapM_
363-
putStrLn
364-
[ "Git:"
365-
, " revision:\t" ++ gitHash ++ if gitDirty then " (dirty)" else ""
366-
, " branch:\t" ++ fromMaybe "<unknown>" gitBranch
367-
, " last commit:\t" ++ gitCommitDate
368-
]
365+
mainVersion
366+
| version == Version [0, 1, 0] [] =
367+
mapM_
368+
putStrLn
369+
[ "kore custom build:"
370+
, " revision:\t" ++ gitHash ++ if gitDirty then " (dirty)" else ""
371+
, " branch:\t" ++ fromMaybe "<unknown>" gitBranch
372+
, " last commit:\t" ++ gitCommitDate
373+
]
374+
| otherwise =
375+
putStrLn $ showVersion version
369376
where
370377
VersionInfo{gitHash, gitDirty, gitBranch, gitCommitDate} = $versionInfo
371378

kore/kore.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ library
560560
Log.Entry
561561
Logic
562562
Options.SMT
563+
Paths_kore
563564
Pair
564565
Partial
565566
Prelude.Kore

0 commit comments

Comments
 (0)