Skip to content

Add xgenext2fs installation support to setup-action - #5

Merged
tuler merged 2 commits into
mainfrom
claude/xgenext2fs-installation-hrwynu
Aug 11, 2026
Merged

Add xgenext2fs installation support to setup-action#5
tuler merged 2 commits into
mainfrom
claude/xgenext2fs-installation-hrwynu

Conversation

@tuler

@tuler tuler commented Aug 11, 2026

Copy link
Copy Markdown
Member

This PR adds support for installing xgenext2fs, the ext2 filesystem generator used to build Cartesi Machine rootfs images, as part of the setup-action workflow.

Summary

The action now installs xgenext2fs by default (latest version) alongside the Cartesi Machine emulator and CLI. Users can specify a custom version, skip installation with none, or use latest (the default).

Key Changes

  • New xgenext2fs-version input: Added to action.yml with default value latest, supporting version pinning and skip functionality
  • New src/xgenext2fs.ts module: Implements installation logic for Linux (via Debian packages) and macOS (via Homebrew formula)
  • Refactored Homebrew utilities: Extracted src/brew.ts with shared Homebrew installation logic (brewPrefix, installFormula, trustFormula)
  • Refactored APT utilities: Extracted src/apt.ts with shared Debian package installation logic (aptInstall)
  • Updated src/inputs.ts: Generalized version parsing with parseReleaseVersion() function to support both machine and xgenext2fs version inputs
  • Updated src/checksum.ts: Enhanced verifyChecksum() to accept optional pinInput parameter for flexible checksum pinning messages
  • Updated src/machine.ts: Refactored to use new aptInstall and installFormula utilities, removed duplicated Homebrew logic
  • Updated src/main.ts: Added xgenext2fs installation orchestration with output reporting
  • Updated test files: Added test/xgenext2fs.test.ts for version output parsing and test/inputs.test.ts for version input validation
  • Updated documentation: README and workflow tests now document and verify xgenext2fs installation

Implementation Details

  • Installation follows the same pattern as the machine emulator: GitHub release detection, asset download, checksum verification, and platform-specific installation
  • On Linux, packages are installed via apt-get which automatically resolves dependencies
  • On macOS, installation uses Homebrew with formula trust handling for third-party taps
  • Version parsing supports semantic versioning with optional v prefix and latest/none sentinels
  • The action outputs the installed xgenext2fs version for downstream job steps

https://claude.ai/code/session_016ppjY7CLutdweVSPRAYVwd

claude added 2 commits August 11, 2026 19:05
Adds an `xgenext2fs-version` input (default `latest`, `none` to skip) and a
matching output. On Linux the `xgenext2fs_<arch>.deb` asset of a
cartesi/genext2fs release is downloaded, verified against the digest published
by the releases API, and installed with `apt-get` so its `libarchive13`
dependency is resolved; on macOS the `cartesi/tap/xgenext2fs` formula is used.

Every genext2fs release is published as a GitHub pre-release, which
`/releases/latest` ignores, so `latest` resolves through the release list
instead.

The Homebrew helpers (quiet CI environment, per-formula trust, `brew --prefix`)
and the `apt-get` invocation move out of machine.ts into shared modules, with
`apt-get update` now running once per job rather than once per package.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ppjY7CLutdweVSPRAYVwd
The genext2fs releases are no longer published as pre-releases, so
`/releases/latest` resolves them and the release-list walk added to work around
that is no longer needed. `xgenext2fs-version: latest` now goes through the same
client method as the emulator.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ppjY7CLutdweVSPRAYVwd
@tuler
tuler requested a review from endersonmaia August 11, 2026 19:17
@tuler
tuler merged commit bb00b3f into main Aug 11, 2026
10 checks passed
@tuler
tuler deleted the claude/xgenext2fs-installation-hrwynu branch August 11, 2026 19:50
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.

3 participants