Skip to content

fix: better isolate bundler usage from wider environment - #461

Merged
chadlwilson merged 1 commit into
jruby:1.2-stablefrom
chadlwilson:1.2-preboot-bundler-safely
Aug 30, 2026
Merged

fix: better isolate bundler usage from wider environment#461
chadlwilson merged 1 commit into
jruby:1.2-stablefrom
chadlwilson:1.2-preboot-bundler-safely

Conversation

@chadlwilson

@chadlwilson chadlwilson commented Aug 30, 2026

Copy link
Copy Markdown
Contributor
  • Ensure bundler tries to run with the system (embedded jruby) version by default; ignoring the locked version
    • should fix myriad issues users have on modern bundler which defaults to add versions to lockfiles, but which embedded JRuby cannot dynamically switch to.
  • Ensure bundler runs frozen by default, to avoid unnecessary resolution attempts and fail fast on gem combinations that won't work.
  • When booting rails, try and preboot bundler via Bundler.setup to workaround the default Rails config/boot.rb's use of the CLI bundler/setup.
    • using bundler/setup is a CLI path, and involves checking for tty existence, things that will fail on embedded JRuby without particular JVM args. That failure to detect tty properly will then often obscure the actual root bundler error, by causing a System.exit on failure, which is caught within embedded JRuby, but now has swallowed the original bundler error.

This should make jruby-rack more reliable and easier to debug for modern bundler, requiring less rigorous alignment of bundler versions at build time to runtime, and avoiding lost error messages due to Bundler doing setup in 'CLI' mode.

@chadlwilson chadlwilson added this to the 1.2.8 milestone Aug 30, 2026
@chadlwilson
chadlwilson force-pushed the 1.2-preboot-bundler-safely branch 4 times, most recently from 7c6ed74 to 03e923f Compare August 30, 2026 14:18
@chadlwilson
chadlwilson marked this pull request as ready for review August 30, 2026 14:19
…opinionated boot process

- Ensure bundler tries to run with the system (embedded jruby) version by default; ignoring the locked version
- Ensure bundler runs frozen by default, to avoid unnecessary resolution attempts and fail fast on gem combinations that won't work.
- When booting rails, try and preboot bundler via `Bundler.setup` to workaround the default Rails `config/boot.rb`'s use of the CLI `bundler/setup`.

This should make jruby-rack more reliable and easier to debug for modern bundler, requiring less rigorous alignment of bundler versions at
build time to runtime, and avoiding lost error messages due to Bundler doing setup in 'CLI' mode, which requires tty checks.
@chadlwilson
chadlwilson force-pushed the 1.2-preboot-bundler-safely branch from 03e923f to f55ee4e Compare August 30, 2026 14:30
@chadlwilson
chadlwilson merged commit c6c53d7 into jruby:1.2-stable Aug 30, 2026
14 checks passed
@chadlwilson
chadlwilson deleted the 1.2-preboot-bundler-safely branch August 30, 2026 14:31
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