milessabin / shapeless

Generic programming for Scala

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sbt-missinglink complains about shapeless in Scala 2.13

diesalbla opened this issue · comments

WE have a project, in which we are using several packages that depend on shapeless, and for which we are using the version 2.13.2 of Scala. I have analysed the build with the https://github.com/scalacenter/sbt-missinglink plugin, and running the missingLinkCheck command I got the following messages:

[info] 4 conflicts found!
[error] Category: Class being called not found
[error]   In artifact: shapeless_2.13-2.3.3.jar
[error]     In class: shapeless.ScalaVersionSpecifics
[error]       In method:  implicitNotFoundMessage(scala.reflect.macros.whitebox.Context, scala.reflect.api.Types$TypeApi):29
[error]       Call to: scala.tools.nsc.typechecker.Implicits$Message.formatDefSiteMessage(scala.reflect.internal.Types$Type)
[error]       Problem: Class not found: scala.tools.nsc.typechecker.Implicits$Message
[error]       --------
[error]       In method:  implicitNotFoundMessage(scala.reflect.macros.whitebox.Context, scala.reflect.api.Types$TypeApi):28
[error]       Call to: scala.tools.nsc.Global.analyzer()
[error]       Problem: Class not found: scala.tools.nsc.Global
[error]       --------
[error]       In method:  implicitNotFoundMessage(scala.reflect.macros.whitebox.Context, scala.reflect.api.Types$TypeApi):28
[error]       Call to: scala.tools.nsc.typechecker.Analyzer.ImplicitNotFoundMsg()
[error]       Problem: Class not found: scala.tools.nsc.typechecker.Analyzer
[error]       --------
[error]       In method:  implicitNotFoundMessage(scala.reflect.macros.whitebox.Context, scala.reflect.api.Types$TypeApi):28
[error]       Call to: scala.tools.nsc.typechecker.Implicits$ImplicitNotFoundMsg$.unapply(scala.reflect.internal.Symbols$Symbol)
[error]       Problem: Class not found: scala.tools.nsc.typechecker.Implicits$ImplicitNotFoundMsg$
[error]       --------

Has anyone seen a similar errors?

But those are scala-compiler classes not shapeless classes 🤔

AFAIK binary compatibility is not guaranteed for the Scala compiler between patch versions.

Right but this method implicitNotFoundMessage is called in macros at compile time.

@diesalbla is this causing a problem for your build, other than the report from sbt-missinglink?

It looks to me as though sbt-missing link isn't aware of the internal compiler classes that shapeless uses. Does it have scala-compiler.jar on its classpath?

@milessabin Sorry, it has been a little while since this error first happen, and it somehow went away. For some projects, we use the missing link check as part of our code sanity checks. Could it be that sbt-missinglink would not include the scala-compiler.jar in its classpath, if it is only used at compile time?

It has just happened to me 😞 SBT 1.4.7, Scala 2.13.4, missinglink 0.3.1, shapeless 2.3.3. Solved by excluding the Shapeless from Missinglink... 😐

Does it also happen with 2.3.4?

Those classes are called at compile time by macros - maybe the issue is with sbt-missinglink