From 234a1702e4dde0a79569b6be48435c5d5142f114 Mon Sep 17 00:00:00 2001 From: Ivan FB Date: Wed, 3 Jun 2026 23:40:41 +0200 Subject: [PATCH] ci: build wakunode2/libwaku directly with nim on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of the recurring 6h Windows hang: since the nimble migration the build runs `nimble `, 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 --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index a9d1cb2fe..26a91dc2f 100644 --- a/Makefile +++ b/Makefile @@ -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 `: 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