Skip to content

fix(ci): post-migration CI repairs for the Bun switch - #5

Merged
7723qqq merged 29 commits into
mainfrom
feat/bun-package-manager
Aug 24, 2026
Merged

fix(ci): post-migration CI repairs for the Bun switch#5
7723qqq merged 29 commits into
mainfrom
feat/bun-package-manager

Conversation

@7723qqq

@7723qqq 7723qqq commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Related Issue

Follow-up to #4(已合并)。合并后首轮 main CI 暴露了三个问题,本 PR 修复。

Problem

#4 合并后 CI(main @ d48a7f6)三处红:

  1. buildbun run --workspaces 的运行期枚举不尊重负向 glob,把 !apps/kimi-web 排除的 kimi-web 也拉进构建(它依赖未安装,vite config 加载失败)。本地能过是因为历史 node_modules 有残留包。
  2. lint:sherif 的 root-package-manager-field 规则要求 packageManager 字段,build: migrate the package manager from pnpm to Bun #4 把它删了。
  3. nix-build:bunDeps FOD 占位哈希 + 一处属性路径笔误。

注:test 分片的失败(kimi-native-tools 加载错误 ×282)在 #4 之前的 pnpm 时代 main 上就存在——CI 从未有 Rust 构建步骤,属既有问题,不在本 PR 范围。

What changed

  • 根 build 改为显式正向 filter 列表(含全部成员、排除 kimi-web),绕开枚举器差异
  • "packageManager": "bun@1.4.0" 恢复(sherif 要求;同时准确声明工具链)
  • flake.nix:lib.fetchers.proxyImpureEnvVars 属性路径修正;回填 nix-build bot 报告的真实 bunDeps 哈希
  • .gitignore 兜底:pnpm 自动安装可能在本机复活的两个遗留文件不再可能被误提交

验证

  • 本地:过滤后全仓构建 exit=0 且输出零 kimi-web、五个应用目标齐全;bun run sherif 无告警
  • nix 哈希来自 bot 在同内容树上实测的 got 值

Checklist

  • I have read the CONTRIBUTING document.
  • Tests: 行为变更处已有覆盖(release-artifacts 用例);本 PR 为 CI/构建修复。
  • No changeset needed (not user-perceivable).

luozihao added 3 commits August 24, 2026 23:47
…build

- sherif's root-package-manager-field rule requires packageManager;
  set it to bun@1.4.0
- bun run --workspaces enumerates negative-glob-excluded members at
  runtime (install respects them, the script runner does not), which
  made CI attempt kimi-web's vite build without its dependencies;
  switch the root build to explicit positive filters
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown

❌ Nix build failed

Hash mismatch in bunDeps:

Hash
specified sha256-Ktv53GfKGM7DyP4JyIdK1Uc3c5zAl+42nQgZq1JZk8Q=
got sha256-0wX/SdkBkTWRI0F8imC+RpSmZTEB/9RCe2qlhiztnK4=

Please update flake.nix with the got hash.

luozihao added 26 commits August 25, 2026 00:16
…shards

- bun's internal cache dir is nondeterministic (gzip mtimes plus
  variable extracted-dir presence), so the FOD now materializes the
  project node_modules tree instead; the main derivation copies it in
  and runs the needed lifecycle scripts via 'bun pm trust' with
  node-gyp pointed at the pinned Node headers
- ci.yml test shards build kimi-native-tools (Rust) before running:
  the shards have been failing on main since before the migration
  because CI never built the native addon (282 load errors per shard)
- fill in the real bunDeps hash reported by the nix-build bot
The cd+relative traversal inside execSync resolved one level short in
the Nix sandbox (/build/source/apps/node_modules); use the absolute
vite entry with argv-form execFileSync and cwd=vis-web instead
The Nix build has been failing since before the migration at the SEA
asset collector: it requires a built .node for kimi-native-tools, and
nothing in the sandbox compiled it. Add cargo/rustc and run the napi
build ahead of the SEA steps.
The main derivation has no network, so napi/cargo could not fetch
crates from crates.io. cargo vendor now runs inside the bunDeps FOD
alongside the npm install; the main derivation wires the vendored dir
plus its config into packages/kimi-native-tools/.cargo and sets
CARGO_NET_OFFLINE=true.
npx resolves package.json overrides as install specs and aborts with
EINVALIDTAGNAME on parent>child keys; bunx runs the local lint-staged
without touching the registry.
GET /api/v1/tools without session_id resolves the globally most recent
session; concurrent test files create newer sessions on shared shards,
so the projection could read another agent's registry.
…fileOps

DI warns per unregistered dependency on every createInstance, which
flooded the profileOps suite stderr with seven repeated warnings per
case. The paths under test never call into them; register no-op
stubs to silence the noise.
The SEA asset collector requires a built .node for both napi packages;
vendor kimi-agent's crates alongside kimi-native-tools and compile it
offline in the sandbox.
The branch ruleset requires code scanning results (CodeQL, medium+
security alerts) for merges into main; this workflow produces them on
PRs, pushes to main, and a weekly schedule.
@7723qqq
7723qqq merged commit 6fb4f31 into main Aug 24, 2026
16 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