Skip to content

build: fix android build #58574

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

build: fix android build #58574

wants to merge 2 commits into from

Conversation

necm1
Copy link

@necm1 necm1 commented Jun 4, 2025

This commit fixes a bug in the V8 engine as detailed in the linked issue.

All tests pass locally.

Fixes: #58505

Info

To build Node.js on a Mac with Apple Silicon (& Android NDK), you need to switch to the Rosetta architecture (x86_64) before starting the build process. If you run into issues related to ‎⁠LLONG_MAX⁠ from ‎⁠limits.h (not included)⁠, the only workaround is to define ‎LLONG_MAX⁠ manually like this:

deps/uv/src/unix/linux.c

#include <limits.h>

#ifndef LLONG_MAX
#define LLONG_MAX 9223372036854775807LL
#endif

image

Build

Make sure you've installed Android NDK.

  1. python3 android-configure $ANDROID_NDK_HOME 24 arm64
  2. make -j2

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency. labels Jun 4, 2025
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM and I'll take your word for it that it builds. The commit log should be something like build: fix android build with a Fixes: https://github.com/nodejs/node/issues/58505 line.

@necm1 necm1 changed the title v8: fix bug described in issue #58505 build: fix android build Jun 4, 2025
Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

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

Since both cases are now identical, can we remove the condition and move the sources to the main sources array (starting at line 1445)

@necm1
Copy link
Author

necm1 commented Jun 4, 2025

LGTM and I'll take your word for it that it builds. The commit log should be something like build: fix android build with a Fixes: https://github.com/nodejs/node/issues/58505 line.

I have updated the commit message and included the build process. Please note that there might still be build errors on Apple Silicon processors.

@necm1 necm1 marked this pull request as ready for review June 4, 2025 13:50
@AbdullahZughbi
Copy link

Still errors...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot build node v22 and above Android with NDK 27
5 participants