Repository navigation
fix(hopper): keep automated Linux setup off non-x86_64 hosts - #3422
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no blocking defects were found. SummaryThis PR limits automated Linux Hopper installation to supported x86_64 hosts and shares the doctor host’s classification with setup and installation.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Doctor host architecture"] --> B["readLinuxDistribution"]
B --> C["Shared classification for setup and installation"]
C --> D{"x64 and supported distribution?"}
D -- No --> E["Explicit install: needs_human"]
D -- Yes --> F["Normal approval and install path"]
Reviews (5) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
Every pinned Linux Hopper package (deb, rpm, Arch) is x86_64-only, but hopperSetupSupported was derived from os-release alone. Setup therefore planned and confirmed an amd64 package install on arm64 Ubuntu 24.04 and the other tested distributions. Classify installer support with the host architecture where the distribution is parsed, so setup planning, preflight, installation and package verification share one decision. Setup now takes its Linux distribution from the doctor host, as it already does for the macOS version, and the supported-host remediation text has a single owner. Fixes morluto#3419
5dcf90e to
dca573d
Compare
chessing234
left a comment
There was a problem hiding this comment.
arm64 ubuntu is now hopperSetupSupported false, but packageSetupSupport still sets hopperReadinessRequired from the host check alone, and the new test expects that. verify-package-discovery.mjs fails the package when hopperReadinessRequired is set and hopper is not ready, so an arm64 host still has to have hopper even though setup will not install it. readiness should follow hopperSetupSupported on linux.
rahul05ranjan
left a comment
There was a problem hiding this comment.
I read this on actual arm64 Linux hardware (a Raspberry Pi), so the failure mode being fixed — setup offering a Hopper-*-Linux-demo.deb that declares Architecture: amd64 to a host that can't install it — is one I can picture a user on this machine hitting exactly as described.
What I verified:
- The gate sits in the right place.
parseLinuxDistributionnow takes the host architecture and foldsarchitecture === "x64"intohopperSetupSupported, so setup planning,hostRemediation,installLinuxHopper, and the packaged verifier all inherit one decision instead of each re-checking. Grep over the PR head shows no remaining caller ofparseLinuxDistribution/readLinuxDistributionwithout an explicit architecture argument. installLinuxHopperstill independently re-readshost.distribution()and refuses withunsupported_hostbefore any download or package-manager call, so the preflight gate isn't the only line of defense.- I bundled
LinuxHopper.tsand ran the real gate on this arm64 host with a synthetic Ubuntu 24.04 os-release document: parsed asarm64it returnspackageFamily: "deb",hopperSetupSupported: false, andsupportsReaHost: true; the same document parsed asx64returnshopperSetupSupported: true. Architecture is the only differing variable, and REA host support survives, matching the new tests. src/application/LinuxHopper.test.tspasses 51/51 here, including the new non-x86_64 cases.- Launcher discovery (
linuxHopperLauncherCandidates/HOPPER_LAUNCHER_PATH) never consultshopperSetupSupported, so an arm64 user with a manually working Hopper build keeps their existing-launcher path — the fix correctly touches only the automated installer. - Reusing the
DoctorHost.architectureinjection (options.architecture ?? process.arch) matches how the Ghidra doctor already classifies host architecture, and pointing the setup host'slinuxDistributionat the doctor host keeps a single host-fact owner.
One small asymmetry, not blocking: systemLinuxHopperInstallHost reads process.arch directly while the doctor path uses the injectable architecture. In production both are process.arch, but the two could disagree if anything ever composes a doctor host with a non-default architecture for real.
The remediation rewording is a genuine improvement too — "requires an x86_64 host running ..." states both the why and the alternative (configure an existing provider, docs now point at Ghidra), where the old "64-bit Arch Linux" phrasing was quietly ambiguous about which 64-bit was meant.
…facts systemLinuxHopperInstallHost read os-release with process.arch on its own, while setup planning used the doctor host's injected architecture. Both agree in production, but a doctor host composed with another architecture could plan one answer and install with another. The install host now takes its distribution reader from the caller, and systemSetupHost passes the doctor host's, so planning, preflight and installation share one host-fact owner. The unused default host on installLinuxHopper, the other ambient reader, is removed.
|
@rahul05ranjan Thanks for testing this on real arm64 hardware and for the careful review. Good catch on the asymmetry. In ad47dcc the Linux install host now takes its distribution from the setup host's doctor host instead of reading |
…installs it packageSetupSupport required doctor Hopper readiness on every Linux host whose host check passed, including installer-untested distributions and, after the architecture gate, arm64 hosts where setup never provides Hopper. On Linux, readiness now also requires automated installer applicability; macOS is unchanged. This narrows the readiness assertion from morluto#2973 on hosts outside the installer matrix, such as Kali and ubuntu-24.04-arm.
|
@chessing234 Thanks, done in a8290eb: on Linux, Hopper readiness is now required only where |
|
Thanks for following through on this — taking the distribution from the setup host's doctor host is the right call, and having |
# Conflicts: # src/application/LinuxHopper.ts # src/setupEnvironment.test.ts
|
Merged latest |
|
TL;DR: The new arm64 tests fail on main and pass with this PR. The patched tree also type-checks. Three test files that name ResultsI tested the patch on main 89faa86, not the older head tree. The patch applies cleanly. First I added only the PR's test changes to main. Then I applied the full patch.
So an arm64 host now gets the manual-step path, and x86_64 hosts keep the automated one. The file names are left out here because they name a closed-source disassembler. CI: only the Greptile review ran on head abb451f. The full CI suite did not run on it, and I did not run it. Not run
Commandsexport PATH=~/.local/opt/node24/bin:$PATH
npm ci
# main plus the two test files' hunks only (names left out, see above)
npm run test:focused -- <Linux setup unit test> tests/evaluation/package/packageSetupSupport.test.ts # exit 1
# main plus the full patch
npm run test:focused -- <Linux setup unit test> tests/evaluation/package/packageSetupSupport.test.ts # exit 0
npm run typecheck # exit 0Test setup🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
|
@CassieFox23 Thanks for the independent check, especially the main-plus-tests-only comparison. To close some of the gaps you listed, on head abb451f, Ubuntu 24.04.5 aarch64, Node 24.18.1 (after
On the home question: the new Still not run: Node 22/26, a real Hopper install, and the full CI, which is waiting for approval. |
#3422 requires systemLinuxHopperInstallHost to take the caller's distribution reader. These launcher and package tests still called the old one-argument form, so typecheck failed on main. Co-authored-by: morluto <[email protected]>
Resolve conflicts with morluto#3422 (Linux architecture gate) and morluto#5235 (POSIX joins in MacHopperPaths): keep the shared launcher owner and both renamed-bundle scans on posix.join, import LINUX_HOPPER_SETUP_HOSTS, and run the scan agreement test from a Windows-safe temporary home. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Fixes #3419. On Linux arm64 hosts,
rea setuptreated automated Hopper installation as supported whenever/etc/os-releasematched a tested distribution. Every pinned Linux Hopper package is x86_64-only, so on such hosts setup planned and asked for approval of an install that cannot succeed. This change refuses that install up front instead.Problem and expected behavior
Smallest trigger, on Ubuntu 24.04 aarch64:
rea setup --client codex --install-hopper --jsonreturnedneeds_confirmationwith aninstall_hopperaction forHopper-6.4.2-Linux-demo.deb. With--yes, it would go on to download that package and runpkexec apt-get install.Violated invariant:
hopperSetupSupportedshould only be true where the pinned package can be installed. The pinned packages declareArchitecture: amd64(deb),x86_64(RPM lead) andarch = x86_64(Arch.PKGINFO).Expected behavior: on non-x86_64 Linux, setup should report
needs_humanwith a remediation before any download or package-manager call. This is the same path unsupported distributions such as Debian already take, so that recovery path is unchanged.Change and scope
parseLinuxDistribution/readLinuxDistributionnow take the host architecture.hopperSetupSupportedadditionally requires it to matchSUPPORTED_RELEASE_ARCHITECTURE(x64). The comment on that constant records how the package metadata was read.installLinuxHopperandverify-package-discovery.mjsalready readhopperSetupSupported. They now inherit the corrected decision with no downstream repair.architecture. The setup host takes its Linux distribution from the doctor host, as it already does formacosVersion, so planning and doctor share one host-fact owner. The Linux install host takes the same distribution reader from the setup host (ad47dcce3, from review), so planning, preflight and installation cannot disagree. The unused default install host oninstallLinuxHopper, which readprocess.envandprocess.archdirectly, is removed.LINUX_HOPPER_SETUP_HOSTSand now names x86_64.docs/installation.md#hopperis updated to match.a8290eb00, from review): on Linux,packageSetupSupportnow requires doctor Hopper readiness only where the automated installer applies (hopperSetupSupported === true); macOS is unchanged. This narrows the readiness assertion from fix(verify-package): read Hopper installer applicability from its owner #2973: on hosts outside the installer matrix, such as Kali andubuntu-24.04-arm, package verification no longer asserts that the doctor admits the configuredHOPPER_LAUNCHER_PATHlauncher.supportsReaHoststill accepts arm64 Linux), Ghidra/IDA, and the pinned releases themselves.Contribution scope: a routine fix within existing setup boundaries, so no maintainer scope decision applies.
Contract and boundary impact
LinuxHopper.parseLinuxDistribution, setup/provider admission.setup --install-hoppernow returnsneeds_humanwith the new remediation instead ofneeds_confirmation. The setup and doctor remediation strings change wording on all hosts.HOPPER_LAUNCHER_PATHis unaffected.ubuntu-24.04-arm, package verification now expectsneeds_humanfor the explicit--install-hopperrun, because both sides read the samereadLinuxDistribution(process.arch)decision. On Linux hosts outside the installer matrix (Kali,ubuntu-24.04-arm), package verification no longer requires doctor Hopper readiness.Expected effects:
/etc/os-release, unchanged)Evidence and regression coverage
Tests added or updated:
LinuxHopper.test.ts: every tested distribution onarm64keeps its package family and REA host support but hashopperSetupSupported: false. The x64 cases are unchanged.packageSetupSupport.test.ts: the packaged verifier does not expect automated Hopper on arm64 Ubuntu 24.04, and on Linux it no longer requires Hopper readiness where the installer does not apply (arm64 Ubuntu 24.04, Kali). Both cases fail without thea8290eb00change.setupEnvironment.test.ts: the realsystemSetupHostinstalls Linux Hopper from the selected doctor host's classification. A supported x64 fixture reaches the (mocked, refused) download; an unsupported arm64 fixture returnsunsupported_hostwithout any download.Base reproduction (executed): with the new architecture condition replaced by
true(base behavior), all 7 new cases fail. They pass with it restored. With the install host readingreadLinuxDistribution(process.arch)directly again, the newsetupEnvironment.test.tsx64 case fails on this arm64 host; on an x64 host the arm64 case would fail instead (source-derived, not run).User-visible CLI output (executed on Ubuntu 24.04.5 LTS aarch64, Node 24.18.1, isolated
HOME):In the
--yesrun, no file was written under the isolatedHOME, norea-hopper-*temporary directory was created, anddpkg -s hopperreports the package as not installed. I did not run the base build with--yes, because it would attempt the real package install.Remaining proof gaps:
hopperInstallSupportedgate.ubuntu-24.04-armpackage lane has not run yet; the samenpm run verify:packagepasses locally on aarch64.Validation performed
npm run test:local -- src/application/LinuxHopper.test.ts src/application/Setup.recovery.test.ts src/application/Doctor.test.ts src/application/Setup.planning.test.ts src/application/Setup.configuration.test.ts src/ghidra/GhidraDoctor.test.ts tests/evaluation/package/packageSetupSupport.test.ts— 7 files, 156 tests passedtrue— 7 failed (expected), then restorednpm run test:local -- src/setupEnvironment.test.ts src/application/LinuxHopper.test.ts— 2 files, 59 tests passedsetupEnvironment.test.tswith the install host reading the ambient host again — 1 failed (expected, x64 case on arm64), then restorednpm run test:local -- tests/evaluation/package/packageSetupSupport.test.ts— 6 passed; without thea8290eb00change, 2 failed (expected)npm run test:changed -- --base origin/main— 30 files, 534 tests passed (onad47dcce3and again ona8290eb00)npm run check:fast— typecheck and lint passednpm run format:check— passednpm run docs:check— passednpm run build:cachedplus the CLI runs above on Ubuntu 24.04.5 aarch64 — results as shownnpm run verify:packageon Ubuntu 24.04.5 aarch64, Node 24.18.1 — exit 0 ondca573dd4,ad47dcce3anda8290eb00; all 18 stages complete, includingpackage discoveryandsetup and uninstall CLICompatibility, safety, and release
--install-hoppernow stops withneeds_humaninstead of attempting an install that could not succeed. Remediation wording changes.Author readiness
Human owner: @DavidFB-creator
Before merge
type(scope): outcome.Maintainer blocker verification
macOS arm64, Node 24.18.0/npm 11.16.0, exact head
abb451f4cb23bd10dd83381e296fb58fad6e20a2:npm pack --dry-run --jsonpassed through prepack (1,671 files, including Linux Hopper/setup outputs).npm run verify:packagepassed archive, install/update, CLI/MCP, setup/uninstall and cleanup checks, including read-only setup planning and preservation of existing Hopper. This run did not verify additional OS hosts.