Skip to content

Install a prebuilt extension from the GitHub release when Cargo is missing - #190

Merged
danielpclark merged 2 commits into
masterfrom
claude/determined-shannon-ybz9nf-prebuilt
Oct 21, 2026
Merged

danielpclark merged 2 commits into
masterfrom
claude/determined-shannon-ybz9nf-prebuilt

Conversation

@danielpclark

Copy link
Copy Markdown
Owner

Brings back the no-Rust install path that went with thermite, as part of the gem itself, and the release job that feeds it.

Release side

  • rake prebuilt builds the extension and packs it as faster_path-<gem version>-ruby<XY>-<os>-<cpu>.tar.gz (e.g. faster_path-0.5.0-ruby34-linux-x86_64.tar.gz, holding lib/faster_path/libfaster_path.so) with a .sha256 file next to it, in pkg/.
  • The prebuilt CI job runs it for Ruby 3.4 on ubuntu-22.04 (linux-x86_64), macos-latest (darwin-arm64), macos-15-intel (darwin-x86_64) and windows-latest (windows-x86_64), one Ruby per OS as agreed. It runs for v* tags and on workflow_dispatch, so the builds can be checked before tagging.
  • The release job (tags only) builds the .gem and attaches it and the four tarballs with their checksums to the GitHub release.

Install side

ext/Rakefile builds with Cargo when it is found (as before). When it isn't, it downloads this version's asset for the running Ruby from the GitHub release, verifies the SHA-256, unpacks the library into lib/faster_path/ and the gem loads it from there. With no asset for the platform, the install fails with a message naming the file it looked for and pointing at the Rust installer. FASTER_PATH_PREBUILT_URL replaces the release URL (mirrors, offline machines). All stdlib: Net::HTTP (following GitHub's redirects), Gem::Package::TarReader, Zlib, Digest.

The names carry the gem's version and the Ruby's minor version, so one build serves every patch release of that Ruby. thermite's names carried the exact patch release (ruby2.7.8), so they only ever matched that one.

Verification

  • Ruby 3.4.6: rake minitest lint passes (145 tests, including pack/unpack round-trip, checksum rejection and Cargo detection); rake prebuilt produces the tarball and checksum.
  • End to end with Cargo removed from the PATH and a local HTTP server standing in for the release: on Ruby 3.4 gem install prints "Cargo was not found; downloading the prebuilt extension", installs a 780 KB gem and require 'faster_path' works; on Ruby 3.2 (no ruby32 asset) it fails with the message above.
  • The prebuilt job on all four runners is best checked with a workflow_dispatch run once this is merged, before tagging v0.5.0.

Generated by Claude Code

…ssing

thermite's fallback for machines without Rust came back as part of the
gem: the release workflow now builds the extension for Ruby 3.4 on Linux
x86_64, macOS arm64 and x86_64, and Windows x64, packs each as
`faster_path-<gem version>-ruby<XY>-<os>-<cpu>.tar.gz` with a SHA-256
file (`rake prebuilt`), and attaches them and the gem to the release of a
version tag; it can also be run by hand to check the builds before
tagging. At `gem install`, ext/Rakefile builds with Cargo when it is
found, and otherwise downloads the asset for the running Ruby from the
release, checks it against its checksum and unpacks the library into
lib/faster_path; with no asset for the platform it fails naming the file
it looked for. FASTER_PATH_PREBUILT_URL points the download elsewhere.

The names carry the gem's version and the Ruby's minor version, so one
build serves every patch release of that Ruby; thermite's names carried
the exact patch release and only matched that one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXvfgWzuq28ewqT3AyhX4Z
@semanticdiff-com

semanticdiff-com Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/ci.yml  0% smaller
  Cargo.lock Unsupported file format
  Cargo.toml Unsupported file format
  README.md Unsupported file format
  Rakefile Unsupported file format
  ext/Rakefile Unsupported file format
  faster_path.gemspec Unsupported file format
  lib/faster_path/build_task.rb Unsupported file format
  lib/faster_path/prebuilt.rb Unsupported file format
  lib/faster_path/version.rb Unsupported file format
  test/prebuilt_test.rb Unsupported file format

0.5.0 is published without the prebuilt extension support, so the
release that carries the prebuilt extensions is 0.5.1.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXvfgWzuq28ewqT3AyhX4Z
@danielpclark
danielpclark merged commit 3106941 into master Oct 21, 2026
21 checks passed
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