Skip to content

Apply Ruby::Box test env workaround only when running under bundler - #1234

Merged
tompng merged 1 commit into
ruby:masterfrom
tompng:box_test_workaround_only_under_bundler
Aug 5, 2026
Merged

Apply Ruby::Box test env workaround only when running under bundler#1234
tompng merged 1 commit into
ruby:masterfrom
tompng:box_test_workaround_only_under_bundler

Conversation

@tompng

@tompng tompng commented Aug 5, 2026

Copy link
Copy Markdown
Member

The workaround added in ffaf5f1 clears RUBYOPT/RUBYLIB unconditionally. In ruby/ruby's test-bundled-gems, the spawned child needs those variables to locate the build-tree stdlib, so it failed with "cannot load such file -- prism".

Clearing the bundler context is only needed when the test itself runs under bundler, where bundler/setup inherited via RUBYOPT crashes inside Ruby::Box with "uninitialized constant Gem::Specification". Restrict the workaround to that case and keep the env intact otherwise.

The workaround added in ffaf5f1 clears RUBYOPT/RUBYLIB unconditionally.
In ruby/ruby's test-bundled-gems, the spawned child needs those variables
to locate the build-tree stdlib, so it failed with
"cannot load such file -- prism".

Clearing the bundler context is only needed when the test itself runs
under bundler, where bundler/setup inherited via RUBYOPT crashes inside
Ruby::Box with "uninitialized constant Gem::Specification". Restrict the
workaround to that case and keep the env intact otherwise.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tompng
tompng merged commit ac42eaa into ruby:master Aug 5, 2026
40 checks passed
@tompng
tompng deleted the box_test_workaround_only_under_bundler branch August 5, 2026 18:38
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