Repository navigation
fix(agent): run Linux bundles on the host glibc, like Zed (#1166) - #1403
Merged
Merged
Conversation
The Linux bundle shipped Nix's glibc 2.42 and forced its loader, but GPU drivers come from the host. On hosts with a newer glibc (Arch 2.44), Mesa's libLLVM could not load against the bundled libm, so both Vulkan and GL failed and the window panicked with an empty backend set. Build the release binary with cargo-zigbuild for glibc 2.31 and ship no libraries: AppRun execs the payload with the host loader, which loads the host's glibc, desktop libraries and drivers together. The audit enforces the host loader, no runtime path, an allowlist of desktop DT_NEEDED libraries and the glibc floor. Bundle format v1 is unchanged. Installed updaters require an executable usr/lib/ld-linux-x86-64.so.2, so that path is now a small launcher that accepts the old loader options and runs only the bundle's own payload. Window-open failures from a missing or unusable GPU driver now say so and point at VK_LOADER_DEBUG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue #1166 (Linux Agent cannot open a window when the host GPU driver needs a newer glibc).
Problem
The Linux bundle shipped Nix's glibc 2.42 and forced it with
AppRun→ bundledld-linux --inhibit-cache --library-path …. GPU drivers still come from the host, so on any host whose glibc is newer than the bundled one, Mesa'slibLLVMcannot load into our process. Both Vulkan and GL fail, and the window panics withFailed to create surface for any enabled backend: {}. Arch already has glibc 2.44; every distro that moves past 2.42 would hit this.Fix: do what Zed does
Zed (same GPUI) never ships glibc or a loader. It builds against an old glibc floor, uses the host loader, and loads the graphics stack from the host, so the whole process shares one libc.
build-release.shusescargo zigbuild --target x86_64-unknown-linux-gnu.2.31on Linux. The toolchain stays pinned through the Agent flake (zig,cargo-zigbuildfrom the same nixpkgs). Nix libraries are passed as link-time stand-ins (-L native=…,--allow-shlib-undefined); the host's copies resolve their own glibc symbols at runtime.AppRunis now a plainexec "$appdir/usr/bin/maple-agent" "$@", with a clear message when there is no glibc host loader (NixOS without nix-ld).linux-release-appimage.py) enforces:/lib64/ld-linux-x86-64.so.2;docs/desktop-builds.md): glibc ≥ 2.31, a Vulkan or OpenGL driver, and the standard desktop libraries above. These match Zed's.VK_LOADER_DEBUG=error,warn,driver.Existing installs and the updater
Bundle format
maple-agent-linux-bundle-v1and the updater code are unchanged. Installed releases check the new archive with the same rules:usr/lib/ld-linux-x86-64.so.2, and any regular file may be 0644 or 0755. That path is now a small shell launcher.AppRun.usr/lib/ld-linux-x86-64.so.2 --inhibit-cache --library-path … usr/bin/maple-agent …. The launcher accepts those options and execs only the bundle's own payload.The updater's existing Linux fixtures already use a non-ELF placeholder at that path and no
libc.so.6, and its prepare/swap/checkpoint tests pass with that shape.self_launch.rsnow resolves the payload directly instead of the loader.docs/updates.mdexplains why the launcher must stay while old releases can still update.Verification
Local, from a zig cross-build of this branch (glibc 2.31 target), run in an emulated x86_64 VM with Xvfb and each distro's own Mesa software Vulkan:
libm.so.6: version 'GLIBC_2.44' not found (required by /lib64/libLLVM.so.23.1)max_color_attachments)The⚠️ rows behave identically on master, so they are not regressions; they reflect software rendering in this test setup, not glibc.
--versionand--build-infosucceed on every host. The binary links only the allowlisted libraries, and its newest glibc symbol isGLIBC_2.30.Also run:
verify-linux-bundle-docker.sh: detached host start, signed-out ACP guard across two clients, release on stop;AppRunwith an inheritedAPPDIR, and the bounded child through the v1 loader path with the exact old argv;self_launchand the Linux update discovery tests;cargo fmtand clippy (-D warnings);just ci-lint.CI (
ci:package):agent-package-linuxpassed in 9m26s. It ran the real release-profile zig build in the Nix shell, then package, verify, the updater-archive validation (the same updater code installed releases run) and the Docker smoke. The CI-built bundle reportsbundled_glibc: false, its newest glibc symbol isGLIBC_2.30, and it links only the allowlisted libraries; that exact artifact opens its window on Arch with glibc 2.44.verify-linux-bundle-docker.shnow installs the desktop libraries into its Ubuntu image in a build step and still runs the smoke with--network none. That lane runs only on master and with theci:package/ci:fulllabels, so PR CI time is unchanged.Not verified: a real GPU. Anthony's Omarchy box is the natural check, and the CI artifact
maple-agent-dev-linux-x86_64-unsigned-41242860253can be used for it.🤖 Generated with Claude Code
Integration after #1401: merged current master into this branch and resolved the build-script, build-fixture and documentation overlap. Linux retains Zig/glibc2.31 and host-runtime verification; Windows retains native x64/ARM64 target selection and static PE checks. Focused packaging tests passed (91 cases, four existing platform skips), and root
just lane repopassed. The full Rust pre-commit hook was not repeated for this conflict-only integration. The requester authorized merging with bypass if needed; fresh hosted checks onab59d1f57d687c86f872a49c3eae33302ef1b841are not claimed passed.