Closed sideeffffect closed 3 years ago
What Scala version is this?
2.11.12, I think. When we upgraded izumi-reflect
Scala Native 0.4.0, we also had to upgrade to scala-collection-compat
to 2.4.0
.
We had to remove silencer in order to make the build pass: https://github.com/zio/izumi-reflect/pull/121
Trying to add it back is still causing these issues: https://github.com/zio/izumi-reflect/pull/128
I faced the very same problem when trying to bump scala-collection-compat
version from 2.3.2
up to 2.4.0
, then to 2.4.1
. It seems related to this recently introduced change, make @nowarn a ClassfileAnnotation, as in 2.12.13
:
https://github.com/scala/scala-collection-compat/commit/86475b4cb540f81723d6b09753355aff75c149e3#diff-6d5efe0f0fcfb13692e6abe75577291796099973c93b40ffe8e8bed7db0ea5c6
@ghik are you planing on making a release soon?
@sideeffffect there should be 1.7.2 soon, see https://github.com/ghik/silencer/actions
For the record, it solves the issue we had in izumi-reflect https://github.com/zio/izumi-reflect/pull/128 Many thanks :smiley:
there should be 1.7.2 soon, see https://github.com/ghik/silencer/actions
I see the plugin got published for Scala 2.12.13, but not for other versions. @ghik, is that intentional?
@rdesgroppes mvnrepository.com seems to be out of sync, search.maven.org shows other versions
Thanks, @ghik, I indeed see more Scala versions there: https://search.maven.org/search?q=g:com.github.ghik%20AND%20a:silencer-plugin_*%20AND%20v:1.7.2
... unfortunately even recent versions of sbt
(1.4.7) still use the Scala 2.12.12 compiler and therefore don't find the corresponding compilerPlugin("com.github.ghik" % "silencer-plugin" % "1.7.2" cross CrossVersion.full)
...
@rdesgroppes yes, I don't cover all minor Scala versions because that would be a cross-building nightmare considering all the minor changes that might be introduced into the compiler API with every minor Scala version. In this case, 2.12.13 broke compatibility of error reporting API with 2.12.12 so I decided to drop 2.12.12 and assumed users can bump their Scala version.
[...] I decided to drop 2.12.12 and assumed users can bump their Scala version.
@ghik Fair enough. But, since:
sbt
based on a Scala 2.12.13 runtime,silencer-plugin
1.7.1 is incompatible with scala-collection-compat
2.4.0+.... should a further note be added to https://github.com/ghik/silencer/blob/master/README.md#silencer-scala-compiler-plugin-for-warning-suppression so that sbt
users stick to silencer-plugin
1.7.1 and scala-collection-compat
2.3.2?
@rdesgroppes Since you're bound by Scala version used by sbt, I'm assuming you are developing an sbt plugin? I'm not familiar with sbt plugin development but in principle you should be able to force 2.12.13 to be used in your plugin. This should work because minor Scala versions are supposed to be both backwards and forward compatible.
When the
scala-collection-compat
library is used together with thesilencer-plugin
compiler plugin, you get errors like this:Workaround is to drop
silencer-plugin
, but that might not be the desired solution.It's worth to note that
scala-collection-compat
defines its ownnowarn
annotation: https://github.com/scala/scala-collection-compat/blob/master/compat/src/main/scala-2.11_2.12/scala/annotation/nowarn.scalaRelated: https://github.com/zio/izumi-reflect/pull/121 https://github.com/scala/scala-collection-compat/issues/413#issuecomment-767967951 https://github.com/scala/scala-collection-compat/pull/417
/cc @SethTisue @ekrich
continuation of https://github.com/scala/scala-collection-compat/issues/418