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

Basic smoke test with warbler no longer works with jruby-jars-9.2.10 #6083

Closed
deivid-rodriguez opened this issue Feb 19, 2020 · 7 comments · Fixed by #6084
Closed

Basic smoke test with warbler no longer works with jruby-jars-9.2.10 #6083

deivid-rodriguez opened this issue Feb 19, 2020 · 7 comments · Fixed by #6084

Comments

@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Feb 19, 2020

Environment Information

  • Jruby version seems unimportant, but the jruby-jars gem version needs to be 9.2.10.0
  • Operating system and platform: Linux x86_64

Expected Behavior

The test is this Github workflow:

https://github.com/rubygems/bundler/blob/c65280dd3f52b4b551bb3bb1ca6ab114d6a4af5c/.github/workflows/jruby.yml

name: jruby

on:
  pull_request:

  push:
    branches:
      - staging
      - trying

jobs:
  warbler:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1

      - name: Setup ruby
        uses: eregon/use-ruby-action@v1
        with:
          ruby-version: jruby-9.2.9.0

      - name: Install local bundler
        run: bin/rake install:local

      - name: Run a warbler project
        run: |
          cd spec/realworld/fixtures/warbler
          bundle install
          bundle exec warble
          java -jar warbler.jar

which uses the following Gemfile

# frozen_string_literal: true

source "https://rubygems.org"

gem "demo", :path => "./demo"
gem "jruby-jars", "~> 9.2"
gem "warbler", "~> 2.0"

where demo includes a only a dummy gemspec, and bin/warbler-example.rb contains just puts require "bundler/setup".

  • Describe your expectation of how JRuby should behave, perhaps by showing how CRuby/MRI behaves.

Pinning jruby-jars to 9.2.9.0 prints true as expected.

  • Describe or show the actual behavior.

Using jruby-jars 9.2.10.0 instead crashes with the following error:

 Fetching gem metadata from https://rubygems.org/..
Resolving dependencies.....
Fetching rake 13.0.1
Installing rake 13.0.1
Using bundler 2.2.0.dev
Using demo 1.0 from source at `demo`
Fetching jruby-jars 9.2.10.0
Installing jruby-jars 9.2.10.0
Fetching jruby-rack 1.1.21
Installing jruby-rack 1.1.21
Fetching rubyzip 1.3.0
Installing rubyzip 1.3.0
Fetching warbler 2.0.5
Installing warbler 2.0.5
Bundle complete! 3 Gemfile dependencies, 7 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
rm -f warbler.jar
Creating warbler.jar
LoadError: no such file to load -- bundler/shared_helpers
  require at org/jruby/RubyKernel.java:974
  require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54
   <main> at uri:classloader:/META-INF/init.rb:21
  require at org/jruby/RubyKernel.java:974
  require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54
   <main> at <script>:2
ERROR: org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- bundler/shared_helpers
##[error]Process completed with exit code 1.

Link to CI log: https://github.com/rubygems/bundler/runs/453791482.

I believe this is related to the rubygems upgrade made in jruby-9.2.10.0.

Let me know if this should be tracked/reported somewhere else like the warbler project, or rubygems itself.

Thanks!

@headius
Copy link
Member

headius commented Feb 19, 2020

This also seems likely to be tied to changes in RubyGems. We did some brief investigation of two failures (that we thought were minor and unlikely to affect anyone) when we upgrade to RubyGems 3.0.6, but apparently we were too optimistic.

See #6060 for the information we have so far along with the tests that were disabled.

@enebo enebo added this to the JRuby 9.2.11.0 milestone Feb 19, 2020
@headius
Copy link
Member

headius commented Feb 19, 2020

We need to get this smoke test into our CI, which is currently Travis. Can you help?

headius added a commit to headius/jruby that referenced this issue Feb 19, 2020
Dir.glob was treating any passed-in `base` path as a normal file
path, which cause it to treat URIs as a relative path. The logic
then proceeded to prepend the cwd to this URI, producing a
nonsense path.

This patch uses File.expand_path logic to acquire the base path,
which keeps it a URI and allows the rest of glob to handle it
as if the glob and base were expanded before calling Dir.glob.

The change means that the two following Dir.glob calls work the
same, fixing the issues discovered in jruby#6060. It will very likely
also fix the issues reported in jruby#6082 and jruby#6083.

Fixes jruby#6060
Fixes jruby#6082
Fixes jruby#6083
@headius
Copy link
Member

headius commented Feb 19, 2020

I have pushed a likely fix in #6084 that gets the tests from #6060 and the asciidoctor example from #6082 working. If you can that on jruby-9.2 branch (once it's merged) it would provide extra coverage.

Can you turn your smoke test into a complete repository, or a PR for JRuby's Travis CI? I'm not sure how to run it.

@deivid-rodriguez
Copy link
Contributor Author

Thanks for fixing this 💜.

We need to get this smoke test into our CI, which is currently Travis. Can you help?

I can try although I'm not too familiar with your CI. Where in the project heirarchy should I place the dummy test project? Is there another example of such a high level integration test?

@deivid-rodriguez
Copy link
Contributor Author

The test project is here.

Running

bundle install
bundle exec warble
java -jar warbler.jar

inside that test project should trigger the issue.

@deivid-rodriguez
Copy link
Contributor Author

Also, this is the sample project as a separate repo that was provided to us when we added the scenario to our CI, in this bundler ticket.

@headius
Copy link
Member

headius commented Feb 19, 2020

That's a good start for us, thank you. As an example, you can see how we test sequel in CI. Basically just clone it and run its tests. Smaller integration tests could go in our repo, or remain as a separate repo (possibly owned by jruby organization if it's not a standalone project).

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 a pull request may close this issue.

3 participants