Repository navigation
fix(antigravity-acp): add installCheck smoke check for patchelf-rewritten binaries (#4759) - #5337
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0dcae8db3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # main ever ran -- so verify that path through the dynamic linker's | ||
| # --list mode, which resolves the patched interpreter and RUNPATH | ||
| # without running program initializers. | ||
| "${stdenv.cc.bintools.dynamicLinker}" --list "$out/bin/agy_acp_server.par" > /dev/null |
There was a problem hiding this comment.
Inspect the PAR payload instead of the generated wrapper
On Linux, this checks the generated launcher rather than the patchelf-rewritten PAR executable. The existing postFixup calls wrapProgram, whose implementation moves the original executable to .agy_acp_server.par-wrapped and replaces its public path with a compiled launcher. The local dynamic linker's --help describes --list as “list all dependencies and how they are resolved”; it does not execute the launcher and therefore never reaches the PAR payload. Consequently, this check can pass even when that payload has the loader corruption it is intended to detect. Inspect the hidden wrapped executable, or perform this check before wrapping.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Disposition from queue task 7584 (lane code-w), 2026-11-04: accepted as a real gap — the installCheck must reach the patchelf-rewritten PAR payload (the hidden .agy_acp_server.par-wrapped executable), not only the generated launcher. Not fixed in this pass: task 7584 is parked with this finding named as the blocker so the fix lands as a deliberate follow-up push on this branch rather than being merged past. Do not merge until this thread is resolved by a fix or a reasoned rebuttal.
There was a problem hiding this comment.
Fixed in 5ca0be7 (queue task 7584, lane code-x): the installCheck now runs the dynamic linker's --list against the hidden patchelf-rewritten payload $out/bin/.agy_acp_server.par-wrapped, not the makeBinaryWrapper launcher at the public path. Verified by evaluating the derivation on x86_64-linux: the rendered installCheckPhase contains ld-linux-x86-64.so.2 --list "$out/bin/.agy_acp_server.par-wrapped".
| # main ever ran -- so verify that path through the dynamic linker's | ||
| # --list mode, which resolves the patched interpreter and RUNPATH | ||
| # without running program initializers. | ||
| "${stdenv.cc.bintools.dynamicLinker}" --list "$out/bin/agy_acp_server.par" > /dev/null |
There was a problem hiding this comment.
Restrict the ELF loader check to Linux
On the explicitly supported aarch64-darwin platform, this mandatory check attempts to execute /usr/lib/dyld --list ...: the Nixpkgs bintools wrapper selects /usr/lib/dyld as Darwin's dynamic linker. Unlike Linux's loader, dyld cannot be invoked this way; Apple's Mach-O loader rejects direct execution of MH_DYLINKER with LOAD_FAILURE when depth != 2. Consequently, the new unconditional install check breaks Darwin builds independently of whether the packaged binaries are healthy. Guard this ELF-specific command with stdenv.hostPlatform.isLinux, matching the existing platform restriction on autoPatchelfHook, or provide a separate Darwin check.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Disposition from queue task 7584 (lane code-w), 2026-11-04: accepted as a real gap — the ELF loader check must be guarded to Linux (stdenv.hostPlatform.isLinux); as written it would break the supported aarch64-darwin build. Not fixed in this pass: task 7584 is parked with this finding named as the blocker so the fix lands as a deliberate follow-up push on this branch rather than being merged past. Do not merge until this thread is resolved by a fix or a reasoned rebuttal.
There was a problem hiding this comment.
Fixed in 5ca0be7 (queue task 7584, lane code-x): the ELF loader check is now wrapped in lib.optionalString stdenv.hostPlatform.isLinux, so Darwin builds no longer attempt to execute /usr/lib/dyld --list. Verified by evaluating the derivation for aarch64-darwin: the rendered installCheckPhase contains no --list command (the Linux evaluation still contains it, against the wrapped payload).
…nux-guard ELF check (#4759)
|
🤖 Agent note · handed off (task 9305) Claimed by lane code-h and assigned to the opencode execution lane (§1b) — handed to the bound opencode claimant session for the follow-up disposition itself; the sandbox lane does not work this task itself. Revalidation leads for the claimant (fresh
|
Fixes #4759
What
Adds the missing runtime smoke check to
pkgs/antigravity-acp, the one gap found by the #4759 audit of every fleet derivation thatautoPatchelfHookrewrites on the current nixpkgs pin (full audit recorded on #4759).agy_acp_server.paris a dynamically linked single-file PAR executable — exactly the shape patchelf 0.19.x corrupts (the t3 Node SEA segfault, #4884) — and the derivation had no installCheck at all. The new check:localharness_external --help(Go binary; usage exit 2 accepted, a SIGSEGV/139 fails), andagy_acp_server.par's ELF loading path via the dynamic linker's--listmode (patched interpreter + RUNPATH resolution). The .par cannot execute inside the build sandbox — its tcmalloc startup aborts on the sandbox's restricted CPU view (third_party/tcmallocNumCPUs CHECK) before main — but the patchelf 0.19.x corrupts Node SEA binaries (t3 0.1.2 segfaults; blocked the fleet switch) #4759 failure mode segfaulted inside ld.so before main too, so the loading path is the part a check can and must cover in-sandbox. On a host the built .par starts and answers--help.Everything else the audit covered (latest-cli's
turso-cli/tursodb, claude-code, jules, mojo, t3) already has an executing installCheck; antigravity-hub (Electron) is reviewed and exempt — see the audit comment on #4759.Verification
installCheckPhaseran (drv/nix/store/9qfp4x98gvirg24lak7bdpspii892nmg-antigravity-acp-1.2.1.drv).agy_acp_server.par --helpprints its flags;localharness_external --helpprints usage.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.