Skip to content

Build and load the extension with the rutie gem instead of thermite - #189

Merged
danielpclark merged 2 commits into
masterfrom
claude/determined-shannon-ybz9nf-rutie-build
Oct 7, 2026
Merged

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

Conversation

@danielpclark

Copy link
Copy Markdown
Owner

Fixes master's dependency on thermite ~> 0.14, which cannot be satisfied from rubygems.org (the fork is not the published gem, and a gemspec cannot point at a repository), by dropping thermite altogether. Everything faster_path used it for, the published rutie gem (0.0.5) already provides.

What

  • Build: lib/faster_path/build_task.rb defines rutie:build / rutie:clean through Rutie::RakeTask, pointing Cargo at the gem's Cargo.toml with --manifest-path (RubyGems runs ext/Rakefile from ext/) and setting RUBY to the installing Ruby so Rutie's build script links to the right libruby. The macOS linking (NO_LINK_RUTIE, -undefined dynamic_lookup) comes from Rutie's task.
  • Install: ext/Rakefile builds, copies the library to lib/faster_path/, and runs cargo clean, so the installed gem is 772 KB instead of carrying 19 MB of Cargo output.
  • Load: lib/faster_path.rb uses Rutie#init, preferring a fresh target/release build in a checkout and falling back to lib/faster_path/ in an installed gem. FasterPath::FFI_LIBRARY is still there for the rust_arch_bits Fiddle import.
  • Gone: thermite, rexml and tomlrb from the gemspec, the git thermite line from the Gemfile, the [package.metadata.thermite] section of Cargo.toml, the thermite_test, and the CI job that built prebuilt tarballs for GitHub releases. The gem is built from source with Cargo at install time, as decided; the README says so under Requirements, and the Binary Release badge is removed.
  • test/build_test.rb checks the library location in a checkout and in an installed gem, and the build command's manifest path and RUBY.

The thermite fork and danielpclark/thermite#2 are untouched; faster_path simply no longer uses them.

Verification

  • Ruby 3.4.6: TEST_MONKEYPATCHES=true WITH_REGRESSION=true ENCODING=true bundle exec rake test passes end to end (cargo, 139 minitest tests, rubocop, pbench, mspec), building through rutie:build.
  • Ruby 3.2.9: gem build then gem install into a clean GEM_HOME builds the extension at install time ("Building native extensions"), and require 'faster_path' from outside the project works; the installed gem has no target/ directory.
  • Windows and macOS are covered by CI on this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CXvfgWzuq28ewqT3AyhX4Z


Generated by Claude Code

thermite was the gem's one dependency that could not be satisfied from
rubygems.org: the fork it needed is not the published gem, and a gemspec
cannot point at a repository. Everything faster_path used it for, the
rutie gem already provides. `Rutie::RakeTask` builds the extension with
Cargo (`rutie:build`), with the same macOS linking as before, and
`Rutie#init` loads it; ext/Rakefile points Cargo at the gem's Cargo.toml
since RubyGems runs it from ext/, builds against the installing Ruby
through the RUBY variable, and keeps only the built library in
lib/faster_path, so an installed gem is under a megabyte instead of
carrying Cargo's whole output. In a checkout the library is loaded from
target/release, where `rake rutie:build` leaves it.

With that go thermite's REXML and tomlrb dependencies, the Cargo.toml
metadata for its GitHub-release downloads, and the CI job that built the
release tarballs: the gem is built from source with Cargo at install time.

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 7, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  .github/workflows/ci.yml  0% smaller
  Cargo.toml Unsupported file format
  Gemfile 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.rb Unsupported file format
  lib/faster_path/build_task.rb Unsupported file format
  test/build_test.rb Unsupported file format
  test/thermite_test.rb Unsupported file format

…tall page

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