mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-23 10:40:51 +00:00
fix t8n compiler switch when evmc_enabled
This commit is contained in:
parent
a57471197f
commit
4287a31961
5
Makefile
5
Makefile
@ -114,6 +114,8 @@ ENABLE_EVMC := 0
|
||||
# "-d:release" cannot be added to config.nims
|
||||
NIM_PARAMS += -d:release
|
||||
|
||||
T8N_PARAMS := -d:chronicles_default_output_device=stderr
|
||||
|
||||
ifeq ($(USE_LIBBACKTRACE), 0)
|
||||
NIM_PARAMS += -d:disable_libbacktrace
|
||||
endif
|
||||
@ -129,6 +131,7 @@ endif
|
||||
|
||||
ifneq ($(ENABLE_EVMC), 0)
|
||||
NIM_PARAMS += -d:evmc_enabled
|
||||
T8N_PARAMS := -d:chronicles_enabled=off
|
||||
endif
|
||||
|
||||
# disabled by default, enable with ENABLE_VMLOWMEM=1
|
||||
@ -243,7 +246,7 @@ nimbus-verified-proxy-test: | build deps
|
||||
|
||||
# builds transition tool
|
||||
t8n: | build deps
|
||||
$(ENV_SCRIPT) nim c $(NIM_PARAMS) -d:chronicles_default_output_device=stderr "tools/t8n/$@.nim"
|
||||
$(ENV_SCRIPT) nim c $(NIM_PARAMS) $(T8N_PARAMS) "tools/t8n/$@.nim"
|
||||
|
||||
# builds and runs transition tool test suite
|
||||
t8n_test: | build deps t8n
|
||||
|
@ -106,7 +106,7 @@ type
|
||||
defaultValue: 3
|
||||
name: "verbosity" }: int
|
||||
|
||||
proc parseCmdArg*(T: type Option[UInt256], p: TaintedString): T =
|
||||
proc parseCmdArg(T: type Option[UInt256], p: TaintedString): T =
|
||||
if p.string == "-1":
|
||||
none(UInt256)
|
||||
elif startsWith(p.string, "0x"):
|
||||
@ -114,16 +114,16 @@ proc parseCmdArg*(T: type Option[UInt256], p: TaintedString): T =
|
||||
else:
|
||||
some(parse(p.string, UInt256, 10))
|
||||
|
||||
proc completeCmdArg*(T: type Option[UInt256], val: TaintedString): seq[string] =
|
||||
proc completeCmdArg(T: type Option[UInt256], val: TaintedString): seq[string] =
|
||||
return @[]
|
||||
|
||||
proc parseCmdArg*(T: type HexOrInt, p: TaintedString): T =
|
||||
proc parseCmdArg(T: type HexOrInt, p: TaintedString): T =
|
||||
if startsWith(p.string, "0x"):
|
||||
parseHexInt(p.string).T
|
||||
else:
|
||||
parseInt(p.string).T
|
||||
|
||||
proc completeCmdArg*(T: type HexOrInt, val: TaintedString): seq[string] =
|
||||
proc completeCmdArg(T: type HexOrInt, val: TaintedString): seq[string] =
|
||||
return @[]
|
||||
|
||||
proc notCmd(x: string): bool =
|
||||
@ -156,9 +156,13 @@ proc convertToNimStyle(cmds: openArray[string]): seq[string] =
|
||||
|
||||
const
|
||||
Copyright = "Copyright (c) 2022 Status Research & Development GmbH"
|
||||
Version = "Nimbus-t8n 0.1.0"
|
||||
Version = "Nimbus-t8n 0.1.2"
|
||||
|
||||
proc init*(_: type T8NConf, cmdLine = commandLineParams()): T8NConf =
|
||||
# force the compiler to instantiate T8NConf.load
|
||||
# rather than have to export parseCmdArg
|
||||
# because it will use wrong parseCmdArg from nimbus/config.nim
|
||||
# when evmc_enabled
|
||||
proc initT8NConf(cmdLine: openArray[string]): T8NConf =
|
||||
{.push warning[ProveInit]: off.}
|
||||
result = T8NConf.load(
|
||||
cmdLine.convertToNimStyle,
|
||||
@ -166,3 +170,6 @@ proc init*(_: type T8NConf, cmdLine = commandLineParams()): T8NConf =
|
||||
copyrightBanner = Version & "\n" & Copyright
|
||||
)
|
||||
{.pop.}
|
||||
|
||||
proc init*(_: type T8NConf, cmdLine = commandLineParams()): T8NConf =
|
||||
initT8NConf(cmdLine)
|
||||
|
@ -1,2 +1,6 @@
|
||||
switch("define", "chronicles_default_output_device=stderr")
|
||||
switch("define", "chronicles_runtime_filtering=on")
|
||||
if defined(evmc_enabled):
|
||||
# evmcLoadVMShowDetail log output will intefere with t8n ouput
|
||||
switch("define", "chronicles_enabled=off")
|
||||
else:
|
||||
switch("define", "chronicles_default_output_device=stderr")
|
||||
switch("define", "chronicles_runtime_filtering=on")
|
||||
|
Loading…
x
Reference in New Issue
Block a user