Skip to content

jar-dependencies cannot be updated out-of-band from jruby #7262

@ccutrer

Description

@ccutrer

I want to make feature improvements to jar-dependencies, but when I install the updated gem into my system, bundler will refuse to load it because the default gem has already been installed. I've determined that the problem is that the rubygems/defaults/jruby.rb requires a file from jar-dependencies extremely early in the boot process of any jruby process in order to hook into the rubygems install process. I plan on resolving this and sending PRs for both jruby and jar-dependencies, but want a tracking ticket first since it spans both projects.

Environment Information

  • jruby 9.3.1.0 (2.6.8) 2021-10-13 2e01e7199d OpenJDK 64-Bit Server VM 11.0.15+10-Ubuntu-0ubuntu0.22.04.1 on 11.0.15+10-Ubuntu-0ubuntu0.22.04.1 [linux-x86_64]
  • Linux opennuc 5.15.0-37-generic #39-Ubuntu SMP Wed Jun 1 19:16:45 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

Gemfile:

gem "jar-dependencies", "~> 1.0" # installed manually locally; no actual code changes required other than the change in version number

Running bundle console should boot without error.

Actual Behavior

cody@opennuc:~/test$ bundle console
[DEPRECATED] bundle console will be replaced by `bin/console` generated by `bundle gem <name>`
[DEPRECATED] This Gemfile does not include an explicit global source. Not using an explicit global source may result in a different lockfile being generated depending on the gems you have installed locally before bundler is run. Instead, define a global source in your Gemfile like this: source "https://rubygems.org".
Resolving dependencies...
Gem::LoadError: You have already activated jar-dependencies 0.4.1, but your Gemfile requires jar-dependencies 1.0.0. Since jar-dependencies is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports jar-dependencies as a default gem.
  check_for_activated_spec! at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/runtime.rb:309
                      setup at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/runtime.rb:25
                       each at org/jruby/RubyArray.java:1865
                       each at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/spec_set.rb:140
                        map at org/jruby/RubyEnumerable.java:799
                      setup at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/runtime.rb:24
                      setup at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler.rb:162
                    require at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler.rb:187
                        run at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/cli/console.rb:15
                    console at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/cli.rb:513
                        run at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/vendor/thor/lib/thor/command.rb:27
             invoke_command at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/vendor/thor/lib/thor/invocation.rb:127
                   dispatch at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/vendor/thor/lib/thor.rb:392
                   dispatch at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/cli.rb:31
                      start at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/vendor/thor/lib/thor/base.rb:485
                      start at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/cli.rb:25
                     <main> at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/exe/bundle:48
       with_friendly_errors at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/lib/bundler/friendly_errors.rb:120
                     <main> at /home/cody/.gem/jruby/2.6.8/gems/bundler-2.3.17/exe/bundle:36
                       load at org/jruby/RubyKernel.java:1052
                     <main> at /home/cody/.gem/jruby/2.6.8/bin/bundle:25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions