Skip to content

Nightly docs are missing Scala 3 parts of standard library #17964

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

Closed
Florian3k opened this issue Jun 13, 2023 · 5 comments · Fixed by #18025 or #18095
Closed

Nightly docs are missing Scala 3 parts of standard library #17964

Florian3k opened this issue Jun 13, 2023 · 5 comments · Fixed by #18025 or #18095

Comments

@Florian3k
Copy link
Contributor

Florian3k commented Jun 13, 2023

Nightly docs https://dotty.epfl.ch/api/index.html are missing Scala 3 additions to stdlib (compiletime, deriving, quoted, Tuple, CanEqual, CanThrow etc)

Bisect points to #17526

@Florian3k
Copy link
Contributor Author

Background:
Scaladoc (generateScalaDocumentation and generateStableScala3Documentation precisely) uses results of building stdlib-bootstrapped (and few others) to generate documentation:
Relevant fragments from Build.scala:
For generateScalaDocumentation:
https://github.com/lampepfl/dotty/blob/89de88126e19b31f7eb22a2bff22a7a780a6a973/project/Build.scala#L2016-L2020
For generateStableScala3Documentation:
https://github.com/lampepfl/dotty/blob/89de88126e19b31f7eb22a2bff22a7a780a6a973/project/Build.scala#L2075-L2079

After #17526 stdlib-bootstrapped no longer contains Scala 3 parts of stdlib, so we need another source of those.

@Florian3k
Copy link
Contributor Author

I attempted to resolve this by adding scala3-library-bootstrapped to scaladoc input files:

val dottyJars: Seq[java.io.File] = Seq(
  (`stdlib-bootstrapped`/Compile/products).value,
  (`scala3-interfaces`/Compile/products).value,
  (`tasty-core-bootstrapped`/Compile/products).value,
+ (`scala3-library-bootstrapped`/Compile/products).value,
).flatten
Seq(
  s"out/bootstrap/stdlib-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/classes",
  s"tmp/interfaces/target/classes",
  s"out/bootstrap/tasty-core-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/classes",
+ s"out/bootstrap/scala3-library-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/classes",
)

But that fails with the following error after running scaladoc:

-- Error: library/src/scala/quoted/ToExpr.scala:425:27 -------------------------
425 |      '{ BigDecimal(${Expr(x.toString)}) }
    |                           ^^^^^^^^^^
    |          method toString in class BigDecimal does not take parameters

@Florian3k
Copy link
Contributor Author

@nicolasstucki I was told that you are currently working on some things related to tasty and stdlib-bootstrapped. Do you have any ideas about how to proceed with this?

@nicolasstucki
Copy link
Contributor

What I am working on is generating TASTy for the Scala 2 stdlib. What you seem to be missing the Scala 3 library. Adding scala3-library-bootstrapped seems to be the correct direction.

@nicolasstucki
Copy link
Contributor

I see what happened. The docs are consuming the artifacts of stdlib-bootstrapped to get TASTy from the Scala 2 library. It used to compile all Scala 2 and Scala 3 sources together (before #17526). These TASTy were not supposed to be stable enough to be consumed by any tool. I guess that it was good enough for a first version of the docs. What I am currently working on is to make these TASTy stable (align perfectly with the Scala 2 signatures).

Now, to fix this issue we have two alternatives

  1. (quick fix) we create a new version of stdlib-bootstrapped that includes the Scala 3 sources and compiles without -Yscala2-stdlib (signature patches).
  2. Scaladoc depends on both stdlib-bootstrapped and scala3-library-bootstrapped

We need to get to (2) at some point. The question is if this is simple or if we should have a quick patch (1) to make the documentation work while we figure out the details. I will open a PR for (1) and we can merge it if needed.

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 21, 2023
This adds a temporary workaround (`stdlib-bootsrapped-legacy`) to be
able to generate documentation for the full standard library. In the
future, the documentation will be generated from `stdlib-bootsrapped`
and `scala3-library-bootsrapped` combined.

Fixes scala#17964
nicolasstucki added a commit that referenced this issue Jun 28, 2023
This adds a temporary workaround (`stdlib-bootstrapped-legacy`) to be
able to generate documentation for the full standard library. In the
future, the documentation will be generated from `stdlib-bootstrapped`
and `scala3-library-bootstrapped` combined.

Fixes #17964
Fixes #17621

Partially reverts #17526
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 29, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 29, 2023
nicolasstucki added a commit that referenced this issue Jun 29, 2023
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment