Skip to content

fix(deploy): ship vendored crate patches in market image contexts - #3810

Merged
bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:fix/market-image-build-context
Nov 8, 2026
Merged

bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:fix/market-image-build-context

Conversation

@bobleer

@bobleer bobleer commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

问题

从干净 checkout 构建 miniapp-market / skin-market 镜像会直接失败:

error: failed to load source for dependency `tao`
Caused by: unable to update /build/third_party/tao
Caused by: failed to read `/build/third_party/tao/Cargo.toml`

根因

根 Cargo.toml 的 [patch.crates-io] 把 tao 和 wry 指向仓库内的 third_party/ 路径。Cargo 在解析 workspace 时就会读取这些 path 依赖的 manifest,哪怕本次只构建某个 service crate、根本不编译它们。

但两个市场的 Dockerfile 只 COPY third_party/eioc/,per-Dockerfile 的 .dockerignore 也只放行 eioc。tao/wry 是 2026-10-10 引入的(3e9cdc5ed),Dockerfile 没跟上,所以这两个镜像的构建路径从那时起就是坏的。

改动

  • src/apps/{miniapp,skin}-market-server/Dockerfile:补 COPY third_party/tao/、COPY third_party/wry/
  • 对应的 Dockerfile.dockerignore:放行这两个目录
  • 新增 scripts/market/market-image-context.test.mjs + CI step:这些 ignore 文件是手写白名单,测试保证
    • [patch.crates-io] 里每个 path 依赖都有 COPY 且被放行
    • Dockerfile 里每个 third_party/* COPY 源都被放行
    • product-domains 用 include_str! 引用的 ppt-live/dist/ui.bundle.js 不会被 **/dist 规则剪掉

验证

从仓库根用官方路径各构建一次,均成功:

docker build -f src/apps/miniapp-market-server/Dockerfile .
docker build -f src/apps/skin-market-server/Dockerfile .

新测试在删掉一行 ignore 规则时会失败(已反向验证),node --test scripts/market/*.test.mjs 三条全过。

The root manifest patches `tao` and `wry` to in-tree paths, and Cargo resolves
every `[patch.crates-io]` entry from the workspace root even for a service-only
build. The miniapp and skin Dockerfiles only copied `third_party/eioc`, so a
clean checkout failed with:

    error: failed to load source for dependency `tao`
    Caused by: unable to update /build/third_party/tao

Copy both vendored engines and allowlist them in the per-Dockerfile ignore
files. Because those ignore files are hand-maintained whitelists, add a
contract test that keeps `[patch.crates-io]` paths, third_party COPY sources
and the committed `ppt-live` bundle in sync with the build context.

Verified by building both images from the repository root.
@bobleer
bobleer merged commit 6a9de43 into openBitFun:main Nov 8, 2026
14 checks passed
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.

1 participant