#52959: build: name node's arch after the target cpu in every toolchain
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.arch in that main process came out as 'ia32' while renderers and service workers reported 'arm' (caught by the webPreferences.sandbox process-API and ServiceWorkerMain startup-data specs on the #52874 backports' arm test legs).
Node's GN build (unofficial.gni) picks NODE_ARCH = "ia32" whenever the compiling toolchain's current_cpu is x86, and target_cpu otherwise. The arm snapshot toolchain is x86-hosted, so the node_mksnapshot built there baked arch: 'ia32' into the process object the arm binary later deserializes. Keying the ia32 spelling off target_cpu gives 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 in build_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
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
Release Notes
Notes: none
Backports
No Backports Requested
This pull request doesn't have any backports requested or created for older release branches.
What are backports?
Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron