Skip to content

Add an OpenHarmony cross-compilation image - #1786

Open
springmin wants to merge 5 commits into
dotnet:mainfrom
springmin:add-openharmony-image
Open

springmin wants to merge 5 commits into
dotnet:mainfrom
springmin:add-openharmony-image

Conversation

@springmin

@springmin springmin commented Oct 27, 2026 •

Copy link
Copy Markdown

Summary

Adds the OpenHarmony cross-compilation image used by dotnet/runtime#136206. The image provides the OpenHarmony Public SDK 6.0.0.47 (API 20), static OpenSSL 3.3.1 and ICU 75.1, and the aarch64-linux-ohos-* toolchain wrappers.

Contents

  • OpenHarmony Public SDK 6.0.0.47 (API 20)
  • static OpenSSL 3.3.1
  • static ICU 75.1
  • /opt/ohos-sdk, /opt/ohos-assets, /opt/ohos-toolchain

The SDK is downloaded from the official OpenHarmony 6.0-Release mirror and verified by SHA256:

https://repo.huaweicloud.com/openharmony/os/6.0-Release/ohos-sdk-windows_linux-public.tar.gz
SHA256 a315834ac133625efc912bd078f3e2b2550868d04aef1b5aa4f9679c8b3c9d8e

Licensing

  • OpenHarmony Public SDK: Apache-2.0. The license and component NOTICE.txt files are preserved under /opt/ohos-sdk.
  • OpenSSL 3.3.1: Apache-2.0; license copy at /opt/ohos-assets/openssl/LICENSE.txt.
  • ICU 75.1: Unicode License; license copy at /opt/ohos-assets/icu/LICENSE.
  • Source URLs, SHA256 values, and third-party attribution are in /opt/ohos-sdk/NOTICE and /opt/ohos-sdk/THIRD-PARTY-NOTICES.

This image does not contain the Huawei HarmonyOS SDK, Apple SDK, or Android SDK.

Image tag

azurelinux-4.0-net12.0-cross-openharmony-6.0-amd64

The image pins SDK version 6.0.0.47; the tag uses the major/minor 6.0 name. The image is registered in src/azurelinux/manifest.json.

Validation

  • build-ohos.sh passes bash -n.
  • The image build verifies the SDK, OpenSSL, and ICU archives by SHA256.
  • The final image checks that /opt/ohos-sdk/LICENSE and /opt/ohos-sdk/NOTICE are present.
  • A full image build will run in CI.

Related: dotnet/runtime#136206, dotnet-buildtools-prereqs-docker#1778.

NOTE: AI-assisted.

