-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
build: add support for OpenHarmony operating system #58350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
After adaptation, I successfully cross-compiled Node.js for OpenHarmony on my Ubuntu 24.04 amd64 server. My compile command is: cd node
mkdir ohos-sdk
# download from https://ci.openharmony.cn/workbench/cicd/dailybuild/dailylist
tar -zxf version-Master_Version-OpenHarmony_5.1.0.60-20250415_021145-ohos-sdk-public.tar.gz -C ./ohos-sdk
# download from https://ci.openharmony.cn/workbench/cicd/dailybuild/dailylist
tar -zxf version-Master_Version-LLVM-19-20250407_170223-LLVM-19.tar.gz
tar -zxf llvm-19.tar.gz
pushd ohos-sdk/linux
unzip -q native-linux-x64-5.1.0.60-Beta1.zip
popd
rm -rf *.tar.gz manifest_tag.xml ohos-sdk/linux/native/llvm
mv llvm-19 ohos-sdk/linux/native/llvm
TOOLCHAIN=$(realpath ohos-sdk/linux/native/llvm)
export CC="$TOOLCHAIN/bin/clang --target=aarch64-linux-ohos -Wno-error=implicit-function-declaration"
export CXX="$TOOLCHAIN/bin/clang++ --target=aarch64-linux-ohos -I $TOOLCHAIN/include/libcxx-ohos/include/c++/v1/ -L $TOOLCHAIN/aarch64-unknown-linux-ohos/ -Wno-error=implicit-function-declaration"
export CC_host="gcc"
export CXX_host="g++"
./configure --dest-cpu=arm64 --dest-os=openharmony --cross-compiling --partly-static
make -j64 As the OpenHarmony compilation toolchain continues to mature, the compile command will be further simplified. At that time, I will add the compilation guide to the BUILDING.md file. Additionally, I have run test cases on my device (RK3568, OpenHarmony 5.0 arm64), achieving a pass rate of approximately 98%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you assign an Experimental tier to this platform in BUILDING.md?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
ok, I'm done. |
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~~This PR updates deps folder and those changes can go away with the next release. You need to land these changes to upstream repositories and later we should add openharmony to experimental. ~~
Edit: my bad. The changes are only to gyp files.
It seems that I'm blocked by a flaky-test #58353 . What should I do? |
OpenHarmony is an open-source operating system. It supports running on hardware such as phones, tablets, PCs, and embedded devices.
OpenHarmony supports the following system types:
We only need to focus on the OpenHarmony standard system, as the other two types are insufficient in memory to run Node.js
The OpenHarmony standard system uses the Linux kernel but does not use the GNU userland. This architecture is similar to that of the Android operating system. Therefore, my adaptation process for OpenHarmony is also similar to that for Android.
This adaptation only focuses on the arm64 architecture, as I don't have other environments to test more architectures.