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

Error in unidoc task while compiling Java Annotation after update to Scala 3.3.0 #145

Closed
sbrunk opened this issue Jun 6, 2023 · 2 comments

Comments

@sbrunk
Copy link

sbrunk commented Jun 6, 2023

After upgrading a project to Scala 3.3.0 from 3.2.2, calling the unidoc task triggers the following error:

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

It's totally possible sbt-unidoc is just surfacing the error. So apologies if I'm opening this in the wrong place, but I'm currently a bit at a loss where to start looking and I haven't been able to reproduce the error outside of the unidoc task.

This is the Java annotation mentioned in the error:

@Documented @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface NoException {
    /** On override, indicates whether to use the C++ noexcept specifier or not. */
    boolean value() default false;
}

Any hints much appreciated.

@sbrunk
Copy link
Author

sbrunk commented Jun 12, 2023

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
Copy link
Author

sbrunk commented Jun 12, 2023

By comparing the output of the doc and unidoc tasks via sbt -debug, I was able to find the source.

It seems like a bad interaction with the sbt-javacpp plugin which defaults to an old version javacpp. I'm overriding that version via a setting, which works for tasks like compile and doc, but apparently for unidoc the version needs to be set on the aggregating root project as well.

Sorry for the noise.

@sbrunk sbrunk closed this as completed Jun 12, 2023
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

No branches or pull requests

1 participant