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
build: refactor Android build system #44207
Conversation
8ef2283
to
4e6f250
Compare
12b559b
to
dc5aad2
Compare
Is there anything I can do to advance this pull request plz? |
|
I'm very sorry about the lack of activity on the project's side here. I'm afraid I don't know if any of the current project members actively maintain support for Android. There is no platform team for Android, and I'm going to try pinging those folks who approved previous PRs: @cclauss @devnexen @F3n67u @yashLadha @bnoordhuis |
|
I do know Android so I have not commented. |
| sys.exit(0) | ||
|
|
||
| if len(sys.argv) != 4: | ||
| print("Usage: ./android-configure [patch] <path to the Android NDK> <Android SDK version> <target architecture>") |
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.
Shall we update https://github.com/nodejs/node/blob/main/BUILDING.md#android accordingly?
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.
Yes, but in this branch, BUILDING.md is out of date, do I need to create a new branch and pull requests to update it or later?
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.
I think it would be better to update this doc in the same pr.
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.
Hi, @MeowShe. Would you update BUILDING.md in this pr?
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.
Hi, @MeowShe. Would you update BUILDING.md in this pr?
I want but I don't seem to know how to do it because the BUILDING.md in this branch is out of date and if I update BUILDING.md it will cause a conflict and I will have to merge main branch to solve it, but the nodejs Pull Request CI doesn't seem to allow me to do that.
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.
Thanks, I will update BUILDING.md using rebase when all the fix are ready.
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.
@MeowShe would you mind update the BUILDING.md to keep the doc update with this change?
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.
I will open a new pull request to update it, and a macOS build fix will be included, thank you.
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.
Thanks. A person asked me in an email if android configure is supported in the latest main branch. So I remember our BUILING.md if lost updated with our codebase.
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.
I will commit those changes ASAP
|
I tried to build with this change on macOS (Intel), but got the following error: Do you have any idea why this error happened? |
Completely rewritten the Android build system using Python Co-Authored-By: 东灯 <43312495+Lampese@users.noreply.github.com> Co-Authored-By: Feng Yu <F3n67u@outlook.com>
I cannot build for Android with main branch too, so feel free to ignore this comment. |
| print("- Patches List -") | ||
| print("[1] [deps/v8/src/trap-handler/trap-handler.h] related to https://github.com/nodejs/node/issues/36287") | ||
| if platform.system() == "Linux": | ||
| os.system('patch -f ./deps/v8/src/trap-handler/trap-handler.h < ./android-patches/trap-handler.h.patch') |
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.
Please use subprocess.run() instead of os.system() for security and compatibility reasons.
It works. After replacing ar with llvm-ar, the ar operation failure is solved. But I still fail with: $ make
LD_LIBRARY_PATH=/Users/feng/dev/node/out/Release/lib.host:/Users/feng/dev/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/icu; mkdir -p /Users/feng/dev/node/out/Release/obj/gen; "/Users/feng/dev/node/out/Release/icupkg" -tl ../../deps/icu-tmp/icudt71l.dat "/Users/feng/dev/node/out/Release/obj/gen/icudt71l.dat"
/bin/sh: /Users/feng/dev/node/out/Release/icupkg: cannot execute binary file
make[1]: *** [tools/icu/icudata.target.mk:13: /Users/feng/dev/node/out/Release/obj/gen/icudt71l.dat] Error 126
make: *** [Makefile:113: node] Error 2This time fail at $ out/Release/icupkg
zsh: exec format error: out/Release/icupkg |
Co-authored-by: Christian Clauss <cclauss@me.com>
All of the errors above were generated in building icupkg for macOS, we might as well build icupkg for macOS separately and I will include this in next commit. Before that, could you try to build Node.js for Android without icu? |
|
I think it's fine to land this pr first to move fast. Let's land this first and leave the rest of work to separate pr. |
It's sounds great. |
|
Landed in ee9aac1 |
Completely rewritten the Android build system using Python Co-Authored-By: 东灯 <43312495+Lampese@users.noreply.github.com> Co-Authored-By: Feng Yu <F3n67u@outlook.com> PR-URL: nodejs#44207 Refs: nodejs#36287 Reviewed-By: Feng Yu <F3n67u@outlook.com> Reviewed-By: Christian Clauss <cclauss@me.com>
|
Thanks for the contribution @MeowShe. |


Completely rewritten the Android build process in Python to make it more complete and CI ready.
Refs: #36287