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

Inconsistent Javadoc generation failure when referencing excluded classes #114

Open
kristoffSC opened this issue Feb 11, 2022 · 1 comment

Comments

@kristoffSC
Copy link

kristoffSC commented Feb 11, 2022

Hi,
I have stumble upon an issue during Javadoc generation from sbt-unidoc. Javadoc creation succeeds even though there are Errors during doc generation.
I have a reproducer available here under https://github.com/kristoffSC/DocTests

Details about project and configuration.
The reproducer is a very simple SBT project having only two Java classes where one of them is under "internal" package.
The "internal" package is filter out from sbt-unidoc configuration like so:
.map(_.filterNot(_.getCanonicalPath.contains("/internal/")))

Case 1:
Use a @code tag to reference HideEntity.java from MainEntity.java in Javadoc comments.
MainEntity.java uses HideEntity.java in its signatures.

As an end result, the Javadoc are generated, HideEntity is excluded BUT in build logs we can find this:
image
My question is, are those in fact ERRORS or this should be rather Warnings?

The logs for this case can be found here ("Run DocModule tests" step)
https://github.com/kristoffSC/DocTests/runs/5157553355?check_suite_focus=true

Case 2:
Use a @link tag to reference HideEntity.java from MainEntity.java in Javadoc comments.
MainEntity.java uses HideEntity.java in its signatures.

As an end result, the Javadoc IS NOT generated and build has additional errors on top of ones from Case 1:
Additional Errors:
image

The logs for this case can be found here ("Run DocModule tests" step)
https://github.com/kristoffSC/DocTests/runs/5157461756?check_suite_focus=true

Case 3.
Run exact setup for Case 1 but on Windows 10 machine and execute sbt "++ 2.11.12" DocModule/test or sbt DocModule/test
When running the build for case 1 on Windows it fails totally, not generating any Javadoc.
In this case the error logs looks like this (only a portion of logs included)
image

In details, full logs for Case 1 and Case 3, even thou executed against the same code base, are looking slightly different, especially for order of line logs.

In all cases the same Scala ( 2.11.12 ) and SBT (1.6.1) version was used.
For me the most important information would be, if errors in case 1 are in fact errors which should fail javadoc generation and we just stumble on them or those should be warnings.

In our use project, we actually happy with end result of case 1, because we DO want to have Javadoc generated for "public" classes which are referencing "internal" classes in signatures. We are just worry that this behavior is actually a bug of sbt-unidode.

@kristoffSC
Copy link
Author

I think I have found what was the cause (but not the root cause) of that issue, particularly why it was working on GitHub build and not on my local machine.

The problem boils down to the Java distribution. On OpenJDK/Oracle build fails. On Zulu distribution it passes reporting same errors that can be observed in Github logs attached to the issue description.

After installing Java Zulu 1.8 on my local machine it is ok.

I don't know what exactly inside Java distribution causes this issue though and what is difference for Zulu distribution.

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