Skip to content

Conversation

hamzaremmal
Copy link
Member

In this PR, we use the new stdlib project to generate the scaladoc and website of scala 3.
The previous build used scala2-library-bootstrapped to fetch have tasty files available. We change this by now using the real, and to be, TASTy files for the stdlib.
This changes will already take effect in the first run after the merge of this PR.

Comment on lines +3820 to +3821
//s"${dottyLibRoot}=markdown",
//s"${stdLibRoot}=wiki",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, we cannot have both syntax available in the same sources... for now we just kept the default one until we find a better solution.

Comment on lines +3826 to +3831
//.add(SnippetCompiler(List(
//s"$dottyLibRoot/src/scala=compile",
//s"$dottyLibRoot/src/scala/compiletime=compile",
//s"$dottyLibRoot/src/scala/util=compile",
//s"$dottyLibRoot/src/scala/util/control=compile"
//)))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We disable the snippet compiler for now too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When can we turn it back on?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we determine the set of packages we need to enable it for.

Comment on lines -270 to -294
/** Extracts members while taking Dotty logic for patching the stdlib into account. */
def extractPatchedMembers: Seq[Member] = {
val ownMembers = c.extractMembers
def extractPatchMembers(sym: Symbol) = {
// NOTE for some reason scala.language$.experimental$ class doesn't show up here, so we manually add the name
val ownMemberDRIs = ownMembers.iterator.map(_.name).toSet + "experimental$"
sym.tree.asInstanceOf[ClassDef]
.membersToDocument.filterNot(m => ownMemberDRIs.contains(m.symbol.name))
.flatMap(parseMember(c))
}
c.symbol.fullName match {
case "scala.Predef$" =>
ownMembers ++
extractPatchMembers(qctx.reflect.Symbol.requiredClass("scala.runtime.stdLibPatches.Predef$"))
case "scala.language$" =>
ownMembers ++
extractPatchMembers(qctx.reflect.Symbol.requiredModule("scala.runtime.stdLibPatches.language").moduleClass)
case "scala.language$.experimental$" =>
ownMembers ++
extractPatchMembers(qctx.reflect.Symbol.requiredModule("scala.runtime.stdLibPatches.language.experimental").moduleClass)
case _ => ownMembers
}

}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new stdlib doesn't patch anymore, we can remove the logic here.

Copy link
Contributor

@natsukagami natsukagami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of sbt magic that I'm not sure I fully get, but looks ok to me

Comment on lines +3826 to +3831
//.add(SnippetCompiler(List(
//s"$dottyLibRoot/src/scala=compile",
//s"$dottyLibRoot/src/scala/compiletime=compile",
//s"$dottyLibRoot/src/scala/util=compile",
//s"$dottyLibRoot/src/scala/util/control=compile"
//)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When can we turn it back on?

@hamzaremmal hamzaremmal enabled auto-merge August 14, 2025 18:25
}

lazy val DefaultGenerationConfig = Def.task {
def distLocation = (dist / Universal / stage).value
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build failed because this had the side effect of being executed (which is obviously an sbt bug and why I removed it) but the CI workflow relies on this buggy effect.
I'm updating the CI workflow file to publish the commands locally before testing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked with @eed3si9n and this is a very very interesting case as it works as expected... since the sbt semantics are not the scala semantics. Still weird for me.

@hamzaremmal hamzaremmal merged commit 0cf7a18 into scala:main Aug 14, 2025
45 checks passed
@hamzaremmal hamzaremmal deleted the scaladoc-new-stdlib branch August 14, 2025 23:56
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

Successfully merging this pull request may close these issues.

3 participants