zio / zio-config

Easily use and document any config from anywhere in ZIO apps
https://zio.dev/zio-config
Apache License 2.0
231 stars 112 forks source link

Cannot build a Docker image with Scala 3.3.0 and sbt-native-packager (4.0.0-RC16) #1245

Open straszydlo opened 1 year ago

straszydlo commented 1 year ago

It is not possible to create a Docker image with sbt-native-packager in a Scala 3.3.0 project that uses TypesafeConfigProvider from zio-config 4.0.0-RC16.

Minimal repo to reproduce the issue: https://github.com/straszydlo/zio-config-docker-bug

It is possible to compile and run the project, but when running sbt docker:publishLocal a following error is displayed:

[error] -- Error: typesafe/shared/src/main/scala/zio/config/typesafe/TypesafeConfigProvider.scala:13: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

This is due to the fact that TypesafeConfigProvider uses com.github.ghik.silencer.silent annotation provided by the silencer plugin that is not compatible with Scala 3.3.0.

jxnu-liguobin commented 1 year ago

+1 publishLocal command is not available

sbt publishLocal
[info] Wrote /Work/zio-nebula/core/target/scala-3.3.1/zio-nebula_3-0.0.5+16-cbacc39d-SNAPSHOT.pom
[info] Main Scala API documentation to /Work/zio-nebula/core/target/scala-3.3.1/api...
[error] -- Error: typesafe/shared/src/main/scala/zio/config/typesafe/TypesafeConfigProvider.scala:13: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
mprihoda commented 1 year ago

Been able to work around it by adding ghik library to make DottyDoc happy.

 libraryDependencies += "com.github.ghik" %% "silencer-lib" % "1.4.2" % Provided cross CrossVersion.for3Use2_13