Skip to content

build: skip javadoc/sources jar packaging, fixing sbt stage#144

Merged
Sootopolis merged 1 commit into
mainfrom
wip
Jul 3, 2026
Merged

build: skip javadoc/sources jar packaging, fixing sbt stage#144
Sootopolis merged 1 commit into
mainfrom
wip

Conversation

@Sootopolis

Copy link
Copy Markdown
Owner

What

sbt stage has been failing since cron4s landed (#141):

[error] undefined: new scala.scalajs.js.annotation.JSExportTopLevel # -1: ... at readTasty
[error] (Compile / doc) DottyDoc Compilation Failed

Two dormant things intersected:

  1. stage always ran scaladoc. native-packager's stage → Universal / mappingsprojectDependencyArtifacts → the project's own packagedArtifacts, which builds every declared artifact: main jar, javadoc jar (→ Compile / doc), sources jar, pom. universalDepMappings then discards the doc/src jars from lib/ — they were always built and thrown away.
  2. cron4s-core's TASTy poisons scaladoc. cron4s cross-builds for Scala.js and bakes scalajs-stubs annotations (JSExportTopLevel) into its JVM jar's TASTy (verified in cron4s/Cron.tasty of the 0.8.2 jar). Scala 3 scaladoc resolves annotations in dependency TASTy where the compiler doesn't need to; scala.scalajs.* doesn't exist on a JVM classpath → readTasty error.

Fix

Compile / packageDoc / publishArtifact := false and same for packageSrc in build.sbt. Removes both jars from packagedArtifacts, so stage never invokes scaladoc — and stops zipping two jars it never shipped.

Known residual: a direct sbt doc still fails (upstream cron4s issue). Nothing in CI, hooks, or tooling runs it.

Testing

  • sbt stage completes (was failing); previously-built javadoc/sources jars not rebuilt
  • Staged lib/ contains the three cron4s 0.8.2 jars; bin/ccas --help runs
  • Full sbt test green via pre-push hook (997 tests)

🤖 Generated with Claude Code

sbt stage fails since cron4s landed (#141): native-packager's stage
pulls packagedArtifacts, which builds every declared artifact — main
jar, javadoc jar (running Compile/doc), sources jar — only for
universalDepMappings to discard the doc/src jars from lib/. The
scaladoc leg now dies reading cron4s-core 0.8.2's TASTy: its JVM jar
bakes in scalajs-stubs annotations (JSExportTopLevel) that don't
resolve on a JVM classpath, and Scala 3 scaladoc resolves annotations
in dependency TASTy where the compiler doesn't need to.

Declaring publishArtifact := false for Compile/packageDoc and
Compile/packageSrc removes both jars from packagedArtifacts, so stage
never invokes scaladoc (and stops zipping two jars it always threw
away). A direct `sbt doc` still fails — upstream cron4s issue; nothing
in CI or hooks runs it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Sootopolis Sootopolis merged commit 056250e into main Jul 3, 2026
1 check passed
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.

1 participant