Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(hopper): narrow the apt upgrade claim and cover split transaction…
… failures
  • Loading branch information
Adolanium committed Oct 24, 2026
commit 528c98992c2b9098aa36c1dd91fb43d06545d8ee
8 changes: 5 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,11 @@ search permissions (`0700`) on a directory you own before retrying.
On supported Linux distributions, approved setup verifies Hopper's official
`.deb`, `.rpm`, or Arch package before invoking the native package manager.
On apt systems, Hopper's runtime dependencies are installed with
`--no-upgrade`, so packages already present keep their versions; only the
Hopper package itself may upgrade. Arch's `pacman -S --needed` still updates an
outdated dependency.
`--no-upgrade` in their own transaction, so setup no longer names an
already-installed dependency as an upgrade target. apt can still upgrade a
package that the Hopper package or the Python library repair requires at a
newer version. Arch's `pacman -S --needed` still updates an outdated
dependency.
The official release feed selects the current public demo without a version
pin. REA verifies the package's detached PGP signature against Hopper's stable
primary fingerprint `7C2D73BAFAF5B9A710A69DA1A26DF815099B1BCD`, then checks
Expand Down
2 changes: 1 addition & 1 deletion src/application/LinuxHopper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ export const linuxPackageManagerCommands = (
family === "deb"
? [
// apt-get install upgrades listed packages that are already
// installed; only the Hopper archive may change versions.
// installed, so dependencies are not named as upgrade targets.
["apt-get", "install", "-y", "--no-upgrade", ...runtimeDependencies],
["apt-get", "install", "-y", archive],
]
Expand Down
50 changes: 50 additions & 0 deletions src/application/LinuxHopperPackageRuntime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,59 @@ describe("Linux Hopper package mapping", () => {
});
});

describe("Linux Hopper package transaction failures", () => {
it.each(Array.from({ length: debCommands }, (_, index) => index + 1))(
"stops after failed install transaction %i without inspecting Python",
async (failing) => {
const directory = await createTestTempDirectory(
"rea-linux-install-failure-",
);
const host = systemLinuxHopperInstallHost(
{ XDG_CACHE_HOME: directory },
async () => undefined,
);
const failed = {
exitCode: 100,
stdout: "",
stderr: "transaction " + String(failing) + " failed",
outputTruncated: false,
};
let calls = 0;
const command = vi
.spyOn(boundedCommands, "execFileBoundedOutput")
.mockImplementation(async () =>
++calls === failing ? failed : commandSuccess,
);
const inspect = vi.spyOn(
pythonRuntime,
"inspectLinuxHopperPythonRuntime",
);
try {
expect(
await host.installPackage("deb", "/tmp/verified-hopper.deb"),
).toMatchObject({
status: "failed",
failure: { exitCode: 100, stderr: failed.stderr },
});
expect(command).toHaveBeenCalledTimes(failing);
expect(inspect).not.toHaveBeenCalled();
} finally {
try {
await host.close?.();
} finally {
inspect.mockRestore();
command.mockRestore();
}
}
},
);
});

describe("Linux Hopper package cancellation and disclosure", () => {
it.each([
{ phase: "before", commands: 0, inspections: 0 },
{ phase: "first transaction", commands: 1, inspections: 0 },
{ phase: "archive transaction", commands: debCommands, inspections: 0 },
{ phase: "query", commands: debCommands, inspections: 1 },
{ phase: "runtime transaction", commands: debCommands + 1, inspections: 1 },
{ phase: "verification", commands: debCommands + 1, inspections: 2 },
Comment thread
Adolanium marked this conversation as resolved.
Resolved
Expand All @@ -232,6 +281,7 @@ describe("Linux Hopper package cancellation and disclosure", () => {
commandCount++;
if (
(phase === "first transaction" && commandCount === 1) ||
(phase === "archive transaction" && commandCount === debCommands) ||
(phase === "runtime transaction" &&
commandCount === debCommands + 1)
)
Expand Down
Loading