Repository navigation
fix(build): exclude -lutil on Android - #1019
Open
Noah Kirschmann (noah1510) wants to merge 1 commit into
Open
Noah Kirschmann (noah1510) wants to merge 1 commit into
Noah Kirschmann (noah1510) wants to merge 1 commit into
Conversation
Android (Bionic) provides openpty/forkpty directly in libc and does not have a separate libutil library, so exclude -lutil when OS=="android". Co-authored-by: Antigravity (Gemini 4 Neon) <noreply@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Allow
node-ptyto build and link natively on Android (e.g., Termux / Bionic-based environments) without failing on a missinglibutillibrary.Summary of Changes
binding.gypto includeOS=="android"in the existinglibraries!condition that excludes-lutil:Why
On non-Windows platforms,
binding.gyplinks against-lutilby default and currently excludes it only onmacandsolaris. On Android, Bionic providesopenpty/forkptydirectly inlibcand does not ship a separatelibutil, causing native builds to fail at link time when-lutilis passed.No other changes are needed:
OS=="linux"block inbinding.gyponly applies whenSYSROOT_PATHis set for Linux sysroot builds.src/unix/pty.cccompiles cleanly under Android via the existing#if defined(__linux__)paths (<pty.h>,openpty/forkpty,pty_close_inherited_fds, and/proc-basedpty_getproc).Testing
build/Release/pty.nodenatively on Android (arm64, Termux,node@26.13.1) vianode-gyp rebuild— compiled and linked cleanly without warnings or errors.pty.open()andpty.fork()(verifying PTY output and clean exit).