Comments (6)
Version 0.6 is released which prints a warning about misconfiguration instead of crashing.
from silencer.
Oh wow, I can't believe i missed that in the build. You're the man, thank you. I'm assuming OP probably inherited something like this as well.
from silencer.
Hello Artur,
I'm using silencer with SBT 1.0.4 without any issues. The error message suggests that the compiler doesn't see the silent
annotation on compilation classpath - please make sure you've added silencer-lib
as a library dependency to all your projects. You probably have some project (root?) in which you're not using the silent
annotation but have the silencer-plugin
enabled anyway, albeit without the silencer-lib
dependency.
If it still doesn't work, please provide some simple reproduction project.
from silencer.
@ghik Hi ghik
I started a new, minimalist project with nothing but
name := "minimal"
version := "0.1"
scalaVersion := "2.12.4"
libraryDependencies += "com.github.ghik" %% "silencer-lib" % "0.5"
and the compiler plugin enabled in plugins.sbt
:
addCompilerPlugin("com.github.ghik" %% "silencer-plugin" % "0.5")
And received the same error:
[error] at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:122)
[error] at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:22)
[error] at com.github.ghik.silencer.SilencerPlugin$component$$typecreator1$1.apply(SilencerPlugin.scala:30)
[error] at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe$lzycompute(TypeTags.scala:230)
[error] at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe(TypeTags.scala:230)
[error] at scala.reflect.api.TypeTags.typeOf(TypeTags.scala:339)
[error] at scala.reflect.api.TypeTags.typeOf$(TypeTags.scala:339)
[error] at scala.reflect.api.Universe.typeOf(Universe.scala:61)
[error] at com.github.ghik.silencer.SilencerPlugin$component$.applySuppressions(SilencerPlugin.scala:30)
[error] at com.github.ghik.silencer.SilencerPlugin$component$$anon$1.apply(SilencerPlugin.scala:26)
[error] at scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:436)
[error] at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:429)
[error] at scala.tools.nsc.Global$GlobalPhase.$anonfun$run$1(Global.scala:400)
[error] at scala.tools.nsc.Global$GlobalPhase.$anonfun$run$1$adapted(Global.scala:400)
[error] at scala.collection.Iterator.foreach(Iterator.scala:929)
[error] at scala.collection.Iterator.foreach$(Iterator.scala:929)
[error] at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
[error] at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:400)
[error] at sbt.compiler.Eval.$anonfun$compileAndLoad$1(Eval.scala:207)
[error] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:250)
[error] at sbt.compiler.Eval.compile$1(Eval.scala:207)
[error] at sbt.compiler.Eval.compileAndLoad(Eval.scala:212)
[error] at sbt.compiler.Eval.evalCommon(Eval.scala:179)
[error] at sbt.compiler.Eval.eval(Eval.scala:112)
[error] at sbt.internal.EvaluateConfigurations$.evaluateDslEntry(EvaluateConfigurations.scala:176)
[error] at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$2(EvaluateConfigurations.scala:116)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error] at scala.collection.immutable.List.foreach(List.scala:389)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error] at scala.collection.immutable.List.map(List.scala:295)
[error] at sbt.internal.EvaluateConfigurations$.evaluateSbtFile(EvaluateConfigurations.scala:114)
[error] at sbt.internal.Load$.loadSettingsFile$1(Load.scala:1087)
[error] at sbt.internal.Load$.$anonfun$discoverProjects$2(Load.scala:1095)
[error] at scala.collection.MapLike.getOrElse(MapLike.scala:128)
[error] at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
[error] at scala.collection.AbstractMap.getOrElse(Map.scala:59)
[error] at sbt.internal.Load$.memoLoadSettingsFile$1(Load.scala:1094)
[error] at sbt.internal.Load$.$anonfun$discoverProjects$4(Load.scala:1102)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error] at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
[error] at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
[error] at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error] at scala.collection.AbstractTraversable.map(Traversable.scala:104)
[error] at sbt.internal.Load$.loadFiles$1(Load.scala:1102)
[error] at sbt.internal.Load$.discoverProjects(Load.scala:1116)
[error] at sbt.internal.Load$.discover$1(Load.scala:844)
[error] at sbt.internal.Load$.loadTransitive(Load.scala:909)
[error] at sbt.internal.Load$.loadProjects$1(Load.scala:714)
[error] at sbt.internal.Load$.$anonfun$loadUnit$10(Load.scala:717)
[error] at sbt.internal.Load$.timed(Load.scala:1343)
[error] at sbt.internal.Load$.$anonfun$loadUnit$1(Load.scala:717)
[error] at sbt.internal.Load$.timed(Load.scala:1343)
[error] at sbt.internal.Load$.loadUnit(Load.scala:677)
[error] at sbt.internal.Load$.$anonfun$builtinLoader$4(Load.scala:477)
[error] at sbt.internal.BuildLoader$.$anonfun$componentLoader$5(BuildLoader.scala:154)
[error] at sbt.internal.BuildLoader.apply(BuildLoader.scala:219)
[error] at sbt.internal.Load$.loadURI$1(Load.scala:539)
[error] at sbt.internal.Load$.loadAll(Load.scala:555)
[error] at sbt.internal.Load$.loadURI(Load.scala:485)
[error] at sbt.internal.Load$.load(Load.scala:464)
[error] at sbt.internal.Load$.$anonfun$apply$1(Load.scala:249)
[error] at sbt.internal.Load$.timed(Load.scala:1343)
[error] at sbt.internal.Load$.apply(Load.scala:249)
[error] at sbt.internal.Load$.defaultLoad(Load.scala:65)
[error] at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:696)
[error] at sbt.BuiltinCommands$.doLoadProject(Main.scala:696)
[error] at sbt.BuiltinCommands$.$anonfun$loadProjectImpl$2(Main.scala:688)
[error] at sbt.Command$.$anonfun$applyEffect$4(Command.scala:125)
[error] at sbt.Command$.$anonfun$applyEffect$2(Command.scala:121)
[error] at sbt.MainLoop$.processCommand(MainLoop.scala:121)
[error] at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:105)
[error] at sbt.State$$anon$1.runCmd$1(State.scala:227)
[error] at sbt.State$$anon$1.process(State.scala:233)
[error] at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:105)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.MainLoop$.next(MainLoop.scala:105)
[error] at sbt.MainLoop$.run(MainLoop.scala:98)
[error] at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:76)
[error] at sbt.io.Using.apply(Using.scala:22)
[error] at sbt.MainLoop$.runWithNewLog(MainLoop.scala:70)
[error] at sbt.MainLoop$.runAndClearLast(MainLoop.scala:52)
[error] at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:37)
[error] at sbt.MainLoop$.runLogged(MainLoop.scala:29)
[error] at sbt.StandardMain$.runManaged(Main.scala:104)
[error] at sbt.xMain.run(Main.scala:71)
[error] at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error] at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error] at xsbt.boot.Launch$.run(Launch.scala:109)
[error] at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error] at xsbt.boot.Launch$.launch(Launch.scala:117)
[error] at xsbt.boot.Launch$.apply(Launch.scala:18)
[error] at xsbt.boot.Boot$.runImpl(Boot.scala:41)
[error] at xsbt.boot.Boot$.main(Boot.scala:17)
[error] at xsbt.boot.Boot.main(Boot.scala)
[error] scala.ScalaReflectionException: object com.github.ghik.silencer.silent in compiler mirror not found.
[error] Use 'last' for the full log.
Not sure what the issue is, but I'm always assuming it's SBT related 😆
from silencer.
Hi @emilypi,
Thanks for the reproduction. You should have put the addCompilerPlugin(...)
line in build.sbt
, not project/plugins.sbt
because project/plugins.sbt
is for sbt plugins, not for compiler plugins.
The way you've configured it, you've added the compiler plugin to the compilation of the build itself. If you also added silencer-lib
as a library dependency in project/plugins.sbt
file, that should work fine and would enable you to use @silent
in the build.sbt
😆 But since you haven't added silencer-lib
on the build level, you got a crash instead 😄
So this isn't a bug, but I'm going to release a new version which will be safeguarded against such misconfigurations and will present some nicer warning to the user instead of this horrible crash.
from silencer.
Yep, this probably was the case for @artursoler too. I think we can consider this resolved.
from silencer.
Related Issues (20)
- support Scala 2.13.2's `@nowarn` annotation?
- Release for Scala 2.13.1 HOT 1
- Install instructions are not universal HOT 2
- NullPointerException at SilencerPlugin's FindSuppressions.addSuppression HOT 3
- Can CrossBuilding full for silencer-lib be avoided? HOT 2
- Is it possible to limit a globalFilter based on a pathFilter? HOT 1
- Release for 2.12.13 HOT 1
- Scalafix and Silencer crash with NoClassDefFoundError HOT 4
- Using scala-collection-compat together with silencer-plugin is broken HOT 12
- GitHub UI still shows 1.7.0 as latest version HOT 1
- Publish for Scala 2.12.16, please?
- Publish for Scala 2.12.17, please? HOT 2
- Publish for Scala 2.13.9, please? HOT 1
- Please publish for Scala 2.13.10 HOT 3
- Publish for Scala 2.12.18 and 2.13.11, please? HOT 9
- Please publish for Scala 2.13.12 HOT 1
- Please publish for Scala 2.12.19 HOT 1
- Please publish for Scala 2.13.13 HOT 1
- Please publish for Scala 2.13.14 HOT 1
- Silencer 1.7.17 on 2.13.14 causes NoClassDefFoundError
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silencer.