-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
electron-builder: Linux deb ,rpm arch cross-complile wont work. arm64 target contains x64 binaries #7608
Comments
The issue exists even on a single arch build.
|
Can be reproduced on 24.4.0
|
Any clue on how to fix this, it's really biting me and it breaks many electron-based apps buildings since this does not work at all outside x86_64 system! |
Can you please try If still failing, please provide a minimum reproducible repo for me to take a look at. |
@mmaietta I will test it, however I also would like to share my expericence: After debugging deeper into it, I could reproduce the issue with Cross-compile works fine for MacOS, however cross-compile on Linux works a bit different. I could fix the issue myself by define the the environment variables |
@electron/rebuild forces the platform to be In v24.5.1, I'm trying to use their API directly to allow the electron-builder/packages/app-builder-lib/src/util/yarn.ts Lines 166 to 168 in 8ae9061
|
Then I may not understand the
Build Logs with 24.5.1:
After electron-builder, I'm running the file command on Anyways, by reading
I'm not sure, if @electron/rebuild provides linux cross-arch out of the box. Setting However, set Additionally, running
produces linux arm64 binaries. The best possible fix from {
"build": {
"linux": {
"arm64": {
"env": {
"CC": "aarch64-linux-gnu-gcc",
"CXX": "aarch64-linux-gnu-g++"
}
},
"arm7l": {
"env": {
"CC": "arm-linux-gnueabi-gcc ",
"CXX": "arm-linux-gnueabi-g++"
}
}
}
}
} |
electron/rebuild API doesn't accept an environment configuration object. Best way would probably be to use the electron-builder/packages/app-builder-lib/src/configuration.ts Lines 251 to 256 in c1cc2e9
|
@mmaietta I can confirm that:
with const archMap = {
"amd64": "x86_64",
"arm64": "aarch64",
}
module.exports = async (buildContext) => {
console.log(buildContext)
if (buildContext.platform.name !== "linux") return true
if (buildContext.arch in archMap) {
process.env.CC = `${archMap[buildContext.arch]}-linux-gnu-gcc`
process.env.CXX = `${archMap[buildContext.arch]}-linux-gnu-g++`
} else {
process.env.CC = "gcc"
process.env.CXX = "g++"
}
console.log(process.env.CXX)
return true
} works, together with Thanks for the tip! |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Issue still exists. |
Unstale |
Can you please try 24.6.4? Some things changed with native dependency cross-compilation |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. |
While cross-compile for macOS works fine, cross-compile for linux has some issues where I cant identity the root cause
Here is the log output with running file at the end:
In the log, we can see, that the rebuilding is triggered for node-pty, however the arm64 directory (and target) still contain a x86 binary.
The text was updated successfully, but these errors were encountered: