Navigation Menu

Skip to content
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

IncompatibleClassChangeError with upickle 1.3.14 and 1.3.15 #351

Closed
lefou opened this issue May 28, 2021 · 6 comments
Closed

IncompatibleClassChangeError with upickle 1.3.14 and 1.3.15 #351

lefou opened this issue May 28, 2021 · 6 comments

Comments

@lefou
Copy link
Member

lefou commented May 28, 2021

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:

  • checkout mill repo, e.g. from tag 0.9.8
  • change the upickle depenency version in build.sc line 100 to either 1.3.14 or 1.3.15
  • run the following: mill -i dev.assembly && rm -rf ~/.mill && out/dev/assembly/dest/mill -i main.test

This is probably because mill loads plugins via $ivy import which are build with older versions of upickle.

@lihaoyi
Copy link
Member

lihaoyi commented Jun 8, 2021

@lefou IIRC uPickle has some binary incompatibility when #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

@lefou
Copy link
Member Author

lefou commented Jun 8, 2021

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?

@lihaoyi
Copy link
Member

lihaoyi commented Jun 8, 2021

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

@lefou
Copy link
Member Author

lefou commented Jun 8, 2021

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).

@lihaoyi
Copy link
Member

lihaoyi commented Jun 8, 2021

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

@lefou
Copy link
Member Author

lefou commented Jun 8, 2021

@lihaoyi Thank you! I'll update those in mill too.

@lefou lefou closed this as completed Jun 8, 2021
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

2 participants