bigdataviewer / bigdataviewer-core

ImgLib2-based viewer for registered SPIM stacks and more
BSD 2-Clause "Simplified" License
33 stars 35 forks source link

JPMS compatibility broken by e.g. net.imglib2.display classes outside of original package #172

Closed skalarproduktraum closed 1 month ago

skalarproduktraum commented 5 months ago

Hey @tpietzsch,

while trying to get scenery ready to work correctly with the JPMS, the compiler bailed on me, complaining the bigdataviewer-core brings along classes that violate package constraints:

Unfortunately, the only way to actually fix this is to move them to the package they actually belong to, so the imglib2 package. Would you be open to that? I'd be happy to create PRs for those repositories to make the corresponding changes 👍

skalarproduktraum commented 5 months ago

Poke @tpietzsch :)

skalarproduktraum commented 4 months ago

Pokepoke @tpietzsch :)

skalarproduktraum commented 2 months ago

When compiling scenery on the enhancement/jpms-compatibility branch at the moment, the compiler bails with

> Task :compileJava FAILED
warning: using incubating module(s): jdk.incubator.vector
error: the unnamed module reads package net.imglib2.display from both net.imglib2 and bdv
error: the unnamed module reads package bdv.util from both bdv.util and bdv
error: module bdv reads package net.imglib2.display from both net.imglib2 and bdv
error: module bdv reads package bdv.util from both bdv.util and bdv
error: module bvv reads package net.imglib2.display from both net.imglib2 and bdv
error: module bvv reads package bdv.util from both bdv.util and bdv
error: module bdv.util reads package net.imglib2.display from both net.imglib2 and bdv
error: module bdv.util reads package bdv.util from both bdv.util and bdv
error: module net.imagej.ops reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imagej.ops reads package bdv.util from both bdv.util and bdv
error: module net.imglib2.algorithm reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imglib2.algorithm reads package bdv.util from both bdv.util and bdv
error: module io.scif reads package net.imglib2.display from both net.imglib2 and bdv
error: module io.scif reads package bdv.util from both bdv.util and bdv
error: module net.imagej reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imagej reads package bdv.util from both bdv.util and bdv
error: module net.imglib2.roi reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imglib2.roi reads package bdv.util from both bdv.util and bdv
error: module mpicbg.spim.data reads package net.imglib2.display from both net.imglib2 and bdv
error: module mpicbg.spim.data reads package bdv.util from both bdv.util and bdv
error: module jitk.spline reads package net.imglib2.display from both net.imglib2 and bdv
error: module jitk.spline reads package bdv.util from both bdv.util and bdv
error: module org.scijava.ui.swing.script reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.ui.swing.script reads package bdv.util from both bdv.util and bdv
error: module org.scijava.plugins.scripting.jython reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.plugins.scripting.jython reads package bdv.util from both bdv.util and bdv
error: module org.scijava.ui.behaviour reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.ui.behaviour reads package bdv.util from both bdv.util and bdv
error: module org.janelia.saalfeldlab.n5 reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.janelia.saalfeldlab.n5 reads package bdv.util from both bdv.util and bdv
error: module org.scijava reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava reads package bdv.util from both bdv.util and bdv
error: module org.scijava.search reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.search reads package bdv.util from both bdv.util and bdv
error: module net.imagej.mesh reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imagej.mesh reads package bdv.util from both bdv.util and bdv
error: module org.scijava.plugins.scripting.javascript reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.plugins.scripting.javascript reads package bdv.util from both bdv.util and bdv
error: module org.scijava.minimaven reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.minimaven reads package bdv.util from both bdv.util and bdv
error: module org.scijava.ui.swing reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.ui.swing reads package bdv.util from both bdv.util and bdv
error: module org.scijava.table reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.table reads package bdv.util from both bdv.util and bdv
error: module org.scijava.plot reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.plot reads package bdv.util from both bdv.util and bdv
error: module org.scijava.ui.awt reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.ui.awt reads package bdv.util from both bdv.util and bdv
error: module com.sun.jna.platform reads package net.imglib2.display from both net.imglib2 and bdv
error: module com.sun.jna.platform reads package bdv.util from both bdv.util and bdv
error: module de.javakaffee.kryoserializers reads package net.imglib2.display from both net.imglib2 and bdv
error: module de.javakaffee.kryoserializers reads package bdv.util from both bdv.util and bdv
error: module com.esotericsoftware.kryo reads package net.imglib2.display from both net.imglib2 and bdv
error: module com.esotericsoftware.kryo reads package bdv.util from both bdv.util and bdv
error: module org.jfree.jfreechart reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.jfree.jfreechart reads package bdv.util from both bdv.util and bdv
error: module org.scijava.parsington reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.parsington reads package bdv.util from both bdv.util and bdv
error: module org.scijava.listeners reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.listeners reads package bdv.util from both bdv.util and bdv
error: module net.imglib2.cache reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imglib2.cache reads package bdv.util from both bdv.util and bdv
error: module org.scijava.optional reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.scijava.optional reads package bdv.util from both bdv.util and bdv
error: module net.imglib2.algorithm.fft2 reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imglib2.algorithm.fft2 reads package bdv.util from both bdv.util and bdv
error: module com.github.benmanes.caffeine reads package net.imglib2.display from both net.imglib2 and bdv
error: module com.github.benmanes.caffeine reads package bdv.util from both bdv.util and bdv
error: module org.checkerframework.checker.qual reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.checkerframework.checker.qual reads package bdv.util from both bdv.util and bdv
error: module org.apache.commons.compress reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.apache.commons.compress reads package bdv.util from both bdv.util and bdv
error: module org.apache.commons.io reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.apache.commons.io reads package bdv.util from both bdv.util and bdv
error: module org.apache.commons.lang3 reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.apache.commons.lang3 reads package bdv.util from both bdv.util and bdv
error: module dev.dirs reads package net.imglib2.display from both net.imglib2 and bdv
error: module dev.dirs reads package bdv.util from both bdv.util and bdv
error: module com.google.errorprone.annotations reads package net.imglib2.display from both net.imglib2 and bdv
error: module com.google.errorprone.annotations reads package bdv.util from both bdv.util and bdv
error: module org.jdom2 reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.jdom2 reads package bdv.util from both bdv.util and bdv
error: module org.jfree.jfreesvg reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.jfree.jfreesvg reads package bdv.util from both bdv.util and bdv
error: module org.jgrapht.core reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.jgrapht.core reads package bdv.util from both bdv.util and bdv
error: module org.jheaps reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.jheaps reads package bdv.util from both bdv.util and bdv
error: module com.sun.jna reads package net.imglib2.display from both net.imglib2 and bdv
error: module com.sun.jna reads package bdv.util from both bdv.util and bdv
error: module com.esotericsoftware.minlog reads package net.imglib2.display from both net.imglib2 and bdv
error: module com.esotericsoftware.minlog reads package bdv.util from both bdv.util and bdv
error: module com.esotericsoftware.reflectasm reads package net.imglib2.display from both net.imglib2 and bdv
error: module com.esotericsoftware.reflectasm reads package bdv.util from both bdv.util and bdv
error: module org.lz4.java reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.lz4.java reads package bdv.util from both bdv.util and bdv
error: module org.objenesis reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.objenesis reads package bdv.util from both bdv.util and bdv
error: module org.fife.RSyntaxTextArea reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.fife.RSyntaxTextArea reads package bdv.util from both bdv.util and bdv
error: module java.activation reads package net.imglib2.display from both net.imglib2 and bdv
error: module java.activation reads package bdv.util from both bdv.util and bdv
error: module java.annotation reads package net.imglib2.display from both net.imglib2 and bdv
error: module java.annotation reads package bdv.util from both bdv.util and bdv
error: module net.imglib2.realtransform reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imglib2.realtransform reads package bdv.util from both bdv.util and bdv
error: module net.imglib2 reads package net.imglib2.display from both net.imglib2 and bdv
error: module net.imglib2 reads package bdv.util from both bdv.util and bdv
error: module org.slf4j reads package net.imglib2.display from both net.imglib2 and bdv
error: module org.slf4j reads package bdv.util from both bdv.util and bdv
/Users/ulrik/Code/scenery-base/scenery/src/main/java/module-info.java:1: error: module graphics.scenery reads package net.imglib2.display from both net.imglib2 and bdv
module graphics.scenery {
^
111 errors
1 warning

This looks slightly cryptic at first - the issue there is that classes declaring to be from net.imglib2.display exist both in bdv and in net.imglib2, and classes declaring to be from bdv.util exist both in bdv and bdv.util. Note that the above output comes from a version of scenery that has dependencies on n5 removed, as n5 brings along pretty much the same issues, just with different packages.

tpietzsch commented 1 month ago

With imglib2-7.0.3 and bigdataviewer-core-10.5.0 there should be no more split packages. (Note that bigdataviewer-vistools has been merged into bigdataviewer-core, so bigdataviewer-vistools-1.0.0-beta-36 is empty and obsolete)