Skip to content

CI: Add --add-opens in order to support JDK11 #2148

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

Merged
merged 3 commits into from
Oct 15, 2019

Conversation

olleolleolle
Copy link
Contributor

@olleolleolle olleolleolle commented Jul 9, 2019

This PR adds a few ENV variables to the JAVA_OPTS, in order to make openjdk11 oraclejdk11 not output warnings (and illegal reflective access).

 java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to module org.jruby.dist

(I think I will run this a few times.)

See #2147


@olleolleolle olleolleolle marked this pull request as ready for review July 9, 2019 20:13
@olleolleolle
Copy link
Contributor Author

(Oh, that failed miserably. Somehow, the formatting does not do the right thing.)

@olleolleolle
Copy link
Contributor Author

Haha, without quotes was another disaster:

image

@olleolleolle
Copy link
Contributor Author

@JonRowe Do you know a way to use multi-line & still have it understand the settings?

@JonRowe
Copy link
Member

JonRowe commented Jul 11, 2019

The quotes worked to set the env, why that didn't fix Jruby 🤷‍♂

@olleolleolle
Copy link
Contributor Author

OK, thanks!

I squashed the PR into 1 commit, and that takes me to "Selenium has a tough time loading".

No warnings about --add-opens.

We are in the place I wanted to get to.

@benoittgt
Copy link
Member

Hello @olleolleolle

I still have breaking build

undle binstubs bundler rspec-core rake --force

rm config/application.rb

bin/rake app:template LOCATION='../../example_app_generator/generate_stuff.rb'

rake aborted!

LoadError: load error: childprocess/jruby -- java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to module org.jruby.dist

/home/travis/build/rspec/bundle/jruby/2.5.0/gems/childprocess-1.0.1/lib/childprocess.rb:210:in `<main>'

/home/travis/build/rspec/bundle/jruby/2.5.0/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver.rb:1:in `<main>'

/home/travis/build/rspec/bundle/jruby/2.5.0/gems/selenium-webdriver-3.142.3/lib/selenium/webdriver.rb:20:in `<main>'

/home/travis/build/rspec/bundle/jruby/2.5.0/gems/selenium-webdriver-3.142.3/lib/selenium-webdriver.rb:1:in `block in (root)'

/home/travis/build/rspec/bundle/jruby/2.5.0/gems/selenium-webdriver-3.142.3/lib/selenium-webdriver.rb:20:in `block in <main>'

/home/travis/build/rspec/rspec-rails/tmp/example_app/config/application.rb:7:in `<main>'

/home/travis/build/rspec/rspec-rails/tmp/example_app/Rakefile:1:in `block in (root)'

/home/travis/build/rspec/rspec-rails/tmp/example_app/Rakefile:4:in `<main>'

(See full trace by running task with --trace)

rake aborted!

Command failed with status (1): [bin/rake app:template LOCATION='../../exam...]

/home/travis/build/rspec/rspec-rails/Rakefile:109:in `block in in_example_app'

/home/travis/build/rspec/rspec-rails/Rakefile:107:in `block in in_example_app'

/home/travis/build/rspec/rspec-rails/Rakefile:106:in `in_example_app'

/home/travis/build/rspec/rspec-rails/Rakefile:96:in `block in <main>'

/home/travis/build/rspec/bundle/jruby/2.5.0/gems/rake-12.3.3/exe/rake:27:in `<main>'

Tasks: TOP => smoke:app => generate:stuff

(See full trace by running task with --trace)

The command "script/run_build 2>&1" exited with 1.

https://travis-ci.org/rspec/rspec-rails/jobs/557328064

@olleolleolle olleolleolle changed the title CI: Add --add-opens CI: Add --add-opens in order to support JDK11 Oct 15, 2019
@olleolleolle olleolleolle requested a review from JonRowe October 15, 2019 12:54
@JonRowe
Copy link
Member

JonRowe commented Oct 15, 2019

Can you remind me what this is fixing @olleolleolle?

@olleolleolle
Copy link
Contributor Author

Yes, this makes this JRuby build and run on current JDKs.

  • The --add-opens directives allow reflection on classes
  • With those in place, we can run on the currently-supported JDKs (9 and newer)

If we have older JDKs active, (JDK8, only, at the moment), we can forgo the --add-opens directives.

@JonRowe JonRowe merged commit 9e48616 into rspec:4-0-dev Oct 15, 2019
@olleolleolle olleolleolle deleted the 4-0-java-opts branch October 15, 2019 14:10
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