build: refactor Android build system#44207
Conversation
8ef2283 to
4e6f250
Compare
12b559b to
dc5aad2
Compare
|
cc @nodejs/build |
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.
Shall we update https://github.com/nodejs/node/blob/main/BUILDING.md#android accordingly?
There was a problem hiding this comment.
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.
I think it would be better to update this doc in the same pr.
There was a problem hiding this comment.
Hi, @MeowShe. Would you update BUILDING.md in this pr?
There was a problem hiding this comment.
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.
Thanks, I will update BUILDING.md using rebase when all the fix are ready.
There was a problem hiding this comment.
@MeowShe would you mind update the BUILDING.md to keep the doc update with this change?
There was a problem hiding this comment.
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.
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.
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>
c2c8fcd to
cdca8cf
Compare
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.
Please use subprocess.run() instead of os.system() for security and compatibility reasons.
|
Thanks for the contribution @MeowShe. |
|
Hello @MeowShe , Great thanks! Best regards, Jason |
Yes, now we can run node applications on Android, if you've asking how to build Node.js binary for Android on CentOS, just follow BUILDING.md please. Alternatively, you may want to look at #44888, which is a pull request in progress that has not yet been merged. |
|
Thanks for help @MeowShe , By BUILDING.md, you mean exactly the below link? After building, what is the result output we will get? A binary file we could just execute? Thanks again! https://github.com/MeowShe/node/blob/android-build/BUILDING.md#android |
Yes, a binary can be executed on Android will be built, then you can use |
Completely rewritten the Android build process in Python to make it more complete and CI ready.
Refs: #36287