Skip to content

Commit a10f45e

Browse files
Add Linux make scripts for cross-architecture builds (#3326)
## Related issues Part of [RSM-1314](https://linear.app/a8c/issue/RSM-1314) — Linux release prep. ## How AI was used in this PR AI-assisted throughout: investigated why `npm run make -- --arch=x64 --platform=linux` silently produced a host-arch DEB (root cause: `scripts/package-in-isolation.ts` only reads `process.argv[2]` and ignores the trailing flags), drafted the new `make:linux-*` scripts mirroring the Mac/Windows pattern, ran the cross-build, inspected the resulting DEB with `dpkg-deb -x` + `file` to confirm every binary was `x86-64`, and drafted this PR body. Author reviewed each step, ran the builds locally, and pushed back on overstated claims (e.g. "any arch" was tightened to "an arm64 Linux host" since only that direction was directly verified). ## Proposed Changes Adds `make:linux-x64` and `make:linux-arm64` scripts to `apps/studio/package.json` and matching wrapper entries in the root `package.json`, mirroring the existing `make:macos-*` and `make:windows-*` patterns. Without these, the only way to build a Linux DEB locally is bare `npm run make`, which always builds for the host CPU. This is a prerequisite for adding a Linux build group to Buildkite. ## Testing Instructions From a Linux host: ``` npm run make:linux-x64 npm run make:linux-arm64 ``` Output lands at: - `apps/studio/out/make/deb/x64/studio_<version>_amd64.deb` - `apps/studio/out/make/deb/arm64/studio_<version>_arm64.deb` Verified locally on an arm64 Linux host: `npm run make:linux-x64` produces an x86-64 DEB. `file` check on the unpacked contents confirms the main binary, all Electron `.so` files, and the bundled `node` (used by the proxy with `setcap CAP_NET_BIND_SERVICE`) are all `x86-64`. Native modules `koffi` and `fs-ext-extra-prebuilt` ship prebuilt binaries for every arch in the npm package and resolve at runtime, so no per-arch compilation is needed. No workarounds equivalent to Mac's `npm rebuild fs-xattr --cpu universal` are required. ## Pre-merge Checklist - [x] Have you checked for TypeScript, React or other console errors?
1 parent 6573660 commit a10f45e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

apps/studio/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"make:windows-arm64": "electron-vite build --config ./electron.vite.config.ts --outDir=dist && electron-forge make . --arch=arm64 --platform=win32",
1919
"make:macos-x64": "electron-vite build --config ./electron.vite.config.ts --outDir=dist && SKIP_DMG=true FILE_ARCHITECTURE=x64 electron-forge make . --arch=x64 --platform=darwin",
2020
"make:macos-arm64": "electron-vite build --config ./electron.vite.config.ts --outDir=dist && SKIP_DMG=true FILE_ARCHITECTURE=arm64 electron-forge make . --arch=arm64 --platform=darwin",
21+
"make:linux-x64": "electron-vite build --config ./electron.vite.config.ts --outDir=dist && electron-forge make . --arch=x64 --platform=linux",
22+
"make:linux-arm64": "electron-vite build --config ./electron.vite.config.ts --outDir=dist && electron-forge make . --arch=arm64 --platform=linux",
2123
"install:bundle": "npm install --no-package-lock --no-progress --install-links --no-workspaces && patch-package && node ../../scripts/remove-fs-ext-other-platform-binaries.mjs",
2224
"package": "electron-vite build --config ./electron.vite.config.ts --outDir=dist && electron-forge package .",
2325
"publish": "electron-forge publish .",

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
"make:windows-arm64": "ts-node ./scripts/package-in-isolation.ts make:windows-arm64",
3838
"make:macos-x64": "ts-node ./scripts/package-in-isolation.ts make:macos-x64",
3939
"make:macos-arm64": "ts-node ./scripts/package-in-isolation.ts make:macos-arm64",
40+
"make:linux-x64": "ts-node ./scripts/package-in-isolation.ts make:linux-x64",
41+
"make:linux-arm64": "ts-node ./scripts/package-in-isolation.ts make:linux-arm64",
4042
"make:dmg-x64": "FILE_ARCHITECTURE=x64 node ./scripts/make-dmg.mjs",
4143
"make:dmg-arm64": "FILE_ARCHITECTURE=arm64 node ./scripts/make-dmg.mjs",
4244
"publish": "npm -w studio-app run publish",

0 commit comments

Comments
 (0)