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

Stop using os-lib and upickle(?) #14

Open
keynmol opened this issue Oct 16, 2021 · 2 comments
Open

Stop using os-lib and upickle(?) #14

keynmol opened this issue Oct 16, 2021 · 2 comments
Milestone

Comments

@keynmol
Copy link
Contributor

keynmol commented Oct 16, 2021

Unfortunately, it's a bit of a minefield when used with Ammonite, which brings in its own versions.

I had to to play a bit of Jenga with versions and still get a bincompat error during building a blog:

java.lang.NoSuchMethodError: 'boolean os.copy$.apply$default$7()'
  subatomic.Site.writeAsset(Site.scala:125)
  subatomic.Site.$anonfun$buildAt$1(Site.scala:85)
  subatomic.Site.$anonfun$buildAt$1$adapted(Site.scala:82)
  scala.collection.immutable.Vector.foreach(Vector.scala:1856)
  subatomic.Site.buildAt(Site.scala:82)
  subatomic.builders.blog.Blog$.createSite(Blog.scala:308)
  subatomic.builders.blog.Blog$App.main(Blog.scala:87)
  subatomic.builders.blog.Blog$App.main$(Blog.scala:75)
  ammonite.$file.blog$$anon$1.main(blog.sc:11)
  ammonite.$file.blog$.main(blog.sc:39)
  ammonite.$file.blog$$routes$.$anonfun$apply$1(blog.sc:48)
  ammonite.$file.blog$$routes$.$anonfun$apply$1$adapted(blog.sc:48)
  mainargs.Invoker$.$anonfun$invoke0$3(Invoker.scala:59)

Either shading it (undesirable), or relying on something with stronger bincompat guarantees, or just implementing your own for the small subset of operations that we actually need.

Probably the latter. Or better-files, if it's published for Scala 3.

@keynmol keynmol added this to the 0.1.0 milestone Oct 16, 2021
@keynmol
Copy link
Contributor Author

keynmol commented Oct 16, 2021

Ammonite 2.4.0:

java.lang.NoSuchMethodError: 'boolean os.copy$.apply$default$7()'
  subatomic.Site.writeAsset(Site.scala:125)
  subatomic.Site.$anonfun$buildAt$1(Site.scala:85)
  subatomic.Site.$anonfun$buildAt$1$adapted(Site.scala:82)
  scala.collection.immutable.Vector.foreach(Vector.scala:1856)
  subatomic.Site.buildAt(Site.scala:82)

2.3.8:

Compiling /Users/velvetbaldmime/projects/blog/blog.sc
java.lang.NoSuchMethodError: 'void upickle.core.Types$CaseW.writeSnippet$(upickle.core.Types$CaseW, scala.Function1, upickle.core.ObjVisitor, java.lang.String, upickle.core.Types$Writer, java.lang.Object)'
  subatomic.search.SearchIndex$$anon$12.writeSnippet(SearchIndex.scala:135)
  subatomic.search.SearchIndex$$anon$12.writeToObject(SearchIndex.scala:135)
  subatomic.search.SearchIndex$$anon$12.writeToObject(SearchIndex.scala:135)
  upickle.core.Types$CaseW.write0(Types.scala:208)
  upickle.core.Types$CaseW.write0$(Types.scala:204)
  subatomic.search.SearchIndex$$anon$12.write0(SearchIndex.scala:135)

@keynmol
Copy link
Contributor Author

keynmol commented Oct 16, 2021

For now, I dropped os-lib down to 0.7.2 for anything but Scala 3. Ammonite's latest depends on 0.7.2, so this keeps the binary compatibility issue manageable.

Scala 3 version is still unusable without scalatags, so it doesn't matter much that dependencies diverge.

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

1 participant