Skip to content

wfclient self-build sources · 2026-10-25 19:03:34 (UTC+8) · dac6ecbaf97e

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 25 Oct 10:42
· 2 commits to main since this release

构建时间:2026-10-25 19:03:34(UTC+8) ≈ 2026-10-25 11:03:34(UTC)

自己编译引擎用的源码包:客户端 src/、构建脚本 ci/、上游补丁、文档与许可。
完整依赖说明见仓库根目录的 自构建说明.md(也在 zip 里)。

两条编译路径,先选一条

路径 要装什么 相对速度
A. 便携 GNU 链(可完全离线) 基本上什么都不用装;可选 MinGW-w64 gcc 以开启 mimalloc 1.00×
B. MSVC + PGO(发布包口径) rustup 锁版本工具链 + VS 生成工具(装最新的 VS 2026;2022 起都能用)+ llvm-tools-preview 3.4×

实测(8 核 16 线程,100 条 board):A = 102.7 s,B = 29.9 s ⇒ 3.43×。

依赖与官方安装渠道

依赖 版本 官方渠道
Rust 工具链 1.97.1-x86_64-pc-windows-msvc(锁版本) https://rustup.rs · https://www.rust-lang.org/tools/install
VS 生成工具(link.exe + Windows SDK + cl.exe) 最新的 VS 2026(实测工具集 14.51.36231);2022 及以后都能用(14.44.35207) https://visualstudio.microsoft.com/downloads/ · https://visualstudio.microsoft.com/visual-cpp-build-tools/ · winget install --id Microsoft.VisualStudio.BuildTools -e(默认最新 = 2026)
llvm-profdata(PGO) 随工具链(LLVM 22.1) rustup component add llvm-tools-preview · https://doc.rust-lang.org/rustc/profile-guided-optimization.html
crates.io 依赖 见 engine-src/work/Cargo.lock https://crates.io
MinGW-w64 gcc(可选,仅 mimalloc) 任意 https://www.msys2.org/ · https://winlibs.com/
Git for Windows(可选) ≥ 2.40 https://git-scm.com/download/win
GitHub PAT(可选) fine-grained,public 只读 https://github.com/settings/tokens

也有的前提:Windows 10/11 x64、磁盘约 2 GB(编译目标目录 542 MB + cargo registry 110 MB)、
Python 3.11+(只跑 ci/ 脚本)、能访问 GitHub(取上游源码;匿名 60 次/小时够用)。

三步开始

python ci\fetch_sources.py                    :: 拉上游源码 + 打本仓补丁
python ci\build_engine.py --crt-static --target-cpu x86-64-v3 --rivens-gate 3
python ci\tools\run_corpus.py dist\wfsim-core.exe --anchors   :: 逐位闸门

常见坑(中文路径让 ar.exe 乱码、no .profraw produced、便携链不支持 PGO、
gas 按源码条数计费……)逐条写在 自构建说明.md 的最后一节。

只想要"开箱即用"?用 portable-dac6ecbaf97e 那条线的完整便携包。