Skip to content

Modularize all the things #8455

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

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Modularize all the things #8455

wants to merge 24 commits into from

Conversation

headius
Copy link
Member

@headius headius commented Nov 24, 2024

Rebased modularity code atop recent 10-dev.

See #6598.

* Use newer backport9 to access Java 8 StackWalker
* Add module-info for modules we require
* Copy jruby-base jar and deps into lib/modules
* Modify jruby.bash to handle unshaded jruby and deps as classpath
  or module path entries
* Restructure build for module-info.java

There's a remaining issue here to build: CallSite and Main have
sibling packages with the same name as lowercase, and that appears
to be rejected by the build currently.
Ant is no longer maintained, and as a result there's no module-
based version of its jar. We must move this out to a separate
library that can be used at build time, such as during JRuby's own
uses of the Rake ant targets.
We only have this dependency due to the @generated annotation we
add to some generated sources, but neither we nor anyone else ever
consumes that annotation.
Default scope for copy-dependencies is "test", which copies all
runtime, provided, and test dependencies. We only want runtime in
lib/modules.
This patch makes it possible to boot JRuby fully modularized. A
few notes:

* The org.jruby.base module is now open, because I was too lazy
  to individually open all of the Ruby kernel paths and there is
  no way to open them recursively from module-info.
* Ruby "kernel" sources have been moved into org.jruby.kernel to
  aid in accessing them in a module-friendly way. This does,
  unfortunately, result in paths like
  org/jruby/kernel/kernel/kernel.rb. An alternative name may be in
  order.
Using lookup() appears to return a Lookup object that is stricter
about access restrictions from a parent module to a child
classloader with no module. In this case, the variables in the
reified object classes are to be wired up in accessors. Using the
lookup() version results in an error:

java.lang.IllegalAccessException: symbolic reference class is not accessible: class org.jruby.gen.RubyObject5, from class org.jruby.specialized.RubyObjectSpecializer (module org.jruby.base)
Without this you cannot incrementally build. For some reason clean
build still works.
* Drop another Ant reference in favor of Java 11 Files.readString.
* Remove unnecessary and absent java.xml.ws.annotation module.
This was added as a dependency prior to modularization, but the
modularization work was rebased on top of a more recent version.
@headius headius added this to the JRuby 10.0.0.0 milestone Nov 24, 2024
@headius headius changed the base branch from 10-dev to master March 10, 2025 22:05
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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy