已开启
kh2: one toolchain probe per target, and an honest failure #263
Konstantin Chukharev创建于 7 天前
kh2: one toolchain probe per target, and an honest failure #263
已开启
Konstantin Chukharev创建于 7 天前
Konstantin Chukharev
Konstantin Chukharev成员
7 天前

This PR makes kh2 probe a cross toolchain once per target, fail when it is missing, and stops the npm driver from downloading a prebuilt.

Problem

A compile could report success while nothing was built.
Each package declared its own machine file, so one cross goal ran the same probe once per package (16 for compile:native:android-arm64), and a missing toolchain was recorded as a <target>.unavailable marker: a rule declaring an output it never produces.
build-native.mjs then installed a published prebuilt into prebuilts/<target>/, so a source build and a fetched artifact were indistinguishable.

Solution

  • kh/cross-file.mjs exits 1 with the generator's reason and removes a stale .ini; the npm driver skips the target instead of downloading.
  • One probe rule per target at .kh/output/probe/<target>.ini, declared once by the root kh.build.ts; ArktsxNative orders it and declares Meson afterwards.
  • kh/cross-file.test.mjs pins that contract, run by check-cross-file in test:tools.
  • Docs, MIGRATION_PLAN.md and the two CI job comments follow.

Verification

check result
npx kh2 -t graph 3 probe rules, one per target
npx kh2 compile:native 526/526, exit 0, one probe step
npx kh2 compile:native:ohos-arm64 421/421, exit 0, one probe step
npx kh2 compile:native:android-arm64, no NDK exit 1, Cannot find the Android NDK
npx kh2 check-cross-file 2/2, and the second fails when the script stops exiting 1
npx kh2 test:tools 610/614; the one failure is test (arktsx/sdk/cli), which fails identically on master

Notes

  • A requested cross goal now fails on a missing toolchain; scripts/prebuilt.mjs stays the explicit way to install a published module.
  • A failed probe still prints a build is stuck dump of its dependents: right exit code, confusing report, haus2 follow-up.
likedislike
合并受阻
Konstantin ChukharevKonstantin Chukharev成员
7 天前 强制推送  6 个提交:3325b8fd-3 commits from branch rri_opensource/arkui3:master,547231e7-kh2: settle the machine-file probe on a status output,5988e950-kh2: install published prebuilts when a toolchain is missing,92e13dcd-kh2: document the probe status contract
此处折叠了7条事件消息 查看更多
Konstantin ChukharevKonstantin Chukharev成员
7 天前 强制推送  4 个提交:b3a8f236-1 commit from branch rri_opensource/arkui3:master,a4749126-kh2: fail when a native target's toolchain is unavailable,243349ed-build: require ARKTSX_PREBUILT for the prebuilt fallback,050b5651-kh2: probe each target once instead of once per package
pavelmironchik
pavelmironchik成员
7 天前 评论:
pavelmironchik
pavelmironchik成员
7 天前 评论:
pavelmironchikpavelmironchik成员
7 天前 重置了测试状态
Konstantin ChukharevKonstantin Chukharev成员
7 天前 强制推送  6 个提交:f16619d8-3 commits from branch rri_opensource/arkui3:master,97cc5c52-kh2: fail when a native target's toolchain is unavailable,90b173fc-build: require ARKTSX_PREBUILT for the prebuilt fallback,b754e05d-kh2: probe each target once instead of once per package
Konstantin ChukharevKonstantin Chukharev成员
7 天前 修改了pull request 的描述
pavelmironchik
pavelmironchik成员
7 天前 评论:
pavelmironchik
pavelmironchik成员
7 天前 评论:
pavelmironchikpavelmironchik成员
7 天前 重置了测试状态
此处折叠了14条事件消息 查看更多
Konstantin ChukharevKonstantin Chukharev成员
10 小时前 修改了pull request 的描述
pavelmironchik
pavelmironchik成员
10 小时前 评论:
pavelmironchik
pavelmironchik成员
9 小时前 评论:
pavelmironchikpavelmironchik成员
9 小时前 重置了测试状态