diff --git a/build.sbt b/build.sbt index f0750be91b301..eac1aa9d2936b 100644 --- a/build.sbt +++ b/build.sbt @@ -1370,7 +1370,8 @@ lazy val downloader = (project in file("lib/scala/downloader")) "org.scalatest" %% "scalatest" % scalatestVersion % Test, akkaActor, akkaStream, - akkaHttp + akkaHttp, + akkaSLF4J ) ) .dependsOn(cli) diff --git a/lib/scala/downloader/src/main/scala/org/enso/downloader/http/HTTPDownload.scala b/lib/scala/downloader/src/main/scala/org/enso/downloader/http/HTTPDownload.scala index 9c01f1f3ebf82..3415dc5cf4b4d 100644 --- a/lib/scala/downloader/src/main/scala/org/enso/downloader/http/HTTPDownload.scala +++ b/lib/scala/downloader/src/main/scala/org/enso/downloader/http/HTTPDownload.scala @@ -17,6 +17,7 @@ import org.enso.cli.task.{ import java.nio.charset.{Charset, StandardCharsets} import java.nio.file.Path import scala.concurrent.Future +import scala.jdk.CollectionConverters.IterableHasAsJava /** Represents a HTTP header. */ case class Header(name: String, value: String) { @@ -149,12 +150,29 @@ object HTTPDownload { } implicit private lazy val actorSystem: ActorSystem = { + val loggers: java.lang.Iterable[String] = + Seq("akka.event.slf4j.Slf4jLogger").asJava val config = ConfigFactory .load() + .withValue( + "akka.extensions", + ConfigValueFactory.fromAnyRef(Seq.empty.asJava) + ) + .withValue( + "akka.library-extensions", + ConfigValueFactory.fromAnyRef(Seq.empty.asJava) + ) + .withValue("akka.loggers", ConfigValueFactory.fromAnyRef(loggers)) + .withValue( + "akka.logging-filter", + ConfigValueFactory.fromAnyRef("akka.event.DefaultLoggingFilter") + ) .withValue("akka.loglevel", ConfigValueFactory.fromAnyRef("WARNING")) + ActorSystem( "http-requests-actor-system", - config + config, + classLoader = getClass.getClassLoader // Note [Actor System Class Loader] ) } diff --git a/lib/scala/library-manager/src/main/scala/org/enso/librarymanager/DefaultLibraryProvider.scala b/lib/scala/library-manager/src/main/scala/org/enso/librarymanager/DefaultLibraryProvider.scala index df4d0386ade8a..0cc90ff74d172 100644 --- a/lib/scala/library-manager/src/main/scala/org/enso/librarymanager/DefaultLibraryProvider.scala +++ b/lib/scala/library-manager/src/main/scala/org/enso/librarymanager/DefaultLibraryProvider.scala @@ -110,12 +110,18 @@ class DefaultLibraryProvider( } case Right(version @ LibraryVersion.Published(semver, repository)) => - publishedLibraryProvider - .findLibrary(libraryName, semver, repository) - .map(ResolvedLibrary(libraryName, version, _)) - .toEither - .left - .map(ResolvingLibraryProvider.Error.DownloadFailed) + val res = + publishedLibraryProvider + .findLibrary(libraryName, semver, repository) + .map(ResolvedLibrary(libraryName, version, _)) + .toEither + res match { + case Left(value) => + println(s"Download error: $value") + value.printStackTrace() + case Right(_) => + } + res.left.map(ResolvingLibraryProvider.Error.DownloadFailed) } } } diff --git a/lib/scala/library-manager/src/test/scala/org/enso/librarymanager/published/repository/LibraryDownloadTest.scala b/lib/scala/library-manager/src/test/scala/org/enso/librarymanager/published/repository/LibraryDownloadTest.scala index d1200d0cfcd5a..a35d56a18dd19 100644 --- a/lib/scala/library-manager/src/test/scala/org/enso/librarymanager/published/repository/LibraryDownloadTest.scala +++ b/lib/scala/library-manager/src/test/scala/org/enso/librarymanager/published/repository/LibraryDownloadTest.scala @@ -66,6 +66,7 @@ class LibraryDownloadTest extends AnyWordSpec with Matchers { val sources = pkg.listSources sources should have size 1 sources.head.file.getName shouldEqual "Main.enso" + // TODO [RW] check that the license is missing } finally { server.destroy() server.waitFor()