Nimsuggest tweaks (#453)

* Fixes/workarounds for nimsuggest failures in codex.nim.
* remove rng prefix - it appears to work now
This commit is contained in:
Jaremy Creechley 2023-06-21 15:02:05 -07:00 committed by GitHub
parent cfd2cf9302
commit 6d1469b4be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 26 deletions

View File

@ -7,29 +7,30 @@ license = "MIT"
binDir = "build" binDir = "build"
srcDir = "." srcDir = "."
requires "nim >= 1.2.0", requires "nim >= 1.2.0"
"asynctest >= 0.3.2 & < 0.4.0", requires "asynctest >= 0.3.2 & < 0.4.0"
"bearssl >= 0.1.4", requires "bearssl >= 0.1.4"
"chronicles >= 0.7.2", requires "chronicles >= 0.7.2"
"chronos >= 2.5.2", requires "chronos >= 2.5.2"
"confutils", requires "confutils"
"ethers >= 0.2.4 & < 0.3.0", requires "ethers >= 0.2.4 & < 0.3.0"
"libbacktrace", requires "libbacktrace"
"libp2p", requires "libp2p"
"metrics", requires "metrics"
"nimcrypto >= 0.4.1", requires "nimcrypto >= 0.4.1"
"nitro >= 0.5.1 & < 0.6.0", requires "nitro >= 0.5.1 & < 0.6.0"
"presto", requires "presto"
"protobuf_serialization >= 0.2.0 & < 0.3.0", requires "protobuf_serialization >= 0.2.0 & < 0.3.0"
"questionable >= 0.10.6 & < 0.11.0", requires "questionable >= 0.10.6 & < 0.11.0"
"secp256k1", requires "secp256k1"
"stew", requires "stew"
"upraises >= 0.1.0 & < 0.2.0", requires "upraises >= 0.1.0 & < 0.2.0"
"https://github.com/status-im/lrucache.nim#1.2.2", requires "toml_serialization"
"leopard >= 0.1.0 & < 0.2.0", requires "https://github.com/status-im/lrucache.nim#1.2.2"
"blscurve", requires "leopard >= 0.1.0 & < 0.2.0"
"libp2pdht", requires "blscurve"
"eth" requires "libp2pdht"
requires "eth"
when declared(namedBin): when declared(namedBin):
namedBin = { namedBin = {

View File

@ -141,8 +141,11 @@ proc stop*(s: CodexServer) {.async.} =
s.runHandle.complete() s.runHandle.complete()
proc new*(T: type CodexServer, config: CodexConf, privateKey: CodexPrivateKey): T = proc new*(
T: type CodexServer,
config: CodexConf,
privateKey: CodexPrivateKey): CodexServer =
## create CodexServer including setting up datastore, repostore, etc
let let
switch = SwitchBuilder switch = SwitchBuilder
.new() .new()
@ -221,6 +224,7 @@ proc new*(T: type CodexServer, config: CodexConf, privateKey: CodexPrivateKey):
.expect("Should start rest server!") .expect("Should start rest server!")
switch.mount(network) switch.mount(network)
T( T(
config: config, config: config,
codexNode: codexNode, codexNode: codexNode,

View File

@ -252,7 +252,10 @@ proc getCodexVersion(): string =
return tag return tag
proc getCodexRevision(): string = proc getCodexRevision(): string =
strip(staticExec("git rev-parse --short HEAD"))[0..5] # using a slice in a static context breaks nimsuggest for some reason
var res = strip(staticExec("git rev-parse --short HEAD"))
res.setLen(6)
return res
proc getNimBanner(): string = proc getNimBanner(): string =
staticExec("nim --version | grep Version") staticExec("nim --version | grep Version")