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
Fix broken Scaladoc external references with JDK11 #8663
Conversation
tests passing — can you rebase/squash? once it's a single commit, the "combined" error will go away (the "combined" check means that every commit must be green, not just the last one) |
My branch has merges from 2.13.x. Is it safe to rebase/squash them? |
yes. you should find that when you rebase, the merge commits will go away. |
3091516
to
840bc4e
Compare
Can we get moving with the code review? I will be happy to rewrite the code as needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect @retronym will attempt to review this in time for the 2.13.2 release, but he might be backed up at the moment.
project/ScalaOptionParser.scala
Outdated
@@ -124,7 +124,7 @@ object ScalaOptionParser { | |||
private def scalaDocBooleanSettingNames = List("-implicits", "-implicits-debug", "-implicits-show-all", "-implicits-sound-shadowing", "-implicits-hide", "-author", "-diagrams", "-diagrams-debug", "-raw-output", "-no-prefixes", "-no-link-warnings", "-expand-all-types", "-groups") | |||
private def scalaDocIntSettingNames = List("-diagrams-max-classes", "-diagrams-max-implicits", "-diagrams-dot-timeout", "-diagrams-dot-restart") | |||
private def scalaDocChoiceSettingNames = Map("-doc-format" -> List("html")) | |||
private def scaladocStringSettingNames = List("-doc-title", "-doc-version", "-doc-footer", "-doc-no-compile", "-doc-source-url", "-doc-generator", "-skip-packages") | |||
private def scaladocStringSettingNames = List("-doc-title", "-doc-version", "-doc-footer", "-doc-no-compile", "-doc-source-url", "-doc-generator", "-skip-packages", "jdk-api-doc-base") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the other strings begin with a hyphen but the new one doesn't, was that an oversight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I'll change that
@ashawley does this look plausible to you? |
(retargeted for 2.13.3, but that doesn't mean that it can't still make 2.13.2) |
The problem was that PlainNioFile.underlyingSource was expanding "/modules/java.base" into a full path, where as the lookup in findExternalLink was using relative paths ("/modules/java.base.jmod") Added -jdk-api-doc-base for specifying the base URL for Java API references
840bc4e
to
8e5004a
Compare
@lrytz wdyt about merging this for 2.13.2? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great first step. I got a bit sidetracked when reviewing considering making things more general or performant, but we can refine this in a later release.
I wasn't able to look at this closely, but I recall it only supports mappings to the java.base module. Merging this as a first step is fine, but it doesn't fix scala/bug#11839 entirely, so it should stay open. |
I updated the PR description to include the |
thank you @steven-barnes! |
this is a post-2.13.1 regression, due to scala#8663 the bug was that the Java version might be e.g. "14", with no . characters at all, causing StringIndexOutOfBoundsException this was caught by the Scala community build
this is a post-2.13.1 regression, due to scala#8663 the bug was that the Java version might be e.g. "14", with no . characters at all, causing StringIndexOutOfBoundsException this was caught by the Scala community build
this is a post-2.13.1 regression, due to scala#8663 the bug was that the Java version might be e.g. "14", with no . characters at all, causing StringIndexOutOfBoundsException this was caught by the Scala community build
This change broke Scaladoc on Windows on JDK11, see scala/bug#11955 |
We have discussed a possible solution here, however I do not have a Windows machine to test. |
The discussion should continue at scala/bug#11955 and maybe someone could assign you the ticket. |
Constructs URL for Java API references based on java.version; can override using -jdk-api-doc-base argument. partially addresses scala/bug#11839
only supports mappings to the
java.base
module — supporting other modules remains as future work