Skip to content

[Homebrew/Host] Honor each image's sealed bottle prefix - #1193

Open
brandonpayton wants to merge 2 commits into
mainfrom
homebrew/minimal-third-party-proof-qk044
Open

[Homebrew/Host] Honor each image's sealed bottle prefix#1193
brandonpayton wants to merge 2 commits into
mainfrom
homebrew/minimal-third-party-proof-qk044

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Aug 2, 2026

Copy link
Copy Markdown
Member

Why

A published virtual filesystem (VFS) image records exact guest paths and
expected file sizes. An older public Homebrew image stores bottle files
under /home/linuxbrew/.linuxbrew, while the current default prefix is
/opt/kandelo/homebrew.

The lazy-file runtime previously used the current default when replacing
Homebrew placeholders. That changed legacy bottle bytes and their lengths,
so the VFS integrity check correctly rejected the result and
/usr/bin/brew could not start.

The authenticated inventory for an immutable image must decide the prefix
used to relocate bottle files. This rule applies only to entries explicitly
marked archive-homebrew-relocate. Ordinary VFS entries remain free to use
any otherwise valid guest path, including paths outside Homebrew Cellar.

What changed

  • Derive the Homebrew prefix from each sealed relocation inventory.
  • Require all entries marked for Homebrew relocation in one bottle to use
    the same prefix.
  • Reject unsafe, mixed-prefix, or non-Cellar paths only when an entry is
    marked archive-homebrew-relocate.
  • Leave non-Homebrew VFS entries outside Cellar unchanged.
  • Pass the planned prefix explicitly while composing new images.
  • Cover current and retired prefixes through the shared Node.js and browser
    filesystem implementation.

This does not change the kernel or the Kandelo application binary interface
(ABI).

Validation

  • npm --prefix host run build
  • npm --prefix host run typecheck
  • npx vitest run ./test/homebrew-bottle-relocation.test.ts
    • 9 focused tests passed on the current head.
    • A mixed inventory accepts ordinary /etc content.
    • A marked relocation outside Cellar fails closed.

@brandonpayton
brandonpayton force-pushed the homebrew/minimal-third-party-proof-qk044 branch from 59cdaf1 to 07c469f Compare August 2, 2026 19:09
Relocate bottle-owned text with the prefix authenticated by the VFS
inventory instead of the repository's current default.

This keeps immutable images readable after a prefix migration and
preserves Node/browser parity in the shared filesystem path.
Make the Homebrew Cellar rule explicitly apply only to inventory
entries marked for bottle relocation.

Cover a mixed inventory so ordinary VFS sources can target valid guest
paths outside the Cellar while malformed relocation entries fail closed.
@brandonpayton
brandonpayton force-pushed the homebrew/minimal-third-party-proof-qk044 branch from ef5cfd3 to 214e13e Compare August 3, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant