Skip to content

Add mutex_m to the shipit Gemfile for non-CRuby implementations - #580

Merged
eregon merged 1 commit into
mainfrom
shipit-mutex_m
Nov 16, 2026
Merged

eregon merged 1 commit into
mainfrom
shipit-mutex_m

Conversation

@eregon

@eregon eregon commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

The shipit benchmark fails to load on Ruby implementations other than CRuby (found on TruffleRuby) with:

cannot load such file -- mutex_m
.../gems/thread_safe-0.3.6/lib/thread_safe/synchronized_cache_backend.rb:3

Cause

Dependency chain: shipit-engine -> explicit-parameters -> virtus -> axiom-types / descendants_tracker -> thread_safe 0.3.6.

thread_safe picks its cache backend by RUBY_ENGINE. For any engine other than ruby, jruby and rbx it uses SynchronizedCacheBackend, which does require 'mutex_m'. mutex_m is no longer a default gem since Ruby 3.4 and thread_safe does not declare it as a dependency, so under Bundler it cannot be loaded.

CRuby is unaffected because it never takes this code path (it uses a different cache backend that does not require mutex_m).

Fix

Add mutex_m to benchmarks/shipit/Gemfile and the corresponding entries to benchmarks/shipit/Gemfile.lock (mutex_m 0.3.0, no dependencies). bundle lock produces no further changes to the lockfile other than the BUNDLED WITH version, which is left as is.

Status on TruffleRuby

With this change the shipit benchmark gets further on TruffleRuby: it loads and serves requests. It does not make shipit pass there on its own, though:


Generated by Claude Code

@eregon

eregon commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

As a note, I was surprised thread_safe is still used anywhere, but shipit-engine main still uses it (indirectly): https://github.com/Shopify/shipit-engine/blob/main/Gemfile.lock

shipit-engine depends on thread_safe 0.3.6 (via explicit-parameters ->
virtus -> axiom-types / descendants_tracker). thread_safe picks its
cache backend by RUBY_ENGINE and, for any engine other than ruby, jruby
and rbx, uses SynchronizedCacheBackend which does `require 'mutex_m'`.

mutex_m is no longer a default gem since Ruby 3.4 and thread_safe does
not declare it as a dependency, so under Bundler the benchmark fails to
load on e.g. TruffleRuby with "cannot load such file -- mutex_m".
CRuby never hits this code path.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@eregon
eregon merged commit 8083f57 into main Nov 16, 2026
15 checks passed
@eregon
eregon deleted the shipit-mutex_m branch November 16, 2026 21:48
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.

2 participants