electron / electron/rebuild

Cross Compile on Linux

Open
#1,087 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
181
Avg merge
6h 44m
Merged PRs (30d)
3

Description

Hi,

cross compile on linux does not work out of the box with node-gyp in backend. If I run @electron/rebuild -a arm64 on a amd64 system, the output will be still a amd64 binary.

If I define

export CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++

Before running the rebuild command, it works find.

However, in a multi-arch build this is not possible. Running electron-builder with —x64 —amd64 would call rebuild twice.

It should be considered if electron-builder could set the CC variables, if host and target arch does not match.

Contributor guide

Open the contributing guide

Research direction

No file or test is named. Start by tracing how @electron/rebuild handles the target architecture and how electron-builder invokes rebuild for multiple architectures, then inspect where node-gyp compiler variables are read. Done means Linux cross-compilation selects the target compiler without manually exporting CC and CXX.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, node.js
Domain
build-system, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.