Skip to content

Allow kore-rpc-booster to read additional options from KORE_RPC_OPTS #3842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion booster/tools/booster/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ import System.Clock (
Clock (..),
getTime,
)
import System.Environment qualified as Env
import System.Exit
import System.FilePath.Glob qualified as Glob
import System.IO (hPutStrLn, stderr)
import System.Log.FastLogger (newTimeCache)

import Booster.CLOptions
Expand Down Expand Up @@ -92,10 +94,19 @@ import Proxy qualified
import SMT qualified as KoreSMT
import Stats qualified

envName :: String
envName = "KORE_RPC_OPTS" -- aligned with legacy kore-rpc

main :: IO ()
main = do
startTime <- getTime Monotonic
options <- execParser clParser
options <- do
Env.lookupEnv envName >>= \case
Nothing -> execParser clParser
Just envArgs -> do
hPutStrLn stderr $ "Reading additional server options from " <> envName
args <- Env.getArgs
Env.withArgs (words envArgs <> args) $ execParser clParser
let CLProxyOptions
{ clOptions =
clOPts@CLOptions
Expand Down