Skip to content

Fix Windows release CRT dependency#1537

Open
chenyukang wants to merge 3 commits into
nervosnetwork:developfrom
chenyukang:fix/windows-msvc-crt
Open

Fix Windows release CRT dependency#1537
chenyukang wants to merge 3 commits into
nervosnetwork:developfrom
chenyukang:fix/windows-msvc-crt

Conversation

@chenyukang

@chenyukang chenyukang commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1344.

Summary

  • Build Windows release binaries with the MSVC CRT statically linked by switching the vcpkg OpenSSL triplet from x64-windows-static-md to x64-windows-static and setting RUSTFLAGS=-C target-feature=+crt-static.
  • Mirror the same static-CRT configuration in the Windows CI build so the release path is continuously covered.
  • Add a Windows store-open smoke test that runs fnn.exe --check-validate against an empty store, catching process crashes before packaging a release.

Root Cause

The Windows release workflow built on windows-2022 with openssl:x64-windows-static-md and Rust MSVC defaults. That combination statically linked OpenSSL but dynamically linked the MSVC C runtime, so fnn.exe depended on a sufficiently new system-wide MSVCP140.dll / VCRUNTIME140.dll. On machines with older VC++ Redistributable versions, the binary could crash with 0xC0000005 when startup first opened RocksDB.

Validation

  • rtk git diff --check upstream/develop...HEAD
  • rtk ruby -e 'require "yaml"; YAML.load_file(".github/workflows/release.yml"); YAML.load_file(".github/workflows/ci.yml"); puts "yaml ok"'
  • Local smoke command using target/debug/fnn --check-validate against an empty store, confirming the command reaches the database validation path and returns a Rust-level validation error instead of failing before store open.

Release test triggers

#windows-release-test

@chenyukang
chenyukang marked this pull request as ready for review July 7, 2026 07:17
@chenyukang
chenyukang force-pushed the fix/windows-msvc-crt branch from 23ef73d to 7b2bc05 Compare July 7, 2026 07:38
@chenyukang
chenyukang force-pushed the fix/windows-msvc-crt branch from 7b2bc05 to 2463c4d Compare July 7, 2026 10:47
@chenyukang

Copy link
Copy Markdown
Collaborator Author

Windows release test binary is available from the CI run:

The package contains fnn.exe, fnn-cli.exe, and config/.

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.

[Windows] fnn.exe crashes on startup with 0xC0000005: undeclared MSVC C++ Runtime dependency

1 participant