Skip to content

HarmonyOS: the committed host is older than its templates #907

Closed

Description

@houko

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.sh on 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 in build.sh and compare it in a test in cmd/nsgo/harmony.
  • Have nsgo test -target harmonyos say 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

  1. self-assigned this
    on Nov 20, 2026
  2. houko commented on Nov 20, 2026

    @houko
    CollaboratorAuthor

    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 no hvigorw or OHOS_BASE_SDK_HOME, so I cannot truthfully regenerate and commit ets/modules.abc in 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.

  3. houko commented on Nov 21, 2026

    @houko
    CollaboratorAuthor

    Another case since #1068: the HarmonyOS template now passes info.targetTimestamp to nsgoFrame(t), so RequestAnimationFrame gets displaySync's frame time, but the committed host (cmd/nsgo/harmony/host/ets/modules.abc) still calls nsgoFrame() with no argument. Apps built without the HarmonyOS SDK therefore keep the engine clock (internal/platform/harmonyos/harmonyos.go:103-107 falls back correctly). The docs and the roadmap row "Display frame times on devices" say so until the host is rebuilt with cmd/nsgo/harmony/host/build.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions