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

Topic/modularize #577

Closed
wants to merge 9 commits into from
Closed

Topic/modularize #577

wants to merge 9 commits into from

Conversation

skaldarnar
Copy link
Member

No description provided.

jdrueckert and others added 5 commits May 8, 2020 15:13
* wip: Fix module running:
  * downgraded logback version : https://jira.qos.ch/browse/LOGBACK-1491
  * add required github.api and com.fasterxml.databind(required github.api)
  * cherrypick module-info.java from old PR for java 11
  * fix mainClassName (mainModule makes automatically)

* wip: Fix test running: add implicit exports module for jupiter module (gradle try run tests in module path, if without it)
Some refactoring for module-info.java

* wip: ignore module-info.java for checkstyle

* Update module-info.java with commonmark
@keturn
Copy link
Member

keturn commented May 20, 2020

Trying this out. Observations so far:

  1. We're going to have to figure out how to attach a debugger to the built application. The rebuild time is long enough to make debugging-by-println no fun.
  2. This is a problem:
    public static Path getInstallationDirectory() {
    final URL location = LauncherDirectoryUtils.class.getProtectionDomain().getCodeSource().getLocation();

    it comes back with something under jrt:/, which is some virtual filesystem it has dreamed up for the runtime components, I guess. It's read-only.
    and even if it did come back with the location of the executable on the real filesystem, the deb installer puts it a place that's not writable by users (and presumably the same is true for rpm).
    I am also worried that this is another branch of orphaned code? are these directories actually used? because they're different than the values BaseLauncherSettings reported loading.

also, not related to packaging, but I'm worried the way BundleUtils and LauncherManagedDirectory obfuscates the resource identifier enough that nothing ever noticed that resource doesn't exist.

`{}` is for logs.
String.format uses printf-style `%` placeholders.
apparently trying to create a directory on a read-only filesystem is an UnsupportedOperation, not a IOException.
@keturn
Copy link
Member

keturn commented May 20, 2020

Just for the sake of experimentation, to see how far it would get, I commented out chunks of LauncherInitTask until it wasn't trying to do impossible filesystem things anymore.

And ... it works? it's a bit dodge, as I haven't been too careful about which parts of the init I cut out, and I suspect it's currently trying to show me an error dialog that's zero pixels wide, but it does display the main stage and attempt to run the game.

terasology-jpackage

I think that's your proof-of-concept.

Also, after all that worry we had about finding a jdk distribution with javafx, Idea is telling me in modules-info that there are two things providing the javafx modules. I think we must get one from liberica and one from the gradle javafx plugin.

@keturn
Copy link
Member

keturn commented May 21, 2020

I have been poking around with this modularization stuff in an effort to see if it's a blocker for merging #562, and I have not been having a good day of it.

From the CodeFX blog, by the author of the book The Java Module System:

As an example, as of August 2019, the newest versions of IntelliJ, Eclipse, and Surefire all run tests of a module differently: […]
The JPMS Maturity Model

which led me to a discussion on IDEA's tracker about testing, which seems to be far from resolved.

and this article on Testing in the Modular World.

It's left me feeling resigned and pessimistic about this.

Earlier, I thought this was going to take some work, and I had my doubts about the return on investment, but I honestly didn't think it was going to be this hard. I thought we were going to have to learn some things and some new tools but the path would be well-charted.

And now, well… I'm reminded of Python 3 a few years back. When there was one big group of people saying "Python 3 has been out for five years, get on board with the new program already!", and another group of people who had a lot of code to keep running and they and had no desire to dive in to compatibility-breaking changes with a rocky transition plan.

@keturn
Copy link
Member

keturn commented May 21, 2020

So. Maybe I am having a bad day, and this will all look clearer on another day to someone with brighter eyes.

But right now I am trying to figure out next steps for the other branches.

  • I could assume that the spf4j-slf4j-test situation is uniquely bad, given how the whole spf4j-binding thing is the poster child for "classpath conflicts are horrible." If that's the case, we mothball that branch, and I cut any log-testing bits out of Game Runner thread / subprocess improvements #571.

then either

  • Game Runner thread / subprocess improvements #571 works against this branch with minimal headache, or
  • it doesn't, because of something about TestFX, or Monocle, or ▁▁▁▁?
  • we turn in to Java Professional Modularizing Specialists, make 💰 from companies trying to move off of Java 8 before their support contracts are due for renewal, and use it to fund TSOC stipends because we don't actually have any time for Terasology dev anymore.

any other suggestions?

@skaldarnar skaldarnar closed this Dec 19, 2021
@skaldarnar skaldarnar deleted the topic/modularize branch December 19, 2021 16:47
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.

4 participants