Skip to content

Conversation

@jrochkind
Copy link
Member

@jrochkind jrochkind commented Dec 9, 2025

CI is broken in weekly scheduled build at https://github.com/projectblacklight/blacklight_range_limit/actions/runs/20050712705/job/57505810337

For TWO reasons, although perhaps both related to recent release of rubygems and bundler 4, which may be auto-used? (note there was no bundler 3.x, they skipped from bundler 2.7.2 to 4, to have a match with rubygems version 4).

  1. On very old Blacklight 7, the BL generator uses Bundler.with_clean_env, which is no longer avail in bundler 4 (should use with_unbundled_env instead). So we just tell CI to use bundler 2.7.2 with BL 7 CI runs?

  2. On Rails 8 and following, our asset generator is raising "Could not identify asset_delivery_mode, try supplying --asset-delivery-mode=[importmap-rails|yarn-package]", haven't figured out why, guessing it has something to do with new rubygems/bundler I dunno, investigating.

@jrochkind
Copy link
Member Author

OK this is a weird as heck one.

The blacklight_range_limit generator, to try to guess what asset mode is being used, checks if root.join("config/importmap.rb").exist?

Under bundler 2.7.2, it does. Under bundler 4.0.1 it does not. With no other changes. Same version of rails. 8.0.4 in my current test.

?!?!?

@jrochkind
Copy link
Member Author

Part of me wants to freeze CI to use bundler 2.7.x only for another little while, but I know if I do that it could last for years like that!

@jrochkind
Copy link
Member Author

jrochkind commented Dec 9, 2025

Hm, okay, with bundler 4 only, after the rails generator tries to run generate importmap:install, we see this in logs:

Could not find gems matching 'thruster' valid for all resolution platforms (aarch64-linux-gnu, aarch64-linux-musl, arm-linux-gnu, arm-linux-musl, arm64-darwin, x86_64-darwin, x86_64-linux-gnu, x86_64-linux-musl, arm64-darwin-23) in locally installed gems.

The source contains the following gems matching 'thruster':
  * thruster-0.1.15-arm64-darwin
  * thruster-0.1.16-arm64-darwin
Run `bundle install` to install missing gems.

The install process continues... but I think maybe that exception actually prevented the generator from completing, and it's a sort of second-order bug that it is rescued somewhere and the install process continues?

That MAY be a rubygems and/or Rails bug?

See: rails/rails#56234

Which ends up going to rubygems repo, and then back to: rails/rails#56247

I think something has changed with how the Bundler with_clean_env stuff is working, that is maybe breaking engine_cart?

Weirdly, the rails fix uses Bundler.with_unbundled_env... my guess is that engine_cart is somehow not compatible with bundler 4, but it is getting hairy to track down, not sure what to do (other than try to stop using engine_cart!!!)

Possible engine_cart needs to use a with_original_env somewhere instead of with_unbundled_enfv or something?

"`Bundler.with_clean_env` has been removed in favor of `Bundler.with_unbundled_env`. " \
"If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"

@jrochkind
Copy link
Member Author

Feedback welcome -- should we just fix blacklight_range_limit CI to use bundler 2.7.x for now?

@jrochkind
Copy link
Member Author

OK something is happening in Blacklight too.

https://github.com/projectblacklight/blacklight/pull/3783/checks

eg https://github.com/projectblacklight/blacklight/actions/runs/20079840341/job/57603875568?pr=3783

This failure is different than ours -- that apparently completed the generation (I coudln’t get that far), and then the tests run but fail — I think it’s possible that the generation did not really complete, and that’s why the tests fail.

Let's see if we can find the thruster business....

Not thurster, but a similar one, see here: https://github.com/projectblacklight/blacklight/actions/runs/20079840341/job/57603875568?pr=3783#step:6:139

@jrochkind
Copy link
Member Author

Follow also at ruby/rubygems#9176 (comment)

@jrochkind jrochkind changed the title Fix CI Lock to bundler < 4 to fix CI Dec 16, 2025
@jrochkind
Copy link
Member Author

OK, we'll follow blacklight's lead and lock to bundler <4 to fix CI. projectblacklight/blacklight#3784

For our very old Rails versions, this is expected and permanent (old Rails is not compat with bundler 4). For newer Rails, it's an incompat with engine_cart, not entirely clear what the bug is where.

See at engine_cart cbeer/engine_cart#136

@jrochkind jrochkind force-pushed the fix_ci branch 4 times, most recently from 42c6b1e to 99ae3b1 Compare December 16, 2025 17:01
@jrochkind jrochkind marked this pull request as ready for review January 6, 2026 15:53
Copy link

@maxkadel maxkadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment on there not being a bundler 3 - that caught me up when I was looking into fixing this on another project.

@jrochkind jrochkind merged commit a64525b into main Jan 6, 2026
15 checks passed
@jrochkind jrochkind deleted the fix_ci branch January 6, 2026 16:16
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.

3 participants