rails / mission_control-jobs

Dashboard and Active Job extensions to operate and troubleshoot background jobs
MIT License
611 stars 71 forks source link

Circular dependency warning #170

Closed cedricpim closed 2 weeks ago

cedricpim commented 1 month ago

I am currently seeing a circular dependency warning with this gem. I am on ruby version: ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]

Here is the backtrace:

/usr/local/lib/ruby/3.3.0/bundled_gems.rb:75: warning: /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75: warning: loading in progress, circular require considered harmful - /usr/local/rvm/gems/default/gems/mission_control-jobs-0.3.1/lib/mission_control/jobs/engine.rb
    from bin/rails:4:in  `<main>'
    from /usr/local/rvm/gems/default/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in  `require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `block (2 levels) in replace_require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `require'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/commands.rb:18:in  `<main>'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/command.rb:69:in  `invoke'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/command.rb:149:in  `with_argv'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/command.rb:71:in  `block in invoke'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/command/base.rb:73:in  `perform'
    from /usr/local/rvm/gems/default/gems/thor-1.3.1/lib/thor.rb:527:in  `dispatch'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/command/base.rb:178:in  `invoke_command'
    from /usr/local/rvm/gems/default/gems/thor-1.3.1/lib/thor/invocation.rb:127:in  `invoke_command'
    from /usr/local/rvm/gems/default/gems/thor-1.3.1/lib/thor/command.rb:28:in  `run'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/commands/console/console_command.rb:105:in  `perform'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/command/actions.rb:19:in  `boot_application!'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/command/environment_argument.rb:31:in  `require_application!'
    from /usr/local/rvm/gems/default/gems/railties-7.1.4/lib/rails/command/actions.rb:15:in  `require_application!'
    from /usr/local/rvm/gems/default/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in  `require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `block (2 levels) in replace_require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `require'
    from /app/config/application.rb:32:in  `<main>'
    from /usr/local/rvm/gems/default/gems/bundler-2.5.3/lib/bundler.rb:187:in  `require'
    from /usr/local/rvm/gems/default/gems/bundler-2.5.3/lib/bundler/runtime.rb:44:in  `require'
    from /usr/local/rvm/gems/default/gems/bundler-2.5.3/lib/bundler/runtime.rb:44:in  `each'
    from /usr/local/rvm/gems/default/gems/bundler-2.5.3/lib/bundler/runtime.rb:51:in  `block in require'
    from /usr/local/rvm/gems/default/gems/bundler-2.5.3/lib/bundler/runtime.rb:73:in  `rescue in block in require'
    from /usr/local/rvm/gems/default/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in  `require'
    from /usr/local/rvm/gems/default/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in  `require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `block (2 levels) in replace_require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `require'
    from /usr/local/rvm/gems/default/gems/mission_control-jobs-0.3.1/lib/mission_control/jobs.rb:2:in  `<main>'
    from /usr/local/rvm/gems/default/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in  `require'
    from /usr/local/rvm/gems/default/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in  `require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `block (2 levels) in replace_require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `require'
    from /usr/local/rvm/gems/default/gems/mission_control-jobs-0.3.1/lib/mission_control/jobs/engine.rb:2:in  `<main>'
    from /usr/local/rvm/gems/default/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in  `require'
    from /usr/local/rvm/gems/default/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in  `require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `block (2 levels) in replace_require'
    from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in  `require'

The line causing this issue appears to be this one: https://github.com/rails/mission_control-jobs/blob/main/lib/mission_control/jobs/engine.rb#L2. Seems to me that it can just be removed, tried to track down why it was added but there was no explicit reason.

Let me know if I should provide more details.

rosa commented 2 weeks ago

Sorry for the delay on this one! You're right, this should be removed, and I'm not sure why it was added either 😅