ci: build wakunode2/libwaku directly with nim on Windows

Root cause of the recurring 6h Windows hang: since the nimble migration the
build runs `nimble <task>`, which re-resolves the lock and re-clones every
git-URL dependency (~20 of them) from GitHub on each invocation. On the MSYS2
runner those git clones are flaky — they usually finish, but intermittently one
stalls forever (Nim.git in one run, bearssl_pkey_decoder in another), so the job
is cancelled at the 6h limit. It is not a code regression; whichever clone
happens to stall is the one that hangs.

On Windows only, compile wakunode2 and libwaku with nim c directly instead of
through nimble. nim uses the deps that `nimble setup` already installed (via
nimble.paths) and clones nothing, so there is no git operation left to hang.
Linux/macOS keep the nimble flow, where the clones are fast and reliable.

The nim c flags mirror waku.nimble's buildBinary / buildLibrary so the output
matches the nimble-driven build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ivan FB 2026-06-03 23:40:41 +02:00
parent 5ccc273ca5
commit 234a1702e4
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270

View File

@ -222,9 +222,19 @@ testwaku: | build-deps build rln-deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(NIMBLE) test
# On Windows, build directly with nim instead of `nimble <task>`: nimble
# re-resolves the lock on every invocation and re-clones each git-URL dep, and
# those clones intermittently hang for hours on the MSYS2 runner. nim c reuses
# the deps that `nimble setup` already installed (via nimble.paths) and clones
# nothing. The flags mirror waku.nimble's buildBinary; keep them in sync.
wakunode2: | build-deps build deps librln
ifeq ($(detected_OS),Windows)
echo -e $(BUILD_MSG) "build/$@" && \
nim c --out:build/wakunode2 --mm:refc --cpu:amd64 $(NIM_PARAMS) -d:chronicles_log_level=TRACE apps/wakunode2/wakunode2.nim
else
echo -e $(BUILD_MSG) "build/$@" && \
$(NIMBLE) wakunode2
endif
benchmarks: | build-deps build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
@ -430,8 +440,14 @@ else ifeq ($(detected_OS),Linux)
BUILD_COMMAND := $(BUILD_COMMAND)Linux
endif
# Windows: build directly with nim (see the wakunode2 target for why). Flags
# mirror waku.nimble's buildLibrary dynamic path (libwakuDynamicWindows).
libwaku: | build-deps librln
ifeq ($(detected_OS),Windows)
nim c --out:build/libwaku.dll --threads:on --app:lib --opt:speed --noMain --mm:refc --header -d:metrics --nimMainPrefix:libwaku --skipParentCfg:off -d:discv5_protocol_id=d5waku --cpu:amd64 $(NIM_PARAMS) library/libwaku.nim
else
$(NIMBLE) --verbose libwaku$(BUILD_COMMAND) waku.nimble
endif
liblogosdelivery: | build-deps librln
$(NIMBLE) --verbose liblogosdelivery$(BUILD_COMMAND) waku.nimble