sbrunk / storch

GPU accelerated deep learning and numeric computing for Scala 3.
https://storch.dev
Apache License 2.0
113 stars 7 forks source link

Update to Scala 3.3.0, JavaCPP 1.5.9 stable and other dep updates #24

Closed sbrunk closed 1 year ago

sbrunk commented 1 year ago

With the Scala 3.3.0 upgrade we're running into a weird issue when running the unidoc plugin:

[error] constructor NoException in trait NoException: (): org.bytedeco.javacpp.annotation.NoException does not have a parameter value

Downgrading to Scala 3.2.2 even with the other dependency updates fixes it.

Needs investigation to find the root cause. I've opened an issue in sbt-unidoc to see if someone there has an idea.

sbrunk commented 1 year ago

Trying to isolate this further. The error is triggered when a Java method annotated with NoException like this with a parameter

public native @NoException(true) DeviceType type();

is called from Scala code. But only if we run unidoc on that code. Regular compilation and Scaladoc seems to be working fine.

sbrunk commented 1 year ago

Running sbt -debug and then calling doc (working) and unidoc (failing) and on a minimized example (single minimal project) for comparison to get some clues.

Both call scaladoc with almost the same arguments now, but in the unidoc call the classpath looks suspicious: We have javacpp-1.5.9 AND javacpp-1.5.4 on the classpath.

So this seems like a bad interaction with the sbt-javacpp plugin which currently defaults to javacpp 1.5.4. We override that in commonSettings: javaCppVersion := "1.5.9, which works for tasks like compile and doc, but apparantly not for unidoc.

sbrunk commented 1 year ago

javaCppVersion needs to be set on the aggregating root task to be picked up by unidoc for some reason.