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

sbt packageDoc fails with error #1233

Open
ksarath opened this issue Jul 30, 2023 · 2 comments
Open

sbt packageDoc fails with error #1233

ksarath opened this issue Jul 30, 2023 · 2 comments

Comments

@ksarath
Copy link
Contributor

ksarath commented Jul 30, 2023

Hi,

Versions:
scala: 3.3.0
zio: 2.0.15
zio-config: 4.0.0-RC16
sbt: 1.9.2

I am getting he following error while generating Scala API documentation (sbt packageDoc)

[info] Main Scala API documentation to /Users/ksarath/projects/sample-project/target/scala-3.3.0/api...
[error] -- Error: yaml/shared/src/main/scala/zio/config/yaml/YamlConfigProvider.scala:16:0 
[error] undefined: new com.github.ghik.silencer.silent # -1: TermRef(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class ghik)),object silencer),silent),<init>) at readTasty
[error] one error found
[error] (Compile / doc) DottyDoc Compilation Failed
@ksarath
Copy link
Contributor Author

ksarath commented Jul 30, 2023

Here is sample code to reproduce the issue

import zio.ZIO
import zio.ZIOAppDefault
import zio.config.magnolia.deriveConfig
import zio.config.yaml.YamlConfigProvider

case class MyConfig(port: Int)

object Main extends ZIOAppDefault:

  def run = program

  val program: ZIO[Any, Throwable, Unit] =
    for
      _      <- ZIO.logInfo("Started submission service application")
      config <- YamlConfigProvider.fromYamlString("""port: 8080""").load(deriveConfig[MyConfig])
      _      <- ZIO.logInfo(s"config: $config")
    yield ()

@olliefreeman
Copy link

We had the same issue, this is because the Zio code is using com.github.ghik.silencer.silent which is not compatible (or needed) for Scala 3.

The workaround is to add the following to the sbt build settings for your project:

      Compile / packageDoc / publishArtifact := false,
      Compile / doc / sources := Seq.empty      

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

2 participants