amnaredo / test

0 stars 0 forks source link

IncompatibleClassChangeError with upickle 1.3.14 and 1.3.15 #283

Open amnaredo opened 3 years ago

amnaredo commented 3 years ago

Here is a stacktrack which running mill with upickle 1.3.15.

java.lang.IncompatibleClassChangeError: Implementing class
  java.lang.ClassLoader.defineClass1(Native Method)
  java.lang.ClassLoader.defineClass(ClassLoader.java:756)
  java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
  java.net.URLClassLoader.access$100(URLClassLoader.java:74)
  java.net.URLClassLoader$1.run(URLClassLoader.java:369)
  java.net.URLClassLoader$1.run(URLClassLoader.java:363)
  java.security.AccessController.doPrivileged(Native Method)
  java.net.URLClassLoader.findClass(URLClassLoader.java:362)
  java.lang.ClassLoader.loadClass(ClassLoader.java:418)
  sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
  java.lang.ClassLoader.loadClass(ClassLoader.java:351)
  ammonite.runtime.Storage$.<clinit>(Storage.scala:110)
  ammonite.runtime.Storage$Folder$$anon$34.apply(Storage.scala:330)
  ammonite.runtime.Storage$Folder$$anon$34.apply(Storage.scala:323)
  ammonite.interp.DependencyLoader.load(DependencyLoader.scala:32)
  ammonite.interp.Interpreter.loadIvy(Interpreter.scala:628)
  ammonite.runtime.ImportHook$BaseIvy.resolve(ImportHook.scala:191)
  mill.main.MillIvyHook$.resolve(MillIvyHook.scala:16)
  ammonite.runtime.ImportHook$BaseIvy.$anonfun$handle$7(ImportHook.scala:200)
  scala.util.Either.flatMap(Either.scala:352)
  ammonite.runtime.ImportHook$BaseIvy.handle(ImportHook.scala:199)
  ammonite.interp.Interpreter.$anonfun$resolveSingleImportHook$4(Interpreter.scala:178)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.resolveSingleImportHook(Interpreter.scala:172)
  ammonite.interp.Interpreter.$anonfun$resolveImportHooks$1(Interpreter.scala:225)
  ammonite.util.Res$.$anonfun$map$1(Res.scala:43)
  ammonite.util.Res$.$anonfun$fold$1(Res.scala:32)
  scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:169)
  scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:165)
  scala.collection.immutable.List.foldLeft(List.scala:79)
  ammonite.util.Res$.fold(Res.scala:30)
  ammonite.util.Res$.map(Res.scala:43)
  ammonite.interp.Interpreter.resolveImportHooks(Interpreter.scala:225)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$14(Interpreter.scala:583)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$12(Interpreter.scala:579)
  scala.Option.getOrElse(Option.scala:201)
  ammonite.interp.Interpreter.loop$1(Interpreter.scala:579)
  ammonite.interp.Interpreter.processAllScriptBlocks(Interpreter.scala:617)
  ammonite.interp.Interpreter.$anonfun$processModule$6(Interpreter.scala:412)
  ammonite.util.Catching.flatMap(Res.scala:115)
  ammonite.interp.Interpreter.$anonfun$processModule$5(Interpreter.scala:403)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.processModule(Interpreter.scala:393)
  ammonite.interp.Interpreter.$anonfun$resolveSingleImportHook$6(Interpreter.scala:184)
  ammonite.util.Res$.$anonfun$map$1(Res.scala:43)
  ammonite.util.Res$.$anonfun$fold$1(Res.scala:32)
  scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:169)
  scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:165)
  scala.collection.immutable.List.foldLeft(List.scala:79)
  ammonite.util.Res$.fold(Res.scala:30)
  ammonite.util.Res$.map(Res.scala:43)
  ammonite.interp.Interpreter.$anonfun$resolveSingleImportHook$5(Interpreter.scala:181)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.$anonfun$resolveSingleImportHook$4(Interpreter.scala:173)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.resolveSingleImportHook(Interpreter.scala:172)
  ammonite.interp.Interpreter.$anonfun$resolveImportHooks$1(Interpreter.scala:225)
  ammonite.util.Res$.$anonfun$map$1(Res.scala:43)
  ammonite.util.Res$.$anonfun$fold$1(Res.scala:32)
  scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:169)
  scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:165)
  scala.collection.immutable.List.foldLeft(List.scala:79)
  ammonite.util.Res$.fold(Res.scala:30)
  ammonite.util.Res$.map(Res.scala:43)
  ammonite.interp.Interpreter.resolveImportHooks(Interpreter.scala:225)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$14(Interpreter.scala:583)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.$anonfun$processAllScriptBlocks$12(Interpreter.scala:579)
  scala.Option.getOrElse(Option.scala:201)
  ammonite.interp.Interpreter.loop$1(Interpreter.scala:579)
  ammonite.interp.Interpreter.processAllScriptBlocks(Interpreter.scala:617)
  ammonite.interp.Interpreter.$anonfun$processModule$6(Interpreter.scala:412)
  ammonite.util.Catching.flatMap(Res.scala:115)
  ammonite.interp.Interpreter.$anonfun$processModule$5(Interpreter.scala:403)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  ammonite.interp.Interpreter.processModule(Interpreter.scala:393)
  mill.main.RunScript$.$anonfun$evaluateRootModule$1(RunScript.scala:94)
  ammonite.util.Res$Success.flatMap(Res.scala:62)
  mill.main.RunScript$.evaluateRootModule(RunScript.scala:87)
  mill.main.RunScript$.runScript(RunScript.scala:49)
  mill.main.MainRunner.$anonfun$runScript$1(MainRunner.scala:119)
  mill.main.MainRunner.watchLoop2(MainRunner.scala:68)
  mill.main.MainRunner.runScript(MainRunner.scala:94)
  mill.MillMain$.main0(MillMain.scala:299)
  mill.MillMain$.main(MillMain.scala:104)
  mill.MillMain.main(MillMain.scala)

How to reproduce:

This is probably because mill loads plugins via $ivy import which are build with older versions of upickle. ID: 351 Original Author: lefou

amnaredo commented 3 years ago

@lefou IIRC uPickle has some binary incompatibility when https://github.com/com-lihaoyi/upickle/pull/348 landed; looking at the stack trace, it looks like you may need to bump Ammonite to a more recent version that uses the latest version of uPickle Original Author: lihaoyi

amnaredo commented 3 years ago

Without bumping the major version, no tool can help avoid this kind of issues. Maybe, you can cut a new major release, and restore binary compatibility in a new micro release? Original Author: lefou

amnaredo commented 3 years ago

We haven't been following strict semver - normally this kind of bin-compat breakage would bump the second number, and only "huge" source-compat breakages would bump the first. I can go push tags for uPickle and Ammonite to get numbered versions out Original Author: lihaoyi

amnaredo commented 3 years ago

We haven't been following strict semver - normally this kind of bin-compat breakage would bump the second number, and only "huge" source-compat breakages would bump the first.

Yeah, I'm aware of that. But maybe upickle should follow semver more stricktly, as it's users community grows.

I can go push tags for uPickle and Ammonite to get numbered versions out.

That would be great! People demand using the repl from Mill with newer Scala versions, and having proper released upstream dependencies would make it much easier to create a new (binary incompatible) mill release (with it's own plugin ecosystem).

Original Author: lefou

amnaredo commented 3 years ago

uPickle 1.4.0 and Ammonite 2.4.0 are out; they should work together if we want to bump them both in Mill Original Author: lihaoyi

amnaredo commented 3 years ago

@lihaoyi Thank you! I'll update those in mill too. Original Author: lefou