build: name node's arch after the target cpu in every toolchain - #52959
Merged
Conversation
Node's GN build set NODE_ARCH to "ia32" whenever the toolchain compiling it was x86 and to target_cpu otherwise. That is the same thing for a normal build, but not in V8's snapshot toolchain: the arm (32-bit) snapshot is produced by an x86-hosted node_mksnapshot, which therefore carried NODE_ARCH="ia32", and since #52874 the arm build boots its main process from that snapshot - so process.arch read "ia32" there while renderers and workers said "arm". Spell the ia32 special case off target_cpu instead, which is right in the target toolchain and in every host toolchain that builds node for the snapshot.
VerteDinde
approved these changes
Aug 18, 2026
MarshallOfSound
approved these changes
Aug 18, 2026
jkleinsc
approved these changes
Aug 18, 2026
|
No Release Notes |
nodejs-github-bot
pushed a commit
to nodejs/node
that referenced
this pull request
Aug 31, 2026
unofficial.gni special-cased ia32 on current_cpu while every other architecture used target_cpu. When node is also compiled in a host toolchain of a cross build (for example node_mksnapshot running in V8's snapshot toolchain, which is x86-hosted for 32-bit arm targets), current_cpu is the host's, so NODE_ARCH became "ia32" for an arm-targeted build and process.arch deserialized as 'ia32' on the device. Key the special case off target_cpu like the rest. Signed-off-by: Shelley Vohr <[email protected]> PR-URL: #65491 Refs: electron/electron#52959 Reviewed-By: Filip Skokan <[email protected]>
aduh95
pushed a commit
to nodejs/node
that referenced
this pull request
Sep 3, 2026
unofficial.gni special-cased ia32 on current_cpu while every other architecture used target_cpu. When node is also compiled in a host toolchain of a cross build (for example node_mksnapshot running in V8's snapshot toolchain, which is x86-hosted for 32-bit arm targets), current_cpu is the host's, so NODE_ARCH became "ia32" for an arm-targeted build and process.arch deserialized as 'ia32' on the device. Key the special case off target_cpu like the rest. Signed-off-by: Shelley Vohr <[email protected]> PR-URL: #65491 Refs: electron/electron#52959 Reviewed-By: Filip Skokan <[email protected]>
R31K4G3
pushed a commit
to R31K4G3/node
that referenced
this pull request
Sep 9, 2026
unofficial.gni special-cased ia32 on current_cpu while every other architecture used target_cpu. When node is also compiled in a host toolchain of a cross build (for example node_mksnapshot running in V8's snapshot toolchain, which is x86-hosted for 32-bit arm targets), current_cpu is the host's, so NODE_ARCH became "ia32" for an arm-targeted build and process.arch deserialized as 'ia32' on the device. Key the special case off target_cpu like the rest. Signed-off-by: Shelley Vohr <[email protected]> PR-URL: nodejs#65491 Refs: electron/electron#52959 Reviewed-By: Filip Skokan <[email protected]>
aduh95
pushed a commit
to nodejs/node
that referenced
this pull request
Sep 9, 2026
unofficial.gni special-cased ia32 on current_cpu while every other architecture used target_cpu. When node is also compiled in a host toolchain of a cross build (for example node_mksnapshot running in V8's snapshot toolchain, which is x86-hosted for 32-bit arm targets), current_cpu is the host's, so NODE_ARCH became "ia32" for an arm-targeted build and process.arch deserialized as 'ia32' on the device. Key the special case off target_cpu like the rest. Signed-off-by: Shelley Vohr <[email protected]> PR-URL: #65491 Refs: electron/electron#52959 Reviewed-By: Filip Skokan <[email protected]>
aduh95
pushed a commit
to nodejs/node
that referenced
this pull request
Sep 9, 2026
unofficial.gni special-cased ia32 on current_cpu while every other architecture used target_cpu. When node is also compiled in a host toolchain of a cross build (for example node_mksnapshot running in V8's snapshot toolchain, which is x86-hosted for 32-bit arm targets), current_cpu is the host's, so NODE_ARCH became "ia32" for an arm-targeted build and process.arch deserialized as 'ia32' on the device. Key the special case off target_cpu like the rest. Signed-off-by: Shelley Vohr <[email protected]> PR-URL: #65491 Refs: electron/electron#52959 Reviewed-By: Filip Skokan <[email protected]>
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.
Description of Change
Since #52874 the linux-arm (32-bit) build boots its main process from a Node startup snapshot generated in V8's snapshot toolchain, and
process.archin that main process came out as'ia32'while renderers and service workers reported'arm'(caught by thewebPreferences.sandboxprocess-API andServiceWorkerMainstartup-data specs on the #52874 backports' arm test legs).Node's GN build (
unofficial.gni) picksNODE_ARCH = "ia32"whenever the compiling toolchain'scurrent_cpuisx86, andtarget_cpuotherwise. The arm snapshot toolchain is x86-hosted, so thenode_mksnapshotbuilt there bakedarch: 'ia32'into the process object the arm binary later deserializes. Keying theia32spelling offtarget_cpugives the right answer in the target toolchain and in every host toolchain that builds node for a snapshot; arm64/x64 cross builds were unaffected because their snapshot toolchains are x64-hosted. One line inbuild_add_gn_build_files.patch; the other patch files only pick up the new blob hashes.This needs to ride along with the #52874 backports (folded into those PRs rather than trop'd on its own).
Checklist
Release Notes
Notes: none