springsources added 2 commits October 27, 2026 09:39
The image contains the OpenHarmony SDK/NDK, static OpenSSL 3.3.1 and ICU 75.1
built with the aarch64-linux-ohos toolchain, and the toolchain wrappers. It
mirrors the recipe validated in dotnet/runtime#136206 and is the prerequisite
for the official runtime-community leg (dotnet-buildtools-prereqs-docker#1778).
@springmin
springmin requested review from a team as code owners October 27, 2026 07:25
@springmin
springmin requested a review from a team as a code owner October 27, 2026 07:26
@springmin

Copy link
Copy Markdown
Author

This is the OpenHarmony cross-compilation image used by dotnet/runtime#136206. The PR pipeline is green, including the OpenHarmony image build, Post_Build, and Publish.

The image contains the OpenHarmony Public SDK 6.0.0.47 (API 20) under Apache-2.0, with SDK/OpenSSL/ICU notices preserved. It does not contain the Huawei HarmonyOS SDK, Apple SDK, or Android SDK.

Could a reviewer from @dotnet/runtime-infrastructure or @dotnet/dotnet-docker-reviewers take a look?

NOTE: AI-assisted.

@springmin

Copy link
Copy Markdown
Author

@akoeplinger @dkurepa @mthalman — could one of you take a look at this image PR, or assign the right owner? It is the only remaining dependency for the OpenHarmony runtime-community leg in dotnet/runtime#136206.

CI is green after the main merge. The change is one new cross/openharmony image directory plus manifest.json registration; no existing images are modified. The image uses the OpenHarmony Public SDK 6.0.0.47 (Apache-2.0), preserves the SDK/OpenSSL/ICU notices, and contains no Huawei HarmonyOS SDK, Apple SDK, or Android SDK.

If neither of you owns this area, could you point me to the reviewer who does?

NOTE: AI-assisted.

FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-4.0-net12.0-crossdeps-llvm-amd64

LABEL org.opencontainers.image.title="OpenHarmony cross-compilation image" \
org.opencontainers.image.version="6.0.0.47" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the build-ohos.sh script this just downloads https://repo.huaweicloud.com/openharmony/os/6.0-Release/ohos-sdk-windows_linux-public.tar.gz i.e. it doesn't pin the exact 6.0.0.47 version.

is that URL guaranteed to be stable or could it change (invalidating the sha hash)? if it is stable then I think I'd prefer just referring to 6.0 everywhere.

I also saw that https://repo.huaweicloud.com/openharmony/os/ lists 7.0-Release, any reason why we're not using the newest sdk?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 6.0.0.47 / API 20 SDK is intentional for this first image: the runtime-community OpenHarmony leg is currently configured to build with the 6.0 image, and my fork CI/build recipe uses the same SDK version.

The latest fork runtime release is .NET 11.0.0-rc.2.26504.105. That is a .NET runtime version, not an OpenHarmony SDK version; it was built from the 6.0-SDK recipe and its artifacts were installed and exercised on OpenHarmony 7.0.0.109/111 (API 26) devices.

To be precise, this is a 6.0-SDK-built runtime running on a 7.0 OS, not a runtime built with the 7.0 SDK. The 7.0 SDK build would be a separate validation axis. If you prefer, I can add the 7.0 image in a separate PR and validate it with a dedicated runtime-community leg, rather than mixing both SDK versions in this change.

NOTE: AI-assisted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On stability: the URL is the 6.0-Release channel path, not a per-build id, so I checked the current response headers:

  • Last-Modified: Sat, 06 Sep 2025 10:47:13 GMT (unchanged since then)
  • ETag: "68bc1131-944568fd" (mtime-size based)
  • Content-Length: 2,487,576,829

The build pins the SHA256 (a315834a…) in build-ohos.sh, so if the upstream file ever changes, the build fails at verification instead of silently consuming different bits. I can't promise the upstream operator will never replace it, but a change is loud, not silent.

On naming: we already use 6.0 everywhere in the image path and tag (.../openharmony/6.0/..., azurelinux-4.0-net12.0-cross-openharmony-6.0-amd64); 6.0.0.47 only appears in the LABEL/README as the exact pinned build. If you'd rather not see the exact version in comments either, I can drop it there and keep it only in the README.

On 7.0: as answered above, this image matches the 6.0-SDK build recipe used by the runtime-community leg; a 7.0 image would be a separate validation axis, and I'm happy to add it in a follow-up PR.

One decision I'd like your input on: once dkurepa has the tarball in the storage account, should the default OHOS_SDK_URL point at the mirror (with the HuaweiCloud URL documented as a fallback), or keep HuaweiCloud as the default and let the pipeline override?

: "${OHOS_ASSETS:=/opt/ohos-assets}"
: "${OHOS_TOOLCHAIN:=/opt/ohos-toolchain}"

OHOS_SDK_URL="${OHOS_SDK_URL:-https://repo.huaweicloud.com/openharmony/os/6.0-Release/ohos-sdk-windows_linux-public.tar.gz}"

@dkurepa dkurepa Oct 30, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite certain this will get blocked by Network Isolation, we can add it to our storage account and fetch it from there tho if we're not expecting the version/binary to change often

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please — that would solve the network-isolation issue. The SDK tarball is fixed for this image:

  • Source: https://repo.huaweicloud.com/openharmony/os/6.0-Release/ohos-sdk-windows_linux-public.tar.gz
  • SHA256: a315834ac133625efc912bd078f3e2b2550868d04aef1b5aa4f9679c8b3c9d8e
  • Size: 2,487,576,829 bytes (~2.32 GiB)

Could you add it to the approved storage account and share the exact blob URL? I will switch OHOS_SDK_URL to that mirror and keep the SHA256 check.

A few questions so we match your conventions:

  • Is the existing netcorenativeassets.blob.core.windows.net/resource-packages/external/... account appropriate, and is a path like external/linux/openharmony/6.0.0.47/ohos-sdk-windows_linux-public.tar.gz acceptable?
  • Should the blob be immutable/versioned per SDK build, or can we use a 6.0 path?
  • Is it public read-only from the network-isolated build agents, without a SAS token?
  • Is there a size, retention, scanning, or naming requirement for this asset?

NOTE: AI-assisted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Friendly ping on the mirror questions above — is the existing netcorenativeassets... account/path acceptable for this tarball?

If it helps, the build also accepts OHOS_SDK_SHA (not just OHOS_SDK_URL), and I can expose both as Docker build args so the pipeline can point at the mirror without touching the script. I'm happy to prepare that change as soon as we know the final blob URL.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry missed this. I the netcorenativeassets is the only path we can take at this point.
Yes, we don't need a SAS token to read from it and network isolation allows it.
I'll just run this by the rest of the team before starting with the upload

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.

3 participants