almond-sh / almond

A Scala kernel for Jupyter
https://almond.sh
BSD 3-Clause "New" or "Revised" License
1.59k stars 239 forks source link

Support for typelevel scala > 2.11. #185

Open lJoublanc opened 6 years ago

lJoublanc commented 6 years ago

The Installer script has instructions to set up typelevel scala. However, since about version 2.12, the typelevel compiler artifacts have a suffix -bin-typelevel-n where n is the language feature number. This means coursier fails to fetch the packages.

This is easy to fix by tweaking the script. However, then the kernel fails to load:

←[2KDownloading https://repo1.maven.org/maven2/org/jupyter-scala/ammonite-runtim
e_2.12.2-bin-typelevel-4/0.8.3-1/ammonite-runtime_2.12.2-bin-typelevel-4-0.8.3-1
.pom
Downloading https://repo1.maven.org/maven2/org/jupyter-scala/ammonite-runtime_2.
12.2-bin-typelevel-4/0.8.3-1/ammonite-runtime_2.12.2-bin-typelevel-4-0.8.3-1.pom
.sha1
Downloading https://oss.sonatype.org/content/repositories/releases/org/jupyter-s
cala/ammonite-runtime_2.12.2-bin-typelevel-4/0.8.3-1/ammonite-runtime_2.12.2-bin
-typelevel-4-0.8.3-1.pom.sha1
Downloading https://oss.sonatype.org/content/repositories/releases/org/jupyter-s
cala/ammonite-runtime_2.12.2-bin-typelevel-4/0.8.3-1/ammonite-runtime_2.12.2-bin
-typelevel-4-0.8.3-1.pom
https://oss.sonatype.org/content/repositories/releases/org/jupyter-scala/ammoà
https://oss.sonatype.org/content/repositories/releases/org/jupyter-scala/ammoà

https://oss.sonatype.org/content/repositories/releases/org/jupyter-scala/ammoà
https://oss.sonatype.org/content/repositories/releases/org/jupyter-scala/ammoà

https://oss.sonatype.org/content/repositories/releases/org/jupyter-scala/ammoà
https://oss.sonatype.org/content/repositories/releases/org/jupyter-scala/ammoà

Exception in thread "main" java.lang.RuntimeException: ammonite.runtime.tools.De
pendencyThing$IvyResolutionException: failed to resolve dependencies:
  Dependency(org.jupyter-scala:ammonite-runtime_2.12.2-bin-typelevel-4,0.8.3-1,c
ompile,Set(),Attributes(,),false,true): not found: C:\Users\ljoublanc\.ivy2\loca
l\org.jupyter-scala\ammonite-runtime_2.12.2-bin-typelevel-4\0.8.3-1\ivys\ivy.xml
, not found: https://repo1.maven.org/maven2/org/jupyter-scala/ammonite-runtime_2
.12.2-bin-typelevel-4/0.8.3-1/ammonite-runtime_2.12.2-bin-typelevel-4-0.8.3-1.po
m, not found: https://oss.sonatype.org/content/repositories/releases/org/jupyter
-scala/ammonite-runtime_2.12.2-bin-typelevel-4/0.8.3-1/ammonite-runtime_2.12.2-b
in-typelevel-4-0.8.3-1.pom
        at jupyter.kernel.server.ServerApp$.apply(ServerApp.scala:174)
        at jupyter.scala.JupyterScalaApp.delayedEndpoint$jupyter$scala$JupyterSc
alaApp$1(JupyterScala.scala:107)
        at jupyter.scala.JupyterScalaApp$delayedInit$body.apply(JupyterScala.sca
la:13)
        at scala.Function0.apply$mcV$sp(Function0.scala:34)
        at scala.Function0.apply$mcV$sp$(Function0.scala:34)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:
12)
        at caseapp.App.$anonfun$apply$1(App.scala:47)
        at caseapp.App.$anonfun$apply$1$adapted(App.scala:46)
        at scala.collection.immutable.List.foreach(List.scala:389)
        at scala.collection.generic.TraversableForwarder.foreach(TraversableForw
arder.scala:35)
        at scala.collection.generic.TraversableForwarder.foreach$(TraversableFor
warder.scala:35)
        at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:44)
        at caseapp.App.apply(App.scala:46)
        at caseapp.App.apply$(App.scala:45)
        at jupyter.scala.JupyterScalaApp.apply(JupyterScala.scala:13)
        at caseapp.AppOf.main(App.scala:121)
        at jupyter.scala.JupyterScala.main(JupyterScala.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at coursier.cli.qJ.a(Unknown Source)
        at coursier.cli.qI.j(Unknown Source)
        at coursier.cli.qO.a(Unknown Source)
        at d.g.a.c(Unknown Source)
        at b.b.d_(Unknown Source)
        at d.b.d.E.g(Unknown Source)
        at d.b.e.aU.g(Unknown Source)
        at a.c.a(Unknown Source)
        at coursier.cli.qI.b(Unknown Source)
        at coursier.cli.O.b(Unknown Source)
        at b.I.d_(Unknown Source)
        at d.E.h(Unknown Source)
        at a.aH.a(Unknown Source)
        at coursier.cli.Coursier.main(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at coursier.Bootstrap.main(Bootstrap.java:412)
Caused by: ammonite.runtime.tools.DependencyThing$IvyResolutionException: failed
 to resolve dependencies:
  Dependency(org.jupyter-scala:ammonite-runtime_2.12.2-bin-typelevel-4,0.8.3-1,c
ompile,Set(),Attributes(,),false,true): not found: C:\Users\ljoublanc\.ivy2\loca
l\org.jupyter-scala\ammonite-runtime_2.12.2-bin-typelevel-4\0.8.3-1\ivys\ivy.xml
, not found: https://repo1.maven.org/maven2/org/jupyter-scala/ammonite-runtime_2
.12.2-bin-typelevel-4/0.8.3-1/ammonite-runtime_2.12.2-bin-typelevel-4-0.8.3-1.po
m, not found: https://oss.sonatype.org/content/repositories/releases/org/jupyter
-scala/ammonite-runtime_2.12.2-bin-typelevel-4/0.8.3-1/ammonite-runtime_2.12.2-b
in-typelevel-4-0.8.3-1.pom
        at ammonite.runtime.tools.DependencyThing.resolveArtifact(DependencyThin
g.scala:93)
        at ammonite.interp.Interpreter.loadIvy(Interpreter.scala:665)
        at ammonite.interp.Interpreter$DefaultLoadJar.ivy(Interpreter.scala:853)

        at jupyter.scala.Interp.<init>(Interp.scala:88)
        at jupyter.scala.JupyterScalaApp$$anon$5.apply(JupyterScala.scala:98)
        at jupyter.scala.JupyterScalaApp$$anon$5.apply(JupyterScala.scala:97)
        at jupyter.kernel.server.Server$.launch(Server.scala:80)
        at jupyter.kernel.server.Server$.apply(Server.scala:123)
        at jupyter.kernel.server.ServerApp$.$anonfun$apply$1(ServerApp.scala:171
)
        at scala.util.Try$.apply(Try.scala:209)
        at jupyter.kernel.server.ServerApp$.apply(ServerApp.scala:171)
        ... 39 more

Not certain if this is a problem with upstream ammonite, or jupyter-kernel.

Note that it's trying to fetch non-exiting ammonite artifacts - it's tagged on the -bin-typelevel-4 suffix to the package names. I can't find where this is inferred in the code.

lJoublanc commented 6 years ago

I suspect this is because the ammonite-xx dependencies have a CrossBuild.full qualifier. Will try changing this to CrossBuild.patch, to see if that works. On a side-note it seems that SBT 13.x artifacts have been removed from maven central just today.

lJoublanc commented 6 years ago

The above change didn't work. :( any help appreciated.