Skip to content

dotty.tools.xsbt.PositionBridge@3eec221b: could not find Lazy implicit value error when trying to upgrade the scala version to 3.0.0 #477

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

Closed
rajcspsg opened this issue May 18, 2021 · 5 comments

Comments

@rajcspsg
Copy link
Contributor

Hi,

I'm sample maven scala project here
When compiling the project with scala-maven-version 4.5.1 I get the below error.

[ERROR] dotty.tools.xsbt.PositionBridge@767bb276: could not find Lazy implicit value of type scodec.Codec[adserver.cluster.serializer.TagRequest].
I found:

shapeless.Lazy.mkLazy[I]

But method mkLazy in object Lazy does not match type shapeless.Lazy[scodec.Codec[adserver.cluster.serializer.TagRequest]].

One of the following imports might make progress towards fixing the problem:

import shapeless.?>.idKeyWitness
import shapeless.
?>.idValueWitness
import shapeless.~?>.witness

I added the below code from the error suggestion above.

import shapeless.~?>.idKeyWitness
import shapeless.~?>.idValueWitness
import shapeless.~?>.witness

After adding that I got below error.

[ERROR] dotty.tools.xsbt.PositionBridge@39640f7b: could not find Lazy implicit value of type scodec.Codec[adserver.cluster.serializer.Event].
I found:

shapeless.?>.witness[Nothing, Nothing, T](shapeless.?>.rel[Nothing, Nothing])

What is the error. How can I fix this for scala 3?

@davidB
Copy link
Owner

davidB commented May 22, 2021

Sorry I didn't play enough with scala3 / dotty to help you.

