core: Add HarmonyOS platform#4315
Conversation
# Conflicts: # src/mbgl/vulkan/renderable_resource.cpp
|
And I've now swapped out the http file source implementation, and therefore dropped the dependency on the proprietary HarmonyOS SDK. Since we now build with the OpenHarmony SDK only, I added a CI workflow (untested). Switching to Still works great on HarmonyOS. It should now be compatible with Oniro as well, but I haven't actually tested with the Oniro emulator; I'll look into that later. |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa4bb353f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 264dc5acce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
latest change: migrated the sample from the legacy ArkTS-created XComponent setup to the newer native-owned component setup recommended by the platform docs. |
Resolves #3749
Summary
This branch adds support for OpenHarmony (OHOS) and HarmonyOS (HMOS). HMOS is Huawei's commercial OS competing with Android and iOS in China. OHOS is an open source project, making up the core of HMOS and other projects like Oniro.
I've only tested this on HarmonyOS, but since I've stuck to OHOS SDK only, it should work similarly on Oniro too.
Platform
I used existing
platform/defaultsources for most components like storage, text, i18n. The OHOS-specific components include:logging_hilog.cppmaps MapLibre logging to OHOS hilogimage.cpp: decodes platform images through OHOS image APIshttp_file_source.cpp: implements MapLibre HTTP requests through OHOSlibnet_http.so.Core
I also needed to make a few changes to the core. I carved these out into #4317, #4318, #4319, #4320; see those PRs for details.
Validation
The branch also includes a sample app, bridging a minimal set of APIs to ArkTS and using them in a live interactive map with the MapLibre demo style, OFM Bright, and OFM Liberty.
The sample app is validated on real hardware, a Huawei MatePad Pro MRDI-W00 running HarmonyOS 6.1.0.117, with both Vulkan and OpenGL. The emulator doesn't yet support Vulkan—an upcoming beta release (that I couldn't figure out how to acquire) will but works with OpenGL after the stencil clip-mask workaround mentioned above.
I've also configured CI, using the OHOS SDK from https://github.com/openharmony-rs/ohos-sdk/releases. I'm only building the MapLibre Native library right now in CI, not running any tests, nor building the sample app.
I didn't run iOS/Android/other builds or tests locally, as I assume they're covered in CI.
Process
I used GPT-5.5 in Codex CLI to put together this PR.
If you'd like to inspect the process, I'd recommend checking
ohos-research.md(removed from the draft in 9173b3e) in the commit history, where my agent kept a work log of everything it was doing during the autonomous and pairing phases.Demo
SVID_20260531_131211_1.mp4