Files
admin bef326ad2f feat(dep): 方案 C —— 消费平台预编译 rlib,零重编平台/axum
- Cargo.toml: [workspace.dependencies] 清空(sspf/axum/tokio/serde/serde_json
  全部改由平台包 lib/ 经 --extern 喂入);release profile lto=false
  (预编译 rlib bitcode-free,开 LTO 会 failed to get bitcode for LTO)
- src/backend/Cargo.toml: 去掉 axum/tokio;packs/*: 去掉 sspf workspace 依赖
- scripts/fetch-platform.sh: 解包前 mv 走旧包目录(避免旧 hash rlib 残留);
  为 sspf/axum/tokio/serde/serde_json/http/bytes 生成 --extern(保证与 sspf
  同一 crate 实例,否则跨 API 边界 E0308 mismatched types);修 channel 解析
- .gitignore: 忽略 .cargo/config.toml(含本机绝对路径,跨机无效)
- rust-toolchain.toml: 新增(锁 rustc 1.95.0)
- 文档同步 SKILL/README/CLAUDE/HANDOFF

实测: cargo build 5.7s / --release 11s,只编本仓 5 个 crate,平台 17 crate 与
axum/tokio 零重编。
2026-11-05 11:41:19 +08:00

23 lines
1.1 KiB
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🔴 全仓工具链锁定 —— **不要单独改某个 crate,也不要「本地升了就行」**
#
# 为什么必须锁:
# L3 动态库(cdylib)走 C ABI + JSON 边界(PLAN.md §4.5)。
# Rust **没有稳定 ABI**,内核与插件用不同 rustc 编译 ⇒ 结构体内存布局可能不同 ⇒
# 运行期段错误,且极难定位(崩溃点往往在无关的函数里)。
# ⇒ 内核、所有 packs、所有 plugins,必须用**同一个** rustc 版本。
#
# 怎么升:
# 1. 改本文件的 channel
# 2. 全仓 `cargo build --release` 重编(含 packs/*)
# 3. 所有已发布的 dylib 插件**全部重编重发**(旧插件会被 build_info 校验拒载)
# 4. 同步 `packs/*/pack.toml` 的 `[pack.build].toolchain`
#
# 当前版本 = 本机既有版本(2026-10-31 定)。不追最新:
# 1.99.1 是最新 stable,但本机下载受代理限速(6MB 卡死),
# 且「锁哪个版本」不影响架构,只影响可复现性 ⇒ 先用已有的 1.95.0,需要时再整体升。
[toolchain]
channel = "1.95.0"
components = ["rustfmt", "clippy"]
profile = "minimal"