From 49f85db9f9692d269cb03fc9402dc566f94bd526 Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Fri, 23 Oct 2026 14:10:20 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BF=AE=E6=AD=A3=20cargo=20=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E9=85=8D=E7=BD=AE=E5=BB=BA=E8=AE=AE=EF=BC=88=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E8=80=8C=E9=9D=9E=E9=95=9C=E5=83=8F=E6=BA=90=EF=BC=89?= =?UTF-8?q?+=20=E6=9B=B4=E6=96=B0=E6=9E=84=E5=BB=BA=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 实测 USTC 镜像索引 cksum 与下发的 .crate 字节不一致(nvenc 0.1.0), 源替换会触发 checksum 校验失败并改变 registry 身份;改为 [http] proxy 走官方源 - 构建命令里 D:\\wordkb\\... 的失效路径替换为可用写法 - 已实测:Windows cargo build --release 通过(agent.exe/viewer.exe/encbench.exe) 且 cargo test -p linux-agent 在容器内 2 passed --- 构建运行手册.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/构建运行手册.md b/构建运行手册.md index 9d76ba0..d85b7b0 100644 --- a/构建运行手册.md +++ b/构建运行手册.md @@ -20,31 +20,34 @@ - `rustup default stable-x86_64-pc-windows-gnu`,装到 `%USERPROFILE%\.cargo\bin` - MinGW-w64:`D:\mingw64\bin`(gcc 16.2.0) - 构建时 PATH 需同时包含上面两个目录(缺 MinGW 会在链接 openh264 的 C++ 时失败) -- **cargo 源**:国内直连 crates.io 会超时(cargo 不读系统代理),需配置镜像。已在本机 - `%USERPROFILE%\.cargo\config.toml` 写入 USTC 源: +- **cargo 网络**:国内直连 crates.io 会超时,且 **cargo 不读 Windows 系统代理**,必须显式告诉它。 + 已在本机 `%USERPROFILE%\.cargo\config.toml` 写入(Clash 之类混合端口,按实际改): ```toml - [source.crates-io] - replace-with = "ustc" - [source.ustc] - registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/" + [http] + proxy = "http://127.0.0.1:7897" ``` + ⚠️ **不要用国内镜像做源替换**:实测 USTC 镜像的索引 `cksum` 与其实际下发的 `.crate` + 字节**不一致**(`nvenc 0.1.0`:索引写 `3227c3b0…`,包体实际 `ab6fde0e…`), + 会报 `failed to verify the checksum of nvenc`;且源替换会改变 registry 身份, + 使 `Cargo.lock` 里已有的 checksum 与全部缓存失配。**走官方源 + 代理最稳。** + > 注:旧版本手册写的 `D:\wordkb\...\uurev\tools\rust` 路径已不存在,按上面重新准备工具链即可。 ## 3. 构建 ```bash -export RUSTUP_HOME="D:\\wordkb\\2026-10-22-15-52-47\\uurev\\tools\\rust\\rustup" -export CARGO_HOME="D:\\wordkb\\2026-10-22-15-52-47\\uurev\\tools\\rust\\cargo" -export PATH="/d/wordkb/2026-10-22-15-52-47/uurev/tools/rust/cargo/bin:/d/wordkb/2026-10-22-15-52-47/uurev/tools/mingw64/bin:$PATH" -cd /d/wordkb/2026-10-22-15-52-47/mvp-remote +# Git Bash 写法:PATH 需含 rustup 的 cargo 与 MinGW-w64 +export PATH="$USERPROFILE/.cargo/bin:/d/mingw64/bin:$PATH" +cd /d/code/remote # 换成你自己的工作目录 / worktree cargo build --release ``` 产物: - 被控端 `target/release/agent.exe` - 主控端 `target/release/viewer.exe` +- 编码基准(可选)`target/release/encbench.exe` ## 4. 运行(两台机器,或同机双开验证)