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

Java 9 module-info.java ruminations #4835

Open
raelik opened this issue Nov 1, 2017 · 24 comments
Open

Java 9 module-info.java ruminations #4835

raelik opened this issue Nov 1, 2017 · 24 comments

Comments

@raelik
Copy link

raelik commented Nov 1, 2017

After Java 9 compatibility is made tentatively available in 9.1.14, discussions need to be had on how best to set up jRuby's module-info.java file(s) for the Java Platform Module System now available in Java 9.

@headius
Copy link
Member

headius commented Nov 1, 2017

We will also need to modularize the libraries we package, including but not limited to:

  • All the JNR libraries
  • bytelist/jcoding/joni
  • utility and JVM shim libraries (invokebinder already done)

We also package several third-party libs and will want to see if they've started modularizing.

@headius headius added this to the JRuby 9.2.0.0 milestone Nov 1, 2017
@headius
Copy link
Member

headius commented Nov 1, 2017

Tentatively marked for 9.2.

One big wrinkle here is that if we start including module-info in a project, we're going to need Java 9 tooling to build it. That's not a huge leap for some of the libraries, since we control them and are generally the only ones maintaining them, but JRuby itself is built by and for many different systems, some of which may not have Java 9 for a while.

@raelik
Copy link
Author

raelik commented Nov 1, 2017

@headius Maybe just a separate build target for a modularized Java 9 deployment that includes the module-info, akin to how there are currently binary, Windows executable, source and complete jar packages of the jRuby release.

@headius
Copy link
Member

headius commented Nov 10, 2017

I'm trying to wrap up my day, but perhaps @raelik or someone else observing this issue can research whether there are any ways to build module-info.java without a Java 9 install present. I know we can make this produce a jar that works on Java 7 or 8, as I did in https://github.com/headius/invokedynamic.

@raelik
Copy link
Author

raelik commented Nov 13, 2017

@headius as far as I can see, the syntax of the module-info.java file is only understood by Java 9's javac.

@headius
Copy link
Member

headius commented Nov 20, 2017

@raelik Yeah, I'm just wondering if there's a way to pull down OpenJDK 9's javac or an equivalent javac that understand module-info.java without running on 9.

@headius
Copy link
Member

headius commented May 17, 2018

We will put more focus into module support over the summer in preparation for the Java 11 LTS release.

@headius headius modified the milestones: JRuby 9.2.0.0, JRuby 9.2.1.0 May 17, 2018
@headius
Copy link
Member

headius commented Oct 11, 2018

Some of our deps have been modularized: jcodings, joni. The bytelist library has been rolled back into JRuby proper due to duplicated packages.

The jnr projects still need to be modularized.

I added an automatic module name in 681ab22.

More to come, ideally with full proper modularization in 9.2.2.

@headius
Copy link
Member

headius commented Mar 6, 2021

#6596 removes BSF entirely to dodge that whole issue.

@headius
Copy link
Member

headius commented Mar 6, 2021

jzlib appears to no longer be maintained. I am trying to ascertain its status, but we may be forced to take over the library (perhaps with the help of others) in order to modularize it.

ymnk/jzlib#25

I believe for libraries that do not have module support, we could just continue shading them... but ideally we would have proper modules up and down the JRuby dependency stack.

@headius
Copy link
Member

headius commented Mar 6, 2021

Missed dependency: com.martiansoftware:nailgun-server

I would propose that we finally remove the rest of Nailgun support in 9.3.

headius added a commit to headius/jruby that referenced this issue Mar 6, 2021
This removes all references to the Apache Bean Scripting Framework
except for the configurable BSF mode in our ScriptingContainer.

Relates to jruby#4835
@headius
Copy link
Member

headius commented Mar 6, 2021

Nailgun support was partially removed in #5981 and the rest is removed in #6597.

@headius
Copy link
Member

headius commented Mar 6, 2021

joda-time has module support and we are on the latest.

@headius
Copy link
Member

headius commented Mar 6, 2021

org.apache.ant:ant and org.osgi:org.osgi.core are not shipped with JRuby and may not need modularity. Unsure how sources in JRuby that optionally depend on osgi will work in a module environment.

@slonopotamus
Copy link

Why JRuby cannot just use java.util.zip.Deflater/java.util.zip/Inflater instead of JZLib?

@headius
Copy link
Member

headius commented Mar 10, 2021

@slonopotamus I don't recall the exact features, but there are some low-level aspects of zlib exposed by the Ruby library that we could not get from the built-in deflater and inflater. It is possible those features have been exposed in the decade since we switched to jzlib, but I have not done that audit.

If we can eliminate jzlib that would be a positive... not because there's anything wrong with it as a library but because it would be one less dependency.

@headius
Copy link
Member

headius commented Mar 10, 2021

@slonopotamus I was curious so I dug back to this commit, which was the first move to JZlib: 908cd08

The commits this squashed explain some of the behaviors we could not get out of the default JDK library, such as:

  • Various specific error conditions hidden behind java.util.zip's generic exceptions
  • Methods that could not be supported: GzipReader#unused, GzipWriter#sync, GzipWriter#sync=, GzipWriter#flush

It would be great if we could do everything with java.util.zip (if possible) but it is not a priority for us right now. We would happily support anyone that wanted to attempt it!

@headius
Copy link
Member

headius commented May 24, 2021

Linking to #6598 which has been punted to 9.4. The issues are listed there, but most of the to-do's in this issue are resolved. Nearly all libraries have at least an automatic module name, and we will try to get full descriptors into them for 9.4. Unfortunately JDK-8263432 prevents us from doing this modularization move in 9.3.

@headius headius modified the milestones: JRuby 9.3.0.0, JRuby 9.4.0.0 May 24, 2021
@headius
Copy link
Member

headius commented Nov 16, 2022

This one needs to keep getting kicked down the road. We have made great improvements to module support in 9.3 and 9.4, but we still cannot build cleanly with modules active and we have several libraries that attempt to cross module boundaries illegally.

Punting to 9.4.1, because we really need to fix this before 9.5.

@headius headius modified the milestones: JRuby 9.4.0.0, JRuby 9.4.1.0 Nov 16, 2022
@enebo enebo modified the milestones: JRuby 9.4.1.0, JRuby 9.4.2.0 Jan 31, 2023
@headius headius modified the milestones: JRuby 9.4.2.0, JRuby 9.4.3.0 Mar 1, 2023
@headius headius modified the milestones: JRuby 9.4.3.0, JRuby 9.4.4.0 Jun 6, 2023
@headius
Copy link
Member

headius commented Oct 10, 2023

Remaining work needs to happen in 9.5 but we are functioning well under all JPMS versions of JDK currently.

@headius headius modified the milestones: JRuby 9.4.4.0, JRuby 9.5.0.0 Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants