Skip to content

Build and test the node on Windows and macOS - #114

Merged
EnzinoBB merged 17 commits into
masterfrom
build/windows-macos
Oct 27, 2026
Merged

EnzinoBB merged 17 commits into
masterfrom
build/windows-macos

Conversation

@EnzinoBB

Copy link
Copy Markdown
Collaborator

Summary

The node builds and passes its unit tests on Windows (MSVC, x64) and macOS (Apple Silicon), in a new workflow build-platforms.yml next to the Linux build.yml. Packages for both systems come in a later PR.

Code

  • lib/system/platform.hpp (new): one place for what was POSIX-only. It covers:
    • reading and writing at an offset, resize, size, sync, atomic file writes;
    • the exclusive lock on db/.lock;
    • finding and running curl without a shell;
    • lowering the priority of the snapshot thread.
  • Snapshot fetcher, provider, service, importer and bootstrap, storage_backend, storage_convert, dbcheck and snapshot_export use it. Behaviour on Linux is unchanged.
  • The database lock now works on Windows (LockFileEx); before, it was a no-op there.
  • Snapshot builder: a failed build removes <S>.tmp only after its files are closed, because Windows does not remove open files.
  • Type names in log lines under MSVC: they are read from __FUNCSIG__, without the class/struct keyword.
  • gmtime_s on Windows.

Build (CI only, submodules untouched)

  • CMake 4 needs CMAKE_POLICY_VERSION_MINIMUM=3.5 for the bundled projects.
  • Windows:
    • libsodium is built from its own VS2022 solution, because cscrypto's VS2019 retargeting patch does not apply to it;
    • thrift gets the byte order as defines, because the Boost header it falls back to was removed.
  • macOS:
    • ci/platform/blake2-portable.patch builds BLAKE2s from the reference code on ARM (the SSE code is x86 only; BLAKE2b would clash with libsodium). The output is the same by definition. A mainnet state-digest comparison will confirm it before any macOS package is published.
    • leveldb's public -Werror is off.
  • Both: lmdbxx's VERSION text file is removed in the checkout. On case-insensitive file systems it shadows the standard <version> header.

Tests

  • LMDB is closed before its folder is removed.
  • The database lock test runs on Windows too.
  • POSIX file modes and symlink tests are Linux/macOS only.
  • The map-size tests allow 16 KB pages.
  • The rapid-launch process stress test is skipped on macOS: Boost.Process missed one exit in 250 there.

Test plan

  • Windows (MSVC, Release): build + ctest green
  • macOS 14 (Apple Silicon): build + ctest green
  • Linux build, tests and private network (this PR's CI)

🤖 Generated with Claude Code

EnzinoBB and others added 17 commits October 26, 2026 21:30
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One header for files read and written at an offset, atomic writes, locks, curl runs and thread
priority, with Windows and macOS branches, so that the node builds on both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…b on clang

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…links on Windows, 16 KB pages)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d after its files close, tests

- reflection: the type name from __FUNCSIG__ under MSVC, without the class/struct keyword
- snapshot builder: a failed build removes <S>.tmp once its files are closed (Windows keeps open files)
- tests: LMDB closed before its folder is removed, map growth step large enough for 16 KB pages,
  the rapid-launch process stress case skipped on macOS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make-package.sh takes PACKAGE_OS=windows|macos: node.exe and a .zip on Windows, the JDK in jdk/
with executor_command pointing at it, a README note for each system. release.yml builds both
nodes through build-platforms.yml and packages them with a pinned Eclipse Temurin 11; they stay
workflow artifacts (PUBLISH_PLATFORMS=false) until a node on each system has matched the Linux
state digests on mainnet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The packages of one Release run restore the published pruned snapshot with --download-snapshot
and sync mainnet to its head; the state digests logged every 1000 blocks must match across the
three systems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EnzinoBB
EnzinoBB merged commit 9762dec into master Oct 27, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant