mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 06:53:12 +00:00
chore: fix rln in nimble
# Conflicts: # waku.nimble
This commit is contained in:
parent
2691dcb325
commit
687e093a56
3
.gitignore
vendored
3
.gitignore
vendored
@ -79,3 +79,6 @@ waku_handler.moc.cpp
|
|||||||
|
|
||||||
# Nix build result
|
# Nix build result
|
||||||
result
|
result
|
||||||
|
|
||||||
|
# Nimble
|
||||||
|
nimble.paths
|
||||||
|
|||||||
@ -5,6 +5,20 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# --- lock setup ---
|
||||||
|
lockdir="build/rln.lock"
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
# try to acquire lock (atomic)
|
||||||
|
while ! mkdir "${lockdir}" 2>/dev/null; do
|
||||||
|
echo "Another process is building RLN, waiting..."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
# cleanup on exit
|
||||||
|
cleanup() { rm -rf "${lockdir}"; }
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
# first argument is the build directory
|
# first argument is the build directory
|
||||||
build_dir=$1
|
build_dir=$1
|
||||||
rln_version=$2
|
rln_version=$2
|
||||||
@ -14,6 +28,11 @@ output_filename=$3
|
|||||||
[[ -z "${rln_version}" ]] && { echo "No rln version specified"; exit 1; }
|
[[ -z "${rln_version}" ]] && { echo "No rln version specified"; exit 1; }
|
||||||
[[ -z "${output_filename}" ]] && { echo "No output filename specified"; exit 1; }
|
[[ -z "${output_filename}" ]] && { echo "No output filename specified"; exit 1; }
|
||||||
|
|
||||||
|
if [[ -f "${output_filename}" ]]; then
|
||||||
|
echo "RLN library already exists: ${output_filename}, skipping build."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Get the host triplet
|
# Get the host triplet
|
||||||
host_triplet=$(rustc --version --verbose | awk '/host:/{print $2}')
|
host_triplet=$(rustc --version --verbose | awk '/host:/{print $2}')
|
||||||
|
|
||||||
|
|||||||
2
vendor/nim-serialization
vendored
2
vendor/nim-serialization
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 6f525d5447d97256750ca7856faead03e562ed20
|
Subproject commit 73d6108d9c7ad0a1283d1e361a3f86e6c676a305
|
||||||
2
vendor/nim-web3
vendored
2
vendor/nim-web3
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 81ee8ce479d86acb73be7c4f365328e238d9b4a3
|
Subproject commit 48fb2d4a215c20326b0cb945913b1d614a0564b9
|
||||||
24
waku.nimble
24
waku.nimble
@ -13,27 +13,37 @@ license = "MIT or Apache License 2.0"
|
|||||||
### Dependencies
|
### Dependencies
|
||||||
requires "nim >= 2.2.4",
|
requires "nim >= 2.2.4",
|
||||||
"chronicles",
|
"chronicles",
|
||||||
"confutils",
|
"confutils#e214b39",
|
||||||
"chronos",
|
"chronos",
|
||||||
"dnsdisc",
|
"dnsdisc",
|
||||||
"eth",
|
"eth",
|
||||||
"json_rpc",
|
"json_rpc",
|
||||||
"libbacktrace",
|
"libbacktrace",
|
||||||
"nimcrypto",
|
"nimcrypto",
|
||||||
|
"serialization >= 0.4.9",
|
||||||
"stew",
|
"stew",
|
||||||
"stint",
|
"stint",
|
||||||
"metrics",
|
"metrics",
|
||||||
"libp2p >= 1.13.0",
|
"libp2p >= 1.13.0",
|
||||||
"web3",
|
"web3#48fb2d4", # fix 0.7.0 undeclared field: 'stream' error
|
||||||
"presto",
|
"presto",
|
||||||
"regex",
|
"regex",
|
||||||
"results",
|
"results",
|
||||||
"db_connector",
|
"db_connector",
|
||||||
"minilru",
|
"minilru",
|
||||||
"quic",
|
|
||||||
"https://github.com/vacp2p/mix#0.1.0"
|
"https://github.com/vacp2p/mix#0.1.0"
|
||||||
|
|
||||||
### Helper functions
|
### Helper functions
|
||||||
|
|
||||||
|
proc ensureRln(libFile: string = "build/librln.a", version = "v0.7.0") =
|
||||||
|
if not fileExists(libFile):
|
||||||
|
echo "Building RLN library..."
|
||||||
|
let buildDir = getCurrentDir()
|
||||||
|
let outFile = libFile
|
||||||
|
exec "bash ./scripts/build_rln.sh " & buildDir & " " & version & " " & outFile
|
||||||
|
else:
|
||||||
|
echo "RLN library already exists: " & libFile
|
||||||
|
|
||||||
proc buildModule(filePath, params = "", lang = "c"): bool =
|
proc buildModule(filePath, params = "", lang = "c"): bool =
|
||||||
if not dirExists "build":
|
if not dirExists "build":
|
||||||
mkDir "build"
|
mkDir "build"
|
||||||
@ -55,11 +65,9 @@ proc buildModule(filePath, params = "", lang = "c"): bool =
|
|||||||
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
|
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
|
||||||
if not dirExists "build":
|
if not dirExists "build":
|
||||||
mkDir "build"
|
mkDir "build"
|
||||||
# allow something like "nim nimbus --verbosity:0 --hints:off nimbus.nims"
|
|
||||||
var extra_params = params
|
ensureRln()
|
||||||
for i in 2 ..< paramCount():
|
exec "nim " & lang & " --out:build/" & name & " --mm:refc " & " --passL:build/librln.a --passL:-lm --passL:-L" & getCurrentDir() & " " & params & " " &
|
||||||
extra_params &= " " & paramStr(i)
|
|
||||||
exec "nim " & lang & " --out:build/" & name & " --mm:refc " & extra_params & " " &
|
|
||||||
srcDir & name & ".nim"
|
srcDir & name & ".nim"
|
||||||
|
|
||||||
proc buildLibrary(name: string, srcDir = "./", params = "", `type` = "static") =
|
proc buildLibrary(name: string, srcDir = "./", params = "", `type` = "static") =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user