Repository navigation
feat(desktop): Linux arm64 .deb for DGX Spark in the desktop release - #440
Conversation
`Portato-<version>-linux-arm64.deb` is spelled once and parsed back, like the DMG, ZIP and Windows installer names, and `assertVersionsAgree` now checks it. `debPackageVersion` maps a semver prerelease separator to `~` so dpkg orders `0.0.26~rc.1` before `0.0.26`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Linux package ships `mlx-agent` at `/opt/Portato/resources/native`, beside `resources/app`, not under a macOS `Contents/Resources/app` anchor. The lookup still returns only a file that exists, so the Windows layout, which ships no agent, is unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`verifyBundledCli` takes the executable, resources directory, addon name and platform instead of hard-coding the macOS `.app` layout; package.ts passes today's values. `verifyPackagedCoreAddon` loads `@mlx-node/core` from the packaged app through `MLX_CORE_NATIVE_LIBRARY_PATH`, calls `getRuntimeCapabilities()` and accepts only `cuda` or `cpu`. An optional driver library directory lets a runner without the NVIDIA driver resolve the addon's NEEDED `libcuda.so.1`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The black macOS template disappears on Ubuntu's dark top bar, and Electron Packager sets no window icon on Linux. make-icons.ts now also writes `icon.png` (512px), `tray.png` (24px) and `[email protected]` (48px) from the square Windows tile, and stage-app stages exactly those three on Linux. The generator is deterministic: no committed output changed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
linux-payload.ts resolves the addon (40 MiB floor), the three NVRTC header trees beside it, the SPA and the built app, and checks a packaged app's native payload. No CUDA library is collected: the device's system CUDA provides them. verify-linux-bundle.ts is the Linux twin of verify-bundle.ts: required files, every ELF is AArch64 (read from the header in TypeScript), the addon's dynamic section under the same rules as ci.yml, no bundled CUDA runtime, no build-machine RUNPATH/RPATH, and with --runtime the CLI, agent, native-module and core-addon probes. The parsers are line parsers with captured readelf output as fixtures. Co-Authored-By: Claude Opus 5.5 <[email protected]>
linux-deb.ts packs the Electron Packager output under /opt/Portato with a /usr/bin/portato symlink, a desktop entry and a hicolor icon, using dpkg-deb --root-owner-group. The maintainer scripts follow electron-builder's: chrome-sandbox is setuid only where user namespaces do not work, and an AppArmor profile grants the app userns where AppArmor accepts it. postrm acts on remove/purge only. Depends is electron-builder's Electron list with the Ubuntu 24.04 t64 names first and the 22.04 names as alternatives, plus libblas3 and liblapack3, which the addon links. CUDA is not a dependency: the device's system CUDA provides it. verifyLinuxDeb reads the package back (fields, maintainer scripts, file list, root ownership, no CUDA library, nothing outside /opt/Portato and the launcher entries). Co-Authored-By: Claude Opus 5.5 <[email protected]>
package-linux.ts is the Linux twin of package-windows.ts: it stages the addon, the three NVRTC header trees and the bundled agent into native/, stages the JS closure with the Linux icons, runs Electron Packager for linux/arm64 with the `portato` executable, writes the AppArmor profile and (with --release) app-update.yml, checks the packaged CLI, native modules and core addon, then builds and verifies the .deb and writes out/linux-package-result.json. --release requires the agent and its tag and stamps autoUpdates, as --sign does on macOS. --driver-lib-dir lets the core-addon probe resolve libcuda.so.1 on a build machine without the NVIDIA driver. Co-Authored-By: Claude Opus 5.5 <[email protected]>
update-artifacts.ts writes latest-linux-arm64.yml from the final .deb (streamed sha512 and size, no blockmap, no minimumSystemVersion, which electron-updater would compare with the kernel version on Linux). generate-update.ts gains a --deb mode; check-release.ts resolve emits linux_deb_name and a new verify-linux command ties the packaged app, the .deb name and its control fields to the tag and manifest. publish-release.ts takes --linux-deb and --linux-manifest, and the publication gate now requires all seven assets: a release without the Linux feed would break update checks for every installed Linux client. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Linux arm64 the app loads mlx-core.linux-arm64-gnu.node, uses the colored tray.png for the tray (a black template vanishes on Ubuntu's dark top bar) and icon.png for the window, which Electron Packager does not set on Linux. nativeRuntimeDir stays null: the addon links the system CUDA through its RUNPATH. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stable Linux arm64 release packages now take part in the update feed through electron-updater's DebUpdater, whose own update-downloaded is the "payload staged" event. Two updater options keep macOS unchanged: installOnPlainQuit (Linux false: dpkg -i needs an administrator password, which must follow the user's Restart to Update, not a quit) and isSystemSupported (Linux true: electron-updater would compare the feed's minimumSystemVersion with the kernel version). MLX_DESKTOP_SMOKE=1 skips the app and agent update checks, and on the first brokered Control Panel prints "[mlx] smoke: control panel brokered" and quits normally, for the release workflow's headless launch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`linux` (ubuntu-22.04-arm) builds the addon with ci.yml's CUDA 13.0 SBSA toolchain, packages the .deb with --release, runs the bundle gate with the runtime probes, ties versions together with verify-linux, writes latest-linux-arm64.yml and uploads both with their SHA-256 digests. The toolkit's libcuda stub stands in for the driver library the addon links, for the core-addon probe only. `linux-smoke` (ubuntu-24.04-arm) checks the digests, installs only the CUDA runtime libraries plus cuda-compat, turns the AppArmor user namespace restriction on, installs the .deb with apt, checks the installed tree (version, launcher, desktop entry, ldd, AppArmor profile), runs the gate on /opt/Portato, launches the app headless with its sandbox until the Control Panel is brokered, and uninstalls. Neither job uses the desktop-release environment or any secret beyond GITHUB_TOKEN. `publish` now needs both, checks the Linux commit, version, package name and both digests, and uploads seven assets. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first dry run failed in package-linux.ts: `mlx download dataset
--help` loads the Linux addon, which links libcuda.so.1, but the CLI
probes ran with only PATH and HOME, so on the GPU-less runner the
addon could not load ("Cannot find native binding"). Only the separate
core-addon probe received --driver-lib-dir.
driverLibraryEnv() now adds LD_LIBRARY_PATH to every probe subprocess
that can load the addon: `agent --version`, each `download --help`, the
native-runtime probe and the core-addon probe. Linux only, only when a
directory is given; the shipped app and its CLI launcher never set it.
package-linux.ts and verify-linux-bundle.ts pass the directory through,
which also covers the linux-smoke gate.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
DebUpdater verifies the .deb in the user's cache, then hands that same user-writable path to `pkexec dpkg -i`: another process of the same user can swap the file in between and have root run its maintainer scripts behind the user's password prompt. Its `apt-get install -f` fallback also reports success after a cancelled or failed dpkg. On Linux the app now only checks latest-linux-arm64.yml, through a LinuxFeedUpdater that keeps electron-updater's provider, rollout and version rules but never downloads or installs. A newer release shows as "Download Portato <version>…" in the tray, which opens its GitHub release page; the user installs it with `sudo apt install`. The feed and the seven-asset publish gate stay. DebUpdater is no longer constructed, and its test is replaced by one that runs the real check and asserts downloadUpdate and quitAndInstall are never called. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r path Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Adds a Linux arm64 build of Portato (the desktop app) for NVIDIA DGX Spark to the desktop release pipeline. The release now has a
.deband a Linux update feed.libcudart.so.13,libcudnn.so.9andlibcuda.so.1from the system. DGX OS ships them, so the.debbundles no CUDA./opt/Portatowith aportatocommand, a launcher entry and an AppArmor profile. Chromium's sandbox needs the profile on Ubuntu 24.04.LinuxFeedUpdatercheckslatest-linux-arm64.ymland never downloads or installs. The tray shows Download Portato <version>…, which opens the release page. The user runssudo apt install ./Portato-<v>-linux-arm64.deb. No in-apppkexec/dpkg, so the app never runs root code from a file that the user can write.libcuda.so.1throughLD_LIBRARY_PATH. This is Linux-only and is set only when--driver-lib-diris given. The shipped app never sets it.resources/applayout.linuxandlinux-smokejobs use no environment and onlyGITHUB_TOKEN, so a dry run works from any branch.Verification
Dry run 46231879921:
Package Linux ARM64✅ andInstall and launch Linux ARM64✅. The macOS and Windows jobs do not start from a branch, because thedesktop-releaseenvironment allows onlymainandv*tags.I installed the dry-run
.debon real hardware: an RTX Spark N1X (sm_121, the same as DGX Spark), Ubuntu 24.04 WSL, CUDA 13.4.latest-linux-arm64.ymlsudo apt install ./…deb/usr/bin/portato → /opt/Portato/portatolddon the addonbackend=cuda, 64×64 matmul correct[mlx] smoke: control panel brokered, exit 0apt remove+purgeyarn typecheckandyarn lintpass.vp testonpackages/desktop/__test__andpackages/agent/__test__: 969 passed, 3 skipped.A real DGX Spark run of the first release is still open.
Review decisions (no change)
usernsgrant also coversELECTRON_RUN_AS_NODE. The profile is the one electron-builder installs, and Ubuntu ships the same type for Electron apps. Splitting the CLI runtime from the GUI binary is a separate project./etc/apparmor.d/portato. The postinst copies the profile only afterapparmor_parser --skip-kernel-loadaccepts it. Older AppArmor rejectsabi/4.0, so a conffile would breakapparmor.servicethere. Admin edits go in/etc/apparmor.d/local/portato(include if exists), which the package never touches.🤖 Generated with Claude Code