Repository navigation
Description
Context
nsgo build -target harmonyos and nsgo test -target harmonyos on a machine without the OpenHarmony SDK (no hvigorw on PATH or no OHOS_BASE_SDK_HOME) package the committed host in cmd/nsgo/harmony/host/ (harmony.Package), not the templates (docs/architecture/harmonyos.md, "The host's compiled bytecode names each module ..."). That host was last rebuilt in b5925e6. Since then seven commits changed cmd/nsgo/harmony/templates without rebuilding it:
- f8ecc4a perf(harmonyos): keep one engine frame in flight
- bd1686d perf(harmonyos): clear the dirty flag of views drawn as they are made
- 39113df perf(harmonyos): sync only the parents a structural batch changed
- 0828bfd perf(harmonyos): write only the attributes a view changed
- fec3d7a fix(harmonyos): redraw rich text whose runs changed
- 99cb3e3 fix(harmonyos): move end-pinned sticky views back toward the content's start
- daf2ae3 style(sticky): unwrap the comments this change touches
The committed host/ets/modules.abc does not contain Styled, the class 0828bfd added to Index.ets, so none of these reach an app built without the SDK. #884 is in the same position for #811's text field fixes.
It also hides itself in review: a gallery test run on the emulator with only hdc on PATH shows the old host, so a change to Index.ets looks like it has no effect (that is what happened in #884's first review).
Why it matters
Most users build without DevEco, so the fixes above are merged but not shipped to them, and a reviewer checking a host change on a device sees the old behavior unless the SDK is set up.
Proposal
- Rebuild the host with
cmd/nsgo/harmony/host/build.shon a machine with the SDK the templates target (compileSdkVersion"26.0.0"), and commit it, as AGENTS.md asks for prebuilt parts. - Add a check that fails when the templates change without the host: for example, record a hash of
templates/next to the host inbuild.shand compare it in a test incmd/nsgo/harmony. - Have
nsgo test -target harmonyossay which host it packaged (compiled from the templates or the committed one), so a device check of a template change is not silently run on the old host.
Acceptance
- The committed host is built from the current templates, and a test fails when a template changes without it.
Activity
houko commentedon Nov 20, 2026
I audited #907 against the current checkout. The committed
host/is still the fallback artifact and the templates have changed since its last recorded build. The repository has nohvigorworOHOS_BASE_SDK_HOME, so I cannot truthfully regenerate and commitets/modules.abcin this environment. A hash guard without rebuilding the artifact would only add a failing check or record a false stamp. The issue remains valid and should stay open for a machine with the OpenHarmony SDK to rebuild the host and add the guard together.houko commentedon Nov 21, 2026
Another case since #1068: the HarmonyOS template now passes
info.targetTimestamptonsgoFrame(t), soRequestAnimationFramegets displaySync's frame time, but the committed host (cmd/nsgo/harmony/host/ets/modules.abc) still callsnsgoFrame()with no argument. Apps built without the HarmonyOS SDK therefore keep the engine clock (internal/platform/harmonyos/harmonyos.go:103-107falls back correctly). The docs and the roadmap row "Display frame times on devices" say so until the host is rebuilt withcmd/nsgo/harmony/host/build.sh.