Maybe try to contact the shapeless or scala3 community for help. And please reopen the ticket with more info if it is a issue with the plugin (In this case providing a minimal sample project case to reproduce the issue will help a lot like your linked project https://github.com/rajcspsg/scala3-maven-build-demo).

Thanks

@davidB davidB closed this as completed May 22, 2021
@mims-github
Copy link

mims-github commented Jun 1, 2021

@davidB
May I "miss"-use this issue to check, if the following is a problem in this plugin or a (configuration?) problem for the Scala3 compiler?

When a compile error is logged by the plugin, one has no way to find out, in which source file the problem actually is. Which makes fixing it quite hard. 😅
I guess that the dotty.tools.xsbt.PositionBridge@767bb276: part in the log line should show the location of the problem, but it looks like the Object.toString is used instead a helpful custom toString impl.
https://github.com/lampepfl/dotty/blob/master/sbt-bridge/src/dotty/tools/xsbt/PositionBridge.java

Can you confirm?
Let me know how I can help.

Thanks a lot for the plugin!

I was now able to debug it, and from looking at the stack, it looks like it's a problem in dotty/sbt, and not in scala-maven-plugin:

log:45, SbtLogger (sbt_inc)
log:47, Logger (sbt.util)
warn:43, Logger (sbt.util)
logWarning:159, LoggedReporter (sbt.internal.inc)
display:168, LoggedReporter (sbt.internal.inc)
log:142, LoggedReporter (sbt.internal.inc)
doReport:43, DelegatingReporter (dotty.tools.xsbt)
report:150, Reporter (dotty.tools.dotc.reporting)
issueWarning:32, report$ (dotty.tools.dotc)
warning:67, report$ (dotty.tools.dotc)
checkExhaustivity:847, SpaceEngine (dotty.tools.dotc.transform.patmat)
transformMatch:45, PatternMatcher (dotty.tools.dotc.transform)
goMatch:779, MegaPhase (dotty.tools.dotc.transform)
transformUnnamed$1:369, MegaPhase (dotty.tools.dotc.transform)
transformTree:429, MegaPhase (dotty.tools.dotc.transform)
mapDefDef$1:249, MegaPhase (dotty.tools.dotc.transform)
transformNamed$1:252, MegaPhase (dotty.tools.dotc.transform)
transformTree:427, MegaPhase (dotty.tools.dotc.transform)
transformStat$2:437, MegaPhase (dotty.tools.dotc.transform)
recur$3$$anonfun$1:442, MegaPhase (dotty.tools.dotc.transform)
apply:-1, 1211614573 (dotty.tools.dotc.transform.MegaPhase$$Lambda$1731)
mapConserve:472, List (scala.collection.immutable)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
transformStats:442, MegaPhase (dotty.tools.dotc.transform)
transformUnnamed$1:362, MegaPhase (dotty.tools.dotc.transform)
transformTree:429, MegaPhase (dotty.tools.dotc.transform)
transformNamed$1:256, MegaPhase (dotty.tools.dotc.transform)
transformTree:427, MegaPhase (dotty.tools.dotc.transform)
transformStat$2:437, MegaPhase (dotty.tools.dotc.transform)
recur$3$$anonfun$1:442, MegaPhase (dotty.tools.dotc.transform)
apply:-1, 1211614573 (dotty.tools.dotc.transform.MegaPhase$$Lambda$1731)
mapConserve:472, List (scala.collection.immutable)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
recur$1:442, MegaPhase (dotty.tools.dotc.transform)
transformStats:442, MegaPhase (dotty.tools.dotc.transform)
mapPackage$1:382, MegaPhase (dotty.tools.dotc.transform)
transformUnnamed$1:385, MegaPhase (dotty.tools.dotc.transform)
transformTree:429, MegaPhase (dotty.tools.dotc.transform)
transformUnit:448, MegaPhase (dotty.tools.dotc.transform)
run:460, MegaPhase (dotty.tools.dotc.transform)
runOn$$anonfun$1:303, Phases$Phase (dotty.tools.dotc.core)
apply:-1, 381605910 (dotty.tools.dotc.core.Phases$Phase$$Lambda$1464)
map:246, List (scala.collection.immutable)
runOn:304, Phases$Phase (dotty.tools.dotc.core)
runPhases$4$$anonfun$4:205, Run (dotty.tools.dotc)
applyVoid:-1, 97755704 (dotty.tools.dotc.Run$$Lambda$852)
apply:15, JProcedure1 (scala.runtime.function)
apply:10, JProcedure1 (scala.runtime.function)
foreach$extension:1323, ArrayOps$ (scala.collection)
runPhases$5:215, Run (dotty.tools.dotc)
compileUnits$$anonfun$1:223, Run (dotty.tools.dotc)
apply$mcV$sp:-1, 1489854600 (dotty.tools.dotc.Run$$Lambda$815)
apply:18, JFunction0$mcV$sp (scala.runtime.java8)
maybeMonitored:67, Stats$ (dotty.tools.dotc.util)
compileUnits:230, Run (dotty.tools.dotc)
compileSources:166, Run (dotty.tools.dotc)
compile:150, Run (dotty.tools.dotc)
doCompile:39, Driver (dotty.tools.dotc)
run:88, CompilerBridgeDriver (dotty.tools.xsbt)
run:22, CompilerBridge (dotty.tools.xsbt)
compile:91, AnalyzingCompiler (sbt.internal.inc)
$anonfun$compile$7:186, MixedAnalyzingCompiler (sbt.internal.inc)
apply$mcV$sp:-1, 1081132287 (sbt.internal.inc.MixedAnalyzingCompiler$$Lambda$548)
apply:18, JFunction0$mcV$sp (scala.runtime.java8)
timed:241, MixedAnalyzingCompiler (sbt.internal.inc)
$anonfun$compile$4:176, MixedAnalyzingCompiler (sbt.internal.inc)
$anonfun$compile$4$adapted:157, MixedAnalyzingCompiler (sbt.internal.inc)
apply:-1, 208157941 (sbt.internal.inc.MixedAnalyzingCompiler$$Lambda$544)
withPreviousJar:239, JarUtils$ (sbt.internal.inc)
compileScala$1:157, MixedAnalyzingCompiler (sbt.internal.inc)
compile:204, MixedAnalyzingCompiler (sbt.internal.inc)
$anonfun$compileInternal$1:528, IncrementalCompilerImpl (sbt.internal.inc)
$anonfun$compileInternal$1$adapted:528, IncrementalCompilerImpl (sbt.internal.inc)
apply:-1, 1055294327 (sbt.internal.inc.IncrementalCompilerImpl$$Lambda$254)
$anonfun$apply$5:174, Incremental$ (sbt.internal.inc)
$anonfun$apply$5$adapted:172, Incremental$ (sbt.internal.inc)
apply:-1, 2067939216 (sbt.internal.inc.Incremental$$$Lambda$261)
run:457, Incremental$$anon$2 (sbt.internal.inc)
next:116, IncrementalCommon$CycleState (sbt.internal.inc)
next:56, IncrementalCommon$$anon$1 (sbt.internal.inc)
next:52, IncrementalCommon$$anon$1 (sbt.internal.inc)
cycle:261, IncrementalCommon (sbt.internal.inc)
$anonfun$incrementalCompile$8:412, Incremental$ (sbt.internal.inc)
apply:-1, 1464984894 (sbt.internal.inc.Incremental$$$Lambda$459)
withClassfileManager:499, Incremental$ (sbt.internal.inc)
incrementalCompile:399, Incremental$ (sbt.internal.inc)
apply:166, Incremental$ (sbt.internal.inc)
compileInternal:528, IncrementalCompilerImpl (sbt.internal.inc)
$anonfun$compileIncrementally$1:482, IncrementalCompilerImpl (sbt.internal.inc)
apply:-1, 193208949 (sbt.internal.inc.IncrementalCompilerImpl$$Lambda$157)
handleCompilationError:332, IncrementalCompilerImpl (sbt.internal.inc)
compileIncrementally:420, IncrementalCompilerImpl (sbt.internal.inc)
compile:137, IncrementalCompilerImpl (sbt.internal.inc)
compile:179, SbtIncrementalCompiler (sbt_inc)
incrementalCompile:356, ScalaCompilerSupport (scala_maven)
compile:113, ScalaCompilerSupport (scala_maven)
doExecute:88, ScalaCompilerSupport (scala_maven)
execute:308, ScalaMojoSupport (scala_maven)
executeMojo:137, DefaultBuildPluginManager (org.apache.maven.plugin)
execute:208, MojoExecutor (org.apache.maven.lifecycle.internal)
execute:154, MojoExecutor (org.apache.maven.lifecycle.internal)
execute:146, MojoExecutor (org.apache.maven.lifecycle.internal)
buildProject:117, LifecycleModuleBuilder (org.apache.maven.lifecycle.internal)
buildProject:81, LifecycleModuleBuilder (org.apache.maven.lifecycle.internal)
build:56, SingleThreadedBuilder (org.apache.maven.lifecycle.internal.builder.singlethreaded)
execute:128, LifecycleStarter (org.apache.maven.lifecycle.internal)
doExecute:305, DefaultMaven (org.apache.maven)
doExecute:192, DefaultMaven (org.apache.maven)
execute:105, DefaultMaven (org.apache.maven)
execute:954, MavenCli (org.apache.maven.cli)
doMain:288, MavenCli (org.apache.maven.cli)
main:192, MavenCli (org.apache.maven.cli)
invoke0:-1, NativeMethodAccessorImpl (jdk.internal.reflect)
invoke:62, NativeMethodAccessorImpl (jdk.internal.reflect)
invoke:43, DelegatingMethodAccessorImpl (jdk.internal.reflect)
invoke:566, Method (java.lang.reflect)
launchEnhanced:289, Launcher (org.codehaus.plexus.classworlds.launcher)
launch:229, Launcher (org.codehaus.plexus.classworlds.launcher)
mainWithExitCode:415, Launcher (org.codehaus.plexus.classworlds.launcher)
main:356, Launcher (org.codehaus.plexus.classworlds.launcher)

@davidB
Copy link
Owner

davidB commented Jun 1, 2021

@mims-github , yes using another issue was maybe a better place. Anyways any suggestions to improve the dev experience and help to resolve this issue directly or indirectly is welcomed (IMHO).

In this case, I also though that the improvement is on dotty or sbt-bridge side, if I'm wrong PR are welcomes, TBH I didn't did a lot in this issue (expected try to reproduce and check some configuration), and I'm no longer a scala user or dev (since several years now), so not the best to fix or to help on this (double) issue

@mims-github
Copy link

@davidB Thanks a lot for your quick feedback, very appreciated.
I will check with upstream projects, if we can improve from their side.

@mims-github
Copy link

FYI: Starting with nightly version 3.0.2-RC1-bin-20210611-fcd837a-NIGHTLY, a more informative source location info is logged for compile errors and warnings.

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

3 participants