Skip to content

Use cargo-ohos to build for OpenHarmony with LLVM-19 - #796

Merged
jschwe merged 3 commits into
servo:mainfrom
jschwe:update_ohos_build
Aug 24, 2026
Merged

jschwe merged 3 commits into
servo:mainfrom
jschwe:update_ohos_build

Conversation

@jschwe

@jschwe jschwe commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

In preparation for the upcoming ESR-153, switch to using cargo-ohos instead of our custom script.
Supporting a non-SDK LLVM ends up being quite a bit more complex, and needing to duplicate that logic across every project that needs to build for ohos doesn't make sense. Hence, use cargo-ohos to wrap all the environment variables, and toolchain downloading etc. for an openharmony build.

Testing: Covered by existing tests in servo
Servo PR: servo/servo#47421

@sagudev

sagudev commented Aug 15, 2026

Copy link
Copy Markdown
Member

BTW Rust 1.88 (so the MSRV) uses clang 20, because I know you are interested in LTO.

For android it might also make sense to switch to cargo-ndk, instead of rolling our own script, but thats another topic.

Yeah, I am not sure why did not try that in the first place.

@jschwe

jschwe commented Aug 15, 2026

Copy link
Copy Markdown
Member Author

BTW Rust 1.88 (so the MSRV) uses clang 20, because I know you are interested in LTO.

I'm going with clang-19 for now mainly because that's an official prebuilt "preview" version I found. It seems like compiling clang-20 from source with ohos support also works, so I might build / host that myself after some more investigation.

@jschwe
jschwe force-pushed the update_ohos_build branch 3 times, most recently from ddd558e to d75f406 Compare August 21, 2026 15:48
@jschwe
jschwe marked this pull request as ready for review August 21, 2026 17:12
Comment thread .github/workflows/build.yml Resolved
Comment thread .github/workflows/build.yml Resolved
jschwe added 3 commits August 23, 2026 09:31
In preparation for the upcoming ESR-153, switch to using
`cargo-ohos` instead of our custom script.
Supporting a non-SDK LLVM ends up being quite a bit more complex,
and needing to duplicate that logic across every project that needs
to build for ohos doesn't make sense. Hence, use cargo-ohos to
wrap all the environment variables, and toolchain downloading etc.
for an openharmony build.

For android it might also make sense to switch to cargo-ndk, instead
of rolling our own script, but thats another topic.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe
jschwe force-pushed the update_ohos_build branch from d75f406 to fc6dccf Compare August 23, 2026 07:32
@sagudev

sagudev commented Aug 23, 2026

Copy link
Copy Markdown
Member

Any reason for not landing this yet?

@jschwe

jschwe commented Aug 23, 2026 •

Copy link
Copy Markdown
Member Author

The companion PR isn't approved yet, and ideally both should land at the same time (since the precompiled artifact with clang-19 wouldn't work with servo-main as of now).

@jschwe
jschwe merged commit 95cacf6 into servo:main Aug 24, 2026
46 checks passed
@jschwe
jschwe deleted the update_ohos_build branch August 24, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants