Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundler, Zeitwerk & Roda Plugins #356

Closed
pboling opened this issue May 3, 2024 · 5 comments
Closed

Bundler, Zeitwerk & Roda Plugins #356

pboling opened this issue May 3, 2024 · 5 comments

Comments

@pboling
Copy link

pboling commented May 3, 2024

I'm trying to understand an issue I'm seeing in a deployed environment, but can't reproduce locally, even when I turn on Rails' eager loading.

I'm reporting it here because it appears to have bearing on how roda plugin authors write their code to be auto-required by bundler, vs autoloaded by zeitwerk, and I'm hoping there is a way to be/do both without conflict.

It's entirely reasonable to say it's not relevant to roda / rodauth, and close this issue, even so it may have value as a closed issue that gets indexed by search engines.

Stack

  • rails 7.1.3.2
  • roda 3.79.0
  • rodauth 2.34.0
  • rodauth-rails 1.14.0
  • rodauth-become_account 0.3.0
  • tiny_admin 0.10.1 (which is a Roda app)
  • bootsnap 1.18.3
  • zeitwerk 2.16.3
Context: Background

Superficially, the error I have seems like this one.
It was ultimately fixed by bootsnap 1.9.4 here.
Thus I'm fairly certain the above bug is not my issue.

Context: Immediately preceding `[Bootsnap] miss` messages
2024-05-03T05:13:17.604311760Z [Bootsnap] miss /apps/my_app/tiny_admin.yml
2024-05-03T05:13:17.613435291Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/base.rb
2024-05-03T05:13:17.621645303Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/email_base.rb
2024-05-03T05:13:17.647299815Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/audit_logging.rb
2024-05-03T05:13:17.648408506Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/active_sessions.rb
2024-05-03T05:13:17.650229126Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/logout.rb
2024-05-03T05:13:17.651215124Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/create_account.rb
2024-05-03T05:13:17.652654840Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/login.rb
2024-05-03T05:13:17.654283441Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/login_password_requirements_base.rb
2024-05-03T05:13:17.656532458Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/email_auth.rb
2024-05-03T05:13:17.659285233Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/verify_account.rb
2024-05-03T05:13:17.662080936Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/verify_account_grace_period.rb
2024-05-03T05:13:17.663149157Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/remember.rb
2024-05-03T05:13:17.666098755Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/json.rb
2024-05-03T05:13:17.667970291Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/jwt.rb
2024-05-03T05:13:17.669423305Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/jwt_refresh.rb
2024-05-03T05:13:17.672661456Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/reset_password.rb
2024-05-03T05:13:17.676423433Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/change_password.rb
2024-05-03T05:13:17.677652250Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/change_password_notify.rb
2024-05-03T05:13:17.678286537Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/change_login.rb
2024-05-03T05:13:17.679911580Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/verify_login_change.rb
2024-05-03T05:13:17.682017990Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/close_account.rb
2024-05-03T05:13:17.683291427Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/path_class_methods.rb
2024-05-03T05:13:17.684054263Z [Bootsnap] miss /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth/features/internal_request.rb
Context: Error Backtrace
2024-05-03T05:13:17.731178751Z bundler: failed to load command: sidekiq (/apps/my_app/vendor/bundle/ruby/3.2.0/bin/sidekiq)
2024-05-03T05:13:17.825182991Z <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- rodauth/features/become_account (LoadError)
2024-05-03T05:13:17.825216477Z 	from <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2024-05-03T05:13:17.825221192Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require'
2024-05-03T05:13:17.825225131Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
2024-05-03T05:13:17.825228873Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:354:in `load_feature'
2024-05-03T05:13:17.825232365Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:346:in `block in enable'
2024-05-03T05:13:17.825235682Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:344:in `each'
2024-05-03T05:13:17.825239174Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:344:in `enable'
2024-05-03T05:13:17.825242771Z 	from /apps/my_app/app/misc/rodauth_app.rb:11:in `block in <class:RodauthApp>'
2024-05-03T05:13:17.825246278Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:340:in `instance_exec'
2024-05-03T05:13:17.825249650Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:340:in `apply'
2024-05-03T05:13:17.825253112Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:393:in `configure'
2024-05-03T05:13:17.825267008Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:63:in `configure'
2024-05-03T05:13:17.825270836Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/roda-3.78.0/lib/roda.rb:300:in `plugin'
2024-05-03T05:13:17.825274205Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-rails-1.13.0/lib/rodauth/rails/app.rb:33:in `configure'
2024-05-03T05:13:17.825277732Z 	from /apps/my_app/app/misc/rodauth_app.rb:10:in `<class:RodauthApp>'
2024-05-03T05:13:17.825281160Z 	from /apps/my_app/app/misc/rodauth_app.rb:8:in `<main>'
2024-05-03T05:13:17.825284662Z 	from <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2024-05-03T05:13:17.825288125Z 	from <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2024-05-03T05:13:17.825292930Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
2024-05-03T05:13:17.825296417Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:26:in `require'
2024-05-03T05:13:17.825299803Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
2024-05-03T05:13:17.825303196Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:135:in `cget'
2024-05-03T05:13:17.825306674Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:175:in `block in actual_eager_load_dir'
2024-05-03T05:13:17.825310089Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
2024-05-03T05:13:17.825313470Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:25:in `each'
2024-05-03T05:13:17.825316861Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb:25:in `ls'
2024-05-03T05:13:17.825320362Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:170:in `actual_eager_load_dir'
2024-05-03T05:13:17.825323762Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
2024-05-03T05:13:17.825327191Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:16:in `each'
2024-05-03T05:13:17.825330540Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
2024-05-03T05:13:17.825334093Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
2024-05-03T05:13:17.825337402Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
2024-05-03T05:13:17.825340810Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader.rb:379:in `block in eager_load_all'
2024-05-03T05:13:17.825347334Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader.rb:377:in `each'
2024-05-03T05:13:17.825351012Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/loader.rb:377:in `eager_load_all'
2024-05-03T05:13:17.825354432Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.2/lib/rails/application/finisher.rb:80:in `block in <module:Finisher>'
2024-05-03T05:13:17.825358050Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:32:in `instance_exec'
2024-05-03T05:13:17.825361492Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:32:in `run'
2024-05-03T05:13:17.825364854Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:61:in `block in run_initializers'
2024-05-03T05:13:17.825368255Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
2024-05-03T05:13:17.825371511Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2024-05-03T05:13:17.825374860Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
2024-05-03T05:13:17.825378314Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
2024-05-03T05:13:17.825381644Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each'
2024-05-03T05:13:17.825384928Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `call'
2024-05-03T05:13:17.825388147Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
2024-05-03T05:13:17.825391606Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
2024-05-03T05:13:17.825394828Z 	from /usr/local/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
2024-05-03T05:13:17.825398072Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.2/lib/rails/initializable.rb:60:in `run_initializers'
2024-05-03T05:13:17.825401452Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.2/lib/rails/application.rb:426:in `initialize!'
2024-05-03T05:13:17.825404937Z 	from /apps/my_app/config/environment.rb:5:in `<top (required)>'
2024-05-03T05:13:17.825408247Z 	from <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2024-05-03T05:13:17.825411711Z 	from <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
2024-05-03T05:13:17.825415088Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/sidekiq-7.2.2/lib/sidekiq/cli.rb:305:in `boot_application'
2024-05-03T05:13:17.825418575Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/sidekiq-7.2.2/lib/sidekiq/cli.rb:42:in `run'
2024-05-03T05:13:17.825422165Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/sidekiq-7.2.2/bin/sidekiq:31:in `<top (required)>'
2024-05-03T05:13:17.825428538Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/bin/sidekiq:25:in `load'
2024-05-03T05:13:17.825431946Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/bin/sidekiq:25:in `<top (required)>'
2024-05-03T05:13:17.825435286Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/cli/exec.rb:58:in `load'
2024-05-03T05:13:17.825438666Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/cli/exec.rb:58:in `kernel_load'
2024-05-03T05:13:17.825441953Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/cli/exec.rb:23:in `run'
2024-05-03T05:13:17.825445331Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/cli.rb:451:in `exec'
2024-05-03T05:13:17.825448641Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
2024-05-03T05:13:17.825452028Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
2024-05-03T05:13:17.825455510Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
2024-05-03T05:13:17.825458915Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/cli.rb:34:in `dispatch'
2024-05-03T05:13:17.825462223Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
2024-05-03T05:13:17.825465564Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/cli.rb:28:in `start'
2024-05-03T05:13:17.825468871Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/exe/bundle:28:in `block in <top (required)>'
2024-05-03T05:13:17.825472280Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
2024-05-03T05:13:17.825475609Z 	from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bundler-2.5.8/exe/bundle:20:in `<top (required)>'
2024-05-03T05:13:17.825479097Z 	from /usr/local/bin/bundle:25:in `load'
2024-05-03T05:13:17.825482531Z 	from /usr/local/bin/bundle:25:in `<main>'

Command that fails

bundle exec sidekiq

Specific error

2024-05-03T05:13:17.825182991Z <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- rodauth/features/become_account (LoadError)

A few things I noticed.

  1. Some of my stack depends on Zeitwerk.
    a. rails, and tiny_admin, which also depends on roda, are the most relevant
    b. only others are service_actor, ajax-datatables-rails, and the dry-rb family of gems
  2. Tiny Admin is mentioned by [Bootsnap] miss just before the rodauth-related [Bootsnap] miss messages. It's only mildly interesting because TinyAdmin is a roda plugin that is self-loaded by Zeitwerk.
  3. Since this failure comes from sidekiq, not Rails, it is not loading config.ru, and the backtrace goes through my Rails.application.initialize! line in config/environment.rb, which happens after require_relative "application", which is what loads bundler.
  4. Gem rodauth-become_account does not load itself via bundler, since it has no file in the expected location for bundler to load, based on the name of the gem. So when rubygems requires the gem, actually nothing is loaded.
  5. When zeitwerk is later attempting to autoload the BecomeAccount feature when it encounters the following, it fails:
    class RodauthApp < Rodauth::Rails::App
      configure RodauthMain do
        enable :become_account
      end
      # ...
    end
    
  6. When I first implemented TinyAdmin, I found that I had to explicitly require it at the top of my rodauth_app.rb:
    # The gem
    require "tiny_admin"
    # The local config for the gem
    require_relative "tiny_admin"
    
    class RodauthApp < Rodauth::Rails::App
    
  7. I haven't similarly required rodauth-become_account yet, but I expect it will fix the issue, now that I've typed this up... except of course the require statement would be: require "rodauth/features/become_account", and if I do that before requiring tiny_admin, maybe I can have it load before zeitwerk, if that matters.

