| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
more tests through kh2 on CI Moves the host tests of CI onto kh2: one test:kh2 job (npx kh2 -j 6 test smoke check) replaces the per-package test jobs, and the OHOS/Android natives build through kh2 too. The plan and its four stages are in docs/second-brain/40_Development_Workflow/CI_kh2_Migration.md. ## Stages 1. **Package suites through kh2 only.** ArktsxPackage gains test.launcher (http-client's WebSocket server through with-server.mjs) and test.checks (abc-opt test:node, deal-ui protocol tables, assembler check:tables). The 43 duplicate test:<pkg> jobs are gone. 2. **Smokes, checks and bundles.** smoke-<name> (headless app runs), check-<name> (node tools, lints, the vault, the SDK CLI tests), bundle-<name> (linux bundles), all requested on demand, so a plain kh2 <pkg> builds none of them. 3. **Only the downloads are cached between pipelines.** test:kh2 builds the checkout from scratch and caches the npm cache and the apm package cache (.arkts_cache/). The stage first cached the kh2 state (.kh/ and the trees its records describe); that was dropped, see below. 4. **OHOS and Android natives.** compile:native:ohos-arm64 / compile:native:android-arm64 (the slices each hook/build.yml promises) and compile:ohos (arkts build --platform ohos) replace the npm --workspaces scripts and the four canary jobs. Each stage has a review-fix commit after it. ## On top of the stages - **Input lists named by role.** *Inputs are keyed inputs, *Barrier order-only ones. ArktsxPackage's arktsDeps becomes buildInputs; the test options split into inputs (this package's tests) and globalBarrier (what every launch waits for). PackageTest(…, buildInputs, globalTestBarrier, selfTestInputs, …); TestBuilds becomes GlobalTestBarrier. - **A timeout on every package test launch.** 10 minutes by default, test.timeoutMs per package. haus2 Exec/runProcess gain timeoutMs: past it the process group is terminated and the rule fails with CommandTimedOut. The hang it guards against is a race in the runtime's MarkableQueue.clear(), fixed in koala_projects!26. - **The web platform suites as checks.** Master added node --test platforms/web/ to the npm test:all of seven packages. WebPlatformCheck() runs them under kh2: in test-<name> for curl, device, http-client, interop and webview; as check-camera / check-haptics for the packages without arkts suites, replacing their CI jobs. - **CI: no kh2 state cache, -j 6.** The first CI runs of this PR showed why a cached kh2 state is fragile: the meson setups' get_prebuilt.mjs writes arktsx/*/subprojects/*/prebuilt/, which the cached tree list missed, so the restored setups stayed up to date without their prebuilts and curl, cv and graphics compiled without their headers. Such a state fails every later run until the key changes, for every branch. Only the downloads are cached now. The pod has a 4-CPU quota: at -j 10, the first ui-measure cases ran past their 90 s timeout next to the suites, so the job runs -j 6. ## Rebased onto master 3cdf4f99d - haus2 rule descriptions are now DescribeRule content, not a description option; every rule this branch adds is converted. - Master's test.tags (usb's tagged hooks) is merged with launcher, timeoutMs and the renamed input lists. ## Verification Locally, npx kh2 -j 10 test smoke check on the rebased branch: 795/795 rules pass, exit 0. haus2 widgets tests 144/144. CI, the first cold run (-j 10): the kh2 part took about 9 minutes, every rule but ui-measure passed (see above). 🤖 Generated with [Claude Code](https://claude.com/claude-code) | 10 天前 | |
i18n: closed-set keys become a generated enum, looked up by index Profiling the pay-app showed the localization path is hot during recomposition: LocalizedStrings.lookup dispatches a UI-copy key through a string switch and, on a miss, falls through several catalogue tables, so each lookup hashes and string-compares repeatedly before returning a literal that must then be re-resolved. It showed up as StringTable::GetStringFast and EtsStringEquals in the call stacks under tr(). Split the catalogue by its two populations. UI copy is a closed set, so it becomes a generated PayKey/DemoKey enum with index-aligned per-language arrays resolved by an integer id; open-ended backend content keeps the string path. The framework gains lookupId / LocalizedIdKey / trId alongside lookup / LocalizedStringKey / tr, so the data path and the non-memo callers are untouched. The enum and the arrays are generated from i18n/src/<lang>/*.json by arktsx/scripts/i18n-gen.mjs, shared by pay-app and demo; the CI generate job runs it so the gitignored output exists for every consumer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 16 天前 | |
setup: one registry source, a host preflight, and the libc++ gap ## Problem Standing up arkui3 on a fresh Ubuntu host cost three failed build cycles, each for a reason the repository did not tell you: | Symptom | Cause | |---|---| | ETARGET: No matching version found for @idlizer/core@2.2.2 | npm was never told where the internal scopes live. The list existed only in gitlab/setup.yml, which no developer reads, and it was stale. | | No clang on PATH, then fatal error: 'cassert' file not found | The compiler and its libc++ headers are separate packages, documented nowhere; the failure names no package. | | package config … not found. Run "apm install" first | host:prepare ran arkts tool hooks before anything wrote the package graph. | The internal registry is a public internet service — no office network is required. The Chinese mirror appears only as an optional speed-up. ## What changed - **One registry list** in scripts/registries.mjs, as data only: scope → registry, the package each scope's pinned version comes from, and the optional mirror. CI applies it (gitlab/setup.yml's .npm block is one --apply --ci-default call), developers print the block (npm run registries), and --ci shows the exact lines for diffing. There is no separate manifest guard: a manifest that starts using a new scope fails install:root on the same PR with an ETARGET naming the package. - **npm run preflight:host** — checks the machine, not build state: Node, clang, whether that clang can compile against libc++, fontconfig, and whether the **pinned version** of one package from each internal scope resolves through npm (npm view <pkg>@<version> version, from the repo root, so user/project .npmrc, proxies and auth apply). E404, E401/E403 and the network codes get distinct hints. It needs the network for the scope check. - **libc++ probe in the native build** — a syntax-only compile in arktsx/scripts/cross/executables.mjs, used by platforms/linux.mjs, so the failure names libc++-dev libc++abi-dev instead of 'cassert' file not found. - **host:prepare sequencing** — apm:install runs before compile:native and host:hooks. - **Docs** — Setup Guide (prerequisites, registry, clone settings, kh2-era setup), TOOLCHAIN (the two preflights), CI/CD, Build System, macOS Support, A2UI Server, README, CLAUDE.md. ## Verification - preflight:host passes on macOS: all three pinned versions resolve. With npm_config_userconfig=/dev/null (an unconfigured machine) all three fail with E404 and the registry hint. - The pinned-version probe is deliberate: @idlizer/core has public dist-tags, but 2.2.2 is 404 on npmjs, so a dist-tags probe would pass on exactly the machine where the install fails. - node scripts/registries.mjs --ci reproduces the old eight lines exactly; --print emits the same five scopes. - docs/second-brain/check_vault.py: 0 broken, 0 ghosts, 0 spaced, 0 root. - Branch is rebased onto master (kh2 setup, run bundles, no .packages) and has merged the master commits that landed since (Panda 1.20.0, Windows app bundles); git merge-tree against origin/master is clean. - Not run here: npm install, test:panda, builds — no node_modules in the worktree; CI covers them. ## Review notes This revision applies the review's simplification: registries.mjs drops the manifest analysis and is configuration only; the preflight drops the apm/package-config checks and the separate --network step, and merges the registry checks into one resolution probe. CI keeps delegating gitlab/setup.yml's .npm block to --apply. | 11 天前 | |
more tests through kh2 on CI Moves the host tests of CI onto kh2: one test:kh2 job (npx kh2 -j 6 test smoke check) replaces the per-package test jobs, and the OHOS/Android natives build through kh2 too. The plan and its four stages are in docs/second-brain/40_Development_Workflow/CI_kh2_Migration.md. ## Stages 1. **Package suites through kh2 only.** ArktsxPackage gains test.launcher (http-client's WebSocket server through with-server.mjs) and test.checks (abc-opt test:node, deal-ui protocol tables, assembler check:tables). The 43 duplicate test:<pkg> jobs are gone. 2. **Smokes, checks and bundles.** smoke-<name> (headless app runs), check-<name> (node tools, lints, the vault, the SDK CLI tests), bundle-<name> (linux bundles), all requested on demand, so a plain kh2 <pkg> builds none of them. 3. **Only the downloads are cached between pipelines.** test:kh2 builds the checkout from scratch and caches the npm cache and the apm package cache (.arkts_cache/). The stage first cached the kh2 state (.kh/ and the trees its records describe); that was dropped, see below. 4. **OHOS and Android natives.** compile:native:ohos-arm64 / compile:native:android-arm64 (the slices each hook/build.yml promises) and compile:ohos (arkts build --platform ohos) replace the npm --workspaces scripts and the four canary jobs. Each stage has a review-fix commit after it. ## On top of the stages - **Input lists named by role.** *Inputs are keyed inputs, *Barrier order-only ones. ArktsxPackage's arktsDeps becomes buildInputs; the test options split into inputs (this package's tests) and globalBarrier (what every launch waits for). PackageTest(…, buildInputs, globalTestBarrier, selfTestInputs, …); TestBuilds becomes GlobalTestBarrier. - **A timeout on every package test launch.** 10 minutes by default, test.timeoutMs per package. haus2 Exec/runProcess gain timeoutMs: past it the process group is terminated and the rule fails with CommandTimedOut. The hang it guards against is a race in the runtime's MarkableQueue.clear(), fixed in koala_projects!26. - **The web platform suites as checks.** Master added node --test platforms/web/ to the npm test:all of seven packages. WebPlatformCheck() runs them under kh2: in test-<name> for curl, device, http-client, interop and webview; as check-camera / check-haptics for the packages without arkts suites, replacing their CI jobs. - **CI: no kh2 state cache, -j 6.** The first CI runs of this PR showed why a cached kh2 state is fragile: the meson setups' get_prebuilt.mjs writes arktsx/*/subprojects/*/prebuilt/, which the cached tree list missed, so the restored setups stayed up to date without their prebuilts and curl, cv and graphics compiled without their headers. Such a state fails every later run until the key changes, for every branch. Only the downloads are cached now. The pod has a 4-CPU quota: at -j 10, the first ui-measure cases ran past their 90 s timeout next to the suites, so the job runs -j 6. ## Rebased onto master 3cdf4f99d - haus2 rule descriptions are now DescribeRule content, not a description option; every rule this branch adds is converted. - Master's test.tags (usb's tagged hooks) is merged with launcher, timeoutMs and the renamed input lists. ## Verification Locally, npx kh2 -j 10 test smoke check on the rebased branch: 795/795 rules pass, exit 0. haus2 widgets tests 144/144. CI, the first cold run (-j 10): the kh2 part took about 9 minutes, every rule but ui-measure passed (see above). 🤖 Generated with [Claude Code](https://claude.com/claude-code) | 10 天前 | |
setup: one registry source, a host preflight, and the libc++ gap ## Problem Standing up arkui3 on a fresh Ubuntu host cost three failed build cycles, each for a reason the repository did not tell you: | Symptom | Cause | |---|---| | ETARGET: No matching version found for @idlizer/core@2.2.2 | npm was never told where the internal scopes live. The list existed only in gitlab/setup.yml, which no developer reads, and it was stale. | | No clang on PATH, then fatal error: 'cassert' file not found | The compiler and its libc++ headers are separate packages, documented nowhere; the failure names no package. | | package config … not found. Run "apm install" first | host:prepare ran arkts tool hooks before anything wrote the package graph. | The internal registry is a public internet service — no office network is required. The Chinese mirror appears only as an optional speed-up. ## What changed - **One registry list** in scripts/registries.mjs, as data only: scope → registry, the package each scope's pinned version comes from, and the optional mirror. CI applies it (gitlab/setup.yml's .npm block is one --apply --ci-default call), developers print the block (npm run registries), and --ci shows the exact lines for diffing. There is no separate manifest guard: a manifest that starts using a new scope fails install:root on the same PR with an ETARGET naming the package. - **npm run preflight:host** — checks the machine, not build state: Node, clang, whether that clang can compile against libc++, fontconfig, and whether the **pinned version** of one package from each internal scope resolves through npm (npm view <pkg>@<version> version, from the repo root, so user/project .npmrc, proxies and auth apply). E404, E401/E403 and the network codes get distinct hints. It needs the network for the scope check. - **libc++ probe in the native build** — a syntax-only compile in arktsx/scripts/cross/executables.mjs, used by platforms/linux.mjs, so the failure names libc++-dev libc++abi-dev instead of 'cassert' file not found. - **host:prepare sequencing** — apm:install runs before compile:native and host:hooks. - **Docs** — Setup Guide (prerequisites, registry, clone settings, kh2-era setup), TOOLCHAIN (the two preflights), CI/CD, Build System, macOS Support, A2UI Server, README, CLAUDE.md. ## Verification - preflight:host passes on macOS: all three pinned versions resolve. With npm_config_userconfig=/dev/null (an unconfigured machine) all three fail with E404 and the registry hint. - The pinned-version probe is deliberate: @idlizer/core has public dist-tags, but 2.2.2 is 404 on npmjs, so a dist-tags probe would pass on exactly the machine where the install fails. - node scripts/registries.mjs --ci reproduces the old eight lines exactly; --print emits the same five scopes. - docs/second-brain/check_vault.py: 0 broken, 0 ghosts, 0 spaced, 0 root. - Branch is rebased onto master (kh2 setup, run bundles, no .packages) and has merged the master commits that landed since (Panda 1.20.0, Windows app bundles); git merge-tree against origin/master is clean. - Not run here: npm install, test:panda, builds — no node_modules in the worktree; CI covers them. ## Review notes This revision applies the review's simplification: registries.mjs drops the manifest analysis and is configuration only; the preflight drops the apm/package-config checks and the separate --network step, and merges the registry checks into one resolution probe. CI keeps delegating gitlab/setup.yml's .npm block to --apply. | 11 天前 | |
Improve arkui3-sdk build configuration Improve arkui3-sdk build configuration | 20 天前 | |
more tests through kh2 on CI Moves the host tests of CI onto kh2: one test:kh2 job (npx kh2 -j 6 test smoke check) replaces the per-package test jobs, and the OHOS/Android natives build through kh2 too. The plan and its four stages are in docs/second-brain/40_Development_Workflow/CI_kh2_Migration.md. ## Stages 1. **Package suites through kh2 only.** ArktsxPackage gains test.launcher (http-client's WebSocket server through with-server.mjs) and test.checks (abc-opt test:node, deal-ui protocol tables, assembler check:tables). The 43 duplicate test:<pkg> jobs are gone. 2. **Smokes, checks and bundles.** smoke-<name> (headless app runs), check-<name> (node tools, lints, the vault, the SDK CLI tests), bundle-<name> (linux bundles), all requested on demand, so a plain kh2 <pkg> builds none of them. 3. **Only the downloads are cached between pipelines.** test:kh2 builds the checkout from scratch and caches the npm cache and the apm package cache (.arkts_cache/). The stage first cached the kh2 state (.kh/ and the trees its records describe); that was dropped, see below. 4. **OHOS and Android natives.** compile:native:ohos-arm64 / compile:native:android-arm64 (the slices each hook/build.yml promises) and compile:ohos (arkts build --platform ohos) replace the npm --workspaces scripts and the four canary jobs. Each stage has a review-fix commit after it. ## On top of the stages - **Input lists named by role.** *Inputs are keyed inputs, *Barrier order-only ones. ArktsxPackage's arktsDeps becomes buildInputs; the test options split into inputs (this package's tests) and globalBarrier (what every launch waits for). PackageTest(…, buildInputs, globalTestBarrier, selfTestInputs, …); TestBuilds becomes GlobalTestBarrier. - **A timeout on every package test launch.** 10 minutes by default, test.timeoutMs per package. haus2 Exec/runProcess gain timeoutMs: past it the process group is terminated and the rule fails with CommandTimedOut. The hang it guards against is a race in the runtime's MarkableQueue.clear(), fixed in koala_projects!26. - **The web platform suites as checks.** Master added node --test platforms/web/ to the npm test:all of seven packages. WebPlatformCheck() runs them under kh2: in test-<name> for curl, device, http-client, interop and webview; as check-camera / check-haptics for the packages without arkts suites, replacing their CI jobs. - **CI: no kh2 state cache, -j 6.** The first CI runs of this PR showed why a cached kh2 state is fragile: the meson setups' get_prebuilt.mjs writes arktsx/*/subprojects/*/prebuilt/, which the cached tree list missed, so the restored setups stayed up to date without their prebuilts and curl, cv and graphics compiled without their headers. Such a state fails every later run until the key changes, for every branch. Only the downloads are cached now. The pod has a 4-CPU quota: at -j 10, the first ui-measure cases ran past their 90 s timeout next to the suites, so the job runs -j 6. ## Rebased onto master 3cdf4f99d - haus2 rule descriptions are now DescribeRule content, not a description option; every rule this branch adds is converted. - Master's test.tags (usb's tagged hooks) is merged with launcher, timeoutMs and the renamed input lists. ## Verification Locally, npx kh2 -j 10 test smoke check on the rebased branch: 795/795 rules pass, exit 0. haus2 widgets tests 144/144. CI, the first cold run (-j 10): the kh2 part took about 9 minutes, every rule but ui-measure passed (see above). 🤖 Generated with [Claude Code](https://claude.com/claude-code) | 10 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 10 天前 | ||
| 16 天前 | ||
| 11 天前 | ||
| 10 天前 | ||
| 11 天前 | ||
| 20 天前 | ||
| 10 天前 |