use const in waku.nimble as it is simpler

This commit is contained in:
Ivan FB 2026-04-04 22:35:10 +02:00
parent a5573b3232
commit e5b46e5ed6
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270
6 changed files with 9 additions and 47 deletions

View File

@ -88,14 +88,6 @@ jobs:
- name: Install nimble deps
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
run: |
# Remove nim/nimble entries from lock to avoid cross-platform checksum mismatch
python3 -c "
import json, sys
lock = json.load(open('nimble.lock'))
for key in ['nim', 'nimble']:
lock['packages'].pop(key, None)
json.dump(lock, open('nimble.lock', 'w'), indent=2)
"
nimble setup --localdeps -y
make rebuild-nat-libs-nimbledeps
make rebuild-bearssl-nimbledeps
@ -149,14 +141,6 @@ jobs:
- name: Install nimble deps
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
run: |
# Remove nim/nimble entries from lock to avoid cross-platform checksum mismatch
python3 -c "
import json, sys
lock = json.load(open('nimble.lock'))
for key in ['nim', 'nimble']:
lock['packages'].pop(key, None)
json.dump(lock, open('nimble.lock', 'w'), indent=2)
"
nimble setup --localdeps -y
make rebuild-nat-libs-nimbledeps
make rebuild-bearssl-nimbledeps
@ -236,14 +220,6 @@ jobs:
- name: Install nimble deps
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
run: |
# Remove nim/nimble entries from lock to avoid cross-platform checksum mismatch
python3 -c "
import json, sys
lock = json.load(open('nimble.lock'))
for key in ['nim', 'nimble']:
lock['packages'].pop(key, None)
json.dump(lock, open('nimble.lock', 'w'), indent=2)
"
nimble setup --localdeps -y
make rebuild-nat-libs-nimbledeps
make rebuild-bearssl-nimbledeps

View File

@ -74,14 +74,6 @@ jobs:
- name: Install nimble deps
if: ${{ steps.secrets.outcome == 'success' && steps.cache-nimbledeps.outputs.cache-hit != 'true' }}
run: |
# Remove nim/nimble entries from lock to avoid cross-platform checksum mismatch
python3 -c "
import json, sys
lock = json.load(open('nimble.lock'))
for key in ['nim', 'nimble']:
lock['packages'].pop(key, None)
json.dump(lock, open('nimble.lock', 'w'), indent=2)
"
nimble setup --localdeps -y
make rebuild-nat-libs-nimbledeps
make rebuild-bearssl-nimbledeps

View File

@ -67,12 +67,7 @@ waku.nims:
ln -s waku.nimble $@
$(NIMBLEDEPS_STAMP): nimble.lock | waku.nims
# nim/nimble in nimble.lock have platform-specific checksums; strip before
# setup and restore afterwards to keep the versioned file intact.
cp nimble.lock nimble.lock.bak
python3 -c "import json; lock=json.load(open('nimble.lock')); [lock['packages'].pop(k,None) for k in ['nim','nimble']]; json.dump(lock,open('nimble.lock','w'),indent=2)"
nimble setup --localdeps || { mv nimble.lock.bak nimble.lock; exit 1; }
mv nimble.lock.bak nimble.lock
nimble setup --localdeps
$(MAKE) build-nph
$(MAKE) rebuild-bearssl-nimbledeps
touch $@
@ -90,8 +85,8 @@ clean:
rm nimble.paths 2> /dev/null || true
nimble clean
REQUIRED_NIM_VERSION := $(shell grep -E '^requires "nim ==' waku.nimble | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
REQUIRED_NIMBLE_VERSION := $(shell grep -E '^requires "nimble ==' waku.nimble | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
REQUIRED_NIM_VERSION := $(shell grep -E '^const NimVersion\s*=' waku.nimble | grep -oE '"[0-9]+\.[0-9]+\.[0-9]+"' | tr -d '"')
REQUIRED_NIMBLE_VERSION := $(shell grep -E '^const NimbleVersion\s*=' waku.nimble | grep -oE '"[0-9]+\.[0-9]+\.[0-9]+"' | tr -d '"')
build:
@nim_ver=$$(nim --version 2>/dev/null | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1); \

View File

@ -8,8 +8,8 @@
let
lines = pkgs.lib.splitString "\n" (builtins.readFile ../waku.nimble);
versionLine = builtins.head (builtins.filter
(l: builtins.match "^requires \"nim ==.*" l != null) lines);
version = builtins.head (builtins.match ".*([0-9]+\\.[0-9]+\\.[0-9]+).*" versionLine);
(l: builtins.match "^const NimVersion.*" l != null) lines);
version = builtins.head (builtins.match ".*\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" versionLine);
in
pkgs.fetchgit {
url = "https://github.com/nim-lang/Nim.git";

View File

@ -6,8 +6,8 @@
let
lines = pkgs.lib.splitString "\n" (builtins.readFile ../waku.nimble);
versionLine = builtins.head (builtins.filter
(l: builtins.match "^requires \"nimble ==.*" l != null) lines);
version = builtins.head (builtins.match ".*([0-9]+\\.[0-9]+\\.[0-9]+).*" versionLine);
(l: builtins.match "^const NimbleVersion.*" l != null) lines);
version = builtins.head (builtins.match ".*\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" versionLine);
in
pkgs.fetchgit {
url = "https://github.com/nim-lang/nimble";

View File

@ -10,9 +10,8 @@ description = "Waku, Private P2P Messaging for Resource-Restricted Devices"
license = "MIT or Apache License 2.0"
#bin = @["build/waku"]
## nim/nimble are stripped from nimble.lock before setup to avoid cross-platform checksum errors.
requires "nim == 2.2.4"
requires "nimble == 0.18.2"
const NimVersion = "2.2.4"
const NimbleVersion = "0.18.2"
### Dependencies
requires "chronos >= 4.2.0",