My guess is that roda plugin gems need to be explicitly required, since they likely won't follow the bundler pattern, and they seem to be capable of hitting an edge case in zeitwerk as well.

Again, I am not able to reproduce this outside my deployed docker environments. I can't make it fail locally, even with Rails eager loading turned on.

Posting it here for awareness, in case anyone has any ideas, and perhaps @jeremyevans has some insight into how plugin authors might mitigate this by either following the rubygems/bundler pattern of having a root lib file of the gem's name where expected, or insight into something I've missed.

Will update when I have a fix!

@pboling
Copy link
Author

pboling commented May 3, 2024

One root of the issue (or perhaps better stated as the reason this issue became apparent) is the non-conformity of the plugin to bundler/rubygems standards for the default entry-point load files:
Screenshot 2024-05-04 at 06 17 39

A normal entry point for this gem name, IIRC, would have been lib/rodauth/become_account.rb, but also, the path being attempted is the path in the screenshot, so the right thing is being attempted, and it is unclear how it is failing.

@pboling
Copy link
Author

pboling commented May 3, 2024

Also, very interesting to note that (timestamps removed):

<internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- rodauth/features/become_account (LoadError)
from <internal:/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require'
from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in `require'
from /apps/my_app/vendor/bundle/ruby/3.2.0/gems/rodauth-2.34.0/lib/rodauth.rb:354:in `load_feature'

rodauth is doing load_feature, which calls require, and this is hijacked by both zeitwerk, and bootsnap, and it ends up failing!

@jeremyevans
Copy link
Owner

Unfortunately, I don't have any insight here. The LoadError you are seeing is for the correct path (rodauth/features/become_account), so it isn't attempting to load the wrong path and failing. The only thing I can think of is the rodauth-become_account gem lib directory is not in the ruby load path at the point the require is made. Maybe it's due to the combination of bootsnap and zeitwerk?

As you suspected, it isn't a bug in Roda, so I'll close this. However, if you find out more regarding the cause, I'd be interested.

@pboling
Copy link
Author

pboling commented May 3, 2024

The only thing I can think of is the rodauth-become_account gem lib directory is not in the ruby load path at the point the require is made

My deepest fear is that my dependencies are not deterministically loaded into my published Docker images... Really hoping that isn't the case, but I'm working with an extremely legacy build incantation that still uses "eye of newt" as an ingredient.

@pboling
Copy link
Author

pboling commented May 3, 2024

My deepest fear was true. Sorry for the waste of time!

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

No branches or pull requests

2 participants