You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tracking HarmonyOS NEXT support. Full scoping analysis in this comment.
Status (2026-04-21): Phase 1 PRs ready for review + a signed .so that survives dlopen on a real DevEco 6.0.1(21) wearable emulator. See the handoff comment below for the validation state and what's needed from @cavivie.
Blockers (answer before starting)
Confirm whether perry/ui is needed, or logic-only is sufficient for the reporter's use case → UI required, Phase 2 (B1 ArkTS emitter) is in scope; B2 explicitly out.
Confirm access to a Huawei dev cert + NEXT device or DevEco Studio emulator for validation → Both confirmed (@cavivie has cert + physical NEXT hardware, will validate intermediate builds).
Phase 1 — toolchain + .so/HAP bundle, no UI
Add ohos / ohos-simulator variants to Platform enum + rust_target_triple — shipped as harmonyos / harmonyos-simulator (target strings only; Platform enum deliberately not touched, see PR #121). Maps to aarch64-unknown-linux-ohos / x86_64-unknown-linux-ohos.
OpenHarmony SDK detection (env var OHOS_SDK_HOME or similar) — sysroot + llvm/bin/clang path resolution. Supports DevEco 5.x layout (~/Library/Huawei/Sdk/openharmony/<api>/native/) AND DevEco 6.x layout (/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/native/).
napi_module_register entry wrapper in perry-runtime behind ohos-napi feature flag. Module registration via .init_array; nm_modname derived at runtime via dladdr to match the actual .so filename.
Boilerplate ArkTS UIAbility shim generator that loads the .so and invokes the TS entry point. Shipped as plain TypeScript (no @Entry @Component struct) so es2abc --extension ts compiles it directly without ets-loader.
Integrate hvigor assemble + hap-sign (user-supplied cert via env var, not baked into CI) — partial: signing wired via 7 env vars (PERRY_HARMONYOS_P12/_P12_PASSWORD/_CERT/_PROFILE/_KEY_ALIAS/_KEY_PASSWORD/_SIGN_ALG) and shells out to hap-sign-tool.jar directly (skipping hvigor per design Decision 3). Not yet: DevEco encrypts its auto-signing passwords in build-profile.json5, so users with DevEco-auto-generated certs can't use these env vars directly — would need either a decryption helper or a hvigorw integration. Workaround used for v0.5.129 validation: splice Perry's .so + .ets into an existing DevEco project and let hvigor sign.
End-to-end: compile hello.ts → .hap → install via hdc → run on emulator — partial. libentry.so loads on DevEco 6.0.1(21) wearable emulator and aa start EntryAbility succeeds without throwing. Whether console.log() actually reaches hdc hilog is unverified — perry-runtime writes to stdout (println!()), which OHOS does not route into hilog by default. Likely needs a stdout→hilog shim. Path to HAP-from-perry (not DevEco splice) is blocked on the signing item above.
Hand off intermediate build to @cavivie for on-device NEXT validation (resolves KAL unknown below) — ready now. See #121 (PR A, scaffolding) + #122 (PR B, functional, stacked on PR A). The harmony-os branch has 7 commits from main representing the full Phase 1 work.
Phase 2 — TS→ArkTS emitter for perry/ui (option B1) — confirmed in scope
New perry-codegen-arkts crate mirroring perry-codegen-js/perry-codegen-wasm shape
Map perry/ui HIR widget tree → ArkTS declarative components (Column/Row/Text/Button/...)
State reactivity: bridge Perry's State<T> → ArkTS @State/@Link
Hybrid build: UI compiles to .ets, logic compiles to .so, both packaged in the same HAP
Widget parity audit against existing native UI targets
Phase 3 — deferred
Custom GL widget set on XComponent (option B2) — explicitly out for v1 per @cavivie; revisit only if B1 proves unexpectedly complex.
Open unknowns
Verify aarch64-unknown-linux-ohos binaries actually run on HarmonyOS NEXT's microkernel via KAL — confirmed on DevEco 6.0.1(21) wearable emulator (v0.5.129). Physical-device validation still outstanding.
Confirm libffi / tikv-jemalloc-sys gap doesn't hit perry-stdlib growth before/during this work — untouched; perry-stdlib cross-compiles green today, but if deps shift this could regress.
Does TS console.log() reach hdc hilog? Unverified on emulator. Physical-device test from @cavivie would confirm whether the emulator behavior (silent drop) matches devices or is emulator-specific.
DevEco auto-signing password decryption vs hvigorw integration — pick one to unblock the end-to-end perry compile → hdc install loop without requiring the DevEco-project splice.
Tracking HarmonyOS NEXT support. Full scoping analysis in this comment.
Status (2026-04-21): Phase 1 PRs ready for review + a signed .so that survives
dlopenon a real DevEco 6.0.1(21) wearable emulator. See the handoff comment below for the validation state and what's needed from @cavivie.Blockers (answer before starting)
perry/uiis needed, or logic-only is sufficient for the reporter's use case → UI required, Phase 2 (B1 ArkTS emitter) is in scope; B2 explicitly out.Phase 1 — toolchain +
.so/HAP bundle, no UIohos/ohos-simulatorvariants toPlatformenum +rust_target_triple— shipped asharmonyos/harmonyos-simulator(target strings only;Platformenum deliberately not touched, see PR #121). Maps toaarch64-unknown-linux-ohos/x86_64-unknown-linux-ohos.OHOS_SDK_HOMEor similar) — sysroot +llvm/bin/clangpath resolution. Supports DevEco 5.x layout (~/Library/Huawei/Sdk/openharmony/<api>/native/) AND DevEco 6.x layout (/Applications/DevEco-Studio.app/Contents/sdk/default/openharmony/native/).clang --target=aarch64-linux-ohos --sysroot=<sdk>/native/sysroot -D__MUSL__ -shared -fPIC -Wl,-Bsymbolic -Wl,--warn-unresolved-symbols -lace_napi.z -lc -lm -lpthread -ldl..sooutput mode —--target harmonyosauto-selectslib<stem>.so.napi_module_registerentry wrapper inperry-runtimebehindohos-napifeature flag. Module registration via.init_array;nm_modnamederived at runtime viadladdrto match the actual.sofilename.UIAbilityshim generator that loads the.soand invokes the TS entry point. Shipped as plain TypeScript (no@Entry @Component struct) soes2abc --extension tscompiles it directly without ets-loader.module.json5,ets/(compiledmodules.abc),libs/arm64-v8a/*.so, resources (resources/base/{media,string,color}/).hvigorassemble +hap-sign(user-supplied cert via env var, not baked into CI) — partial: signing wired via 7 env vars (PERRY_HARMONYOS_P12/_P12_PASSWORD/_CERT/_PROFILE/_KEY_ALIAS/_KEY_PASSWORD/_SIGN_ALG) and shells out tohap-sign-tool.jardirectly (skippinghvigorper design Decision 3). Not yet: DevEco encrypts its auto-signing passwords inbuild-profile.json5, so users with DevEco-auto-generated certs can't use these env vars directly — would need either a decryption helper or ahvigorwintegration. Workaround used for v0.5.129 validation: splice Perry's.so+.etsinto an existing DevEco project and let hvigor sign.hello.ts→.hap→ install viahdc→ run on emulator — partial.libentry.soloads on DevEco 6.0.1(21) wearable emulator andaa start EntryAbilitysucceeds without throwing. Whetherconsole.log()actually reacheshdc hilogis unverified — perry-runtime writes to stdout (println!()), which OHOS does not route into hilog by default. Likely needs a stdout→hilog shim. Path to HAP-from-perry (not DevEco splice) is blocked on the signing item above.harmony-osbranch has 7 commits frommainrepresenting the full Phase 1 work.Phase 2 — TS→ArkTS emitter for
perry/ui(option B1) — confirmed in scopeperry-codegen-arktscrate mirroringperry-codegen-js/perry-codegen-wasmshapeperry/uiHIR widget tree → ArkTS declarative components (Column/Row/Text/Button/...)State<T>→ ArkTS@State/@Link.ets, logic compiles to.so, both packaged in the same HAPPhase 3 — deferred
XComponent(option B2) — explicitly out for v1 per @cavivie; revisit only if B1 proves unexpectedly complex.Open unknowns
aarch64-unknown-linux-ohosbinaries actually run on HarmonyOS NEXT's microkernel via KAL — confirmed on DevEco 6.0.1(21) wearable emulator (v0.5.129). Physical-device validation still outstanding.libffi/tikv-jemalloc-sysgap doesn't hit perry-stdlib growth before/during this work — untouched; perry-stdlib cross-compiles green today, but if deps shift this could regress.console.log()reachhdc hilog? Unverified on emulator. Physical-device test from @cavivie would confirm whether the emulator behavior (silent drop) matches devices or is emulator-specific.perry compile→hdc installloop without requiring the DevEco-project splice.