openpencil/Cargo.toml
Kayshen-X 4b8bb136e7 chore(workspace): patch skia-bindings + skia-safe to vendor/skia-safe-op
Wires the workspace at vendor/skia-safe-op (committed in the previous
commit) via [patch.crates-io] so every consumer of skia-safe /
skia-bindings — both the wasm32-unknown-unknown shell-web bundle and
the macOS / Linux / Windows shell-native desktop binary — resolves
through the fork on every target.

[patch.crates-io] is workspace-global, NOT target-scoped; cargo does
not natively support per-target patches, so this is the accepted
blast radius. The fork is byte-identical to upstream rust-skia 0.97.0
except for the new `wasm_unknown` platform module + its single new
dispatch arm; native builds resolve to the same upstream platform
modules they did before. Verified `cargo check -p
openpencil-shell-native` builds through the fork unchanged.

Trade-off: upstream rust-skia patches no longer flow until we
re-vendor; Cargo.lock records `path` sources for skia-bindings /
skia-safe rather than `registry+...`. The full rationale block is
inline in Cargo.toml.

The Cargo.lock delta also pins js-sys 0.3.97 → 0.3.94 / web-sys
0.3.97 → 0.3.94 — this is the transitive consequence of pinning
wasm-bindgen = "=0.2.117" on shell-web (last 0.2.x release that
compiles on the workspace's Rust 1.85 toolchain; 0.2.120+ requires
1.86). Documented in shell-web/Cargo.toml.

Step 1b §3.2 P0.5B Run path, sub-phase C-hard.1.
2026-05-09 21:06:00 +08:00

61 lines
2.7 KiB
TOML
Raw 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.

[workspace]
resolver = "2"
# 用 glob 而非显式列表:Step 0 增量创建 crate 时不需要每次改 members(per implementer
# Phase 1 batch 2 的 workspace masking 反馈:列出未存在的 crate 会让 `cargo build -p X`
# 在 resolve 阶段就挂掉)。glob 自动包含 crates/ 下所有 manifest,自然支持增量创建。
members = ["crates/*"]
exclude = ["vendor/agent", "vendor/jian", "vendor/skia-safe-op", "node_modules"]
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.85"
license = "MIT"
authors = ["ZSeven-W <fini.yang@gmail.com>"]
repository = "https://github.com/ZSeven-W/openpencil"
[workspace.dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "1"
anyhow = "1"
tracing = "0.1"
# WASM 边界相关(per kickoff §1.2 黑名单 = 不出现在这里)
# 故意不在 workspace.dependencies 暴露 tokio / reqwest / agent / pen-agent-cli /
# pen-server / native-tls —— 这些只在 native-only crate 内部用 dev-deps 或 target-specific deps。
# Step 1b §3.2 P0.5B Run path (2026-05-09): wasm32-unknown-unknown skia
# build via `vendor/skia-safe-op` — fork of rust-skia 0.97.0 with a new
# build_support/platform/wasm_unknown.rs target that produces .o files
# free of emscripten runtime imports.
#
# IMPORTANT: `[patch.crates-io]` is workspace-global, NOT target-scoped.
# Every `skia-safe` / `skia-bindings` consumer in this workspace —
# including `openpencil-shell-native` (macOS / Linux / Windows desktop,
# `gl` feature) — now resolves through this fork on every target.
# Cargo does not natively support per-target patches, so this is the
# accepted blast radius.
#
# Compatibility surface vs upstream rust-skia 0.97.0:
# - every upstream platform module (macos / linux / windows /
# emscripten / android / ios / ohos / alpine) is byte-identical;
# only `wasm_unknown` is new
# - the dispatch table adds one new arm for
# `("wasm32", "unknown", "unknown", _)`; every existing target
# tuple still resolves to the same upstream module as before
# - the binary-cache feature URL + skia-binaries archive layout are
# untouched, so native desktop builds continue to download the
# prebuilt artifact instead of compiling Skia from source
#
# Trade-offs accepted:
# - upstream rust-skia patches will not flow until we re-vendor
# - `Cargo.lock` records `path` sources for skia-bindings/skia-safe
# instead of `registry+…`, surfacing the fork in audit tools
#
# When upstream rust-skia ships a wasm32-unknown-unknown platform
# module of its own, this whole [patch] block can go away.
[patch.crates-io]
skia-bindings = { path = "vendor/skia-safe-op/skia-bindings" }
skia-safe = { path = "vendor/skia-safe-op/skia-safe" }