Closed pishen closed 4 years ago
thanks for reporting and for the repro!
it should be as easy as short-circuiting akka.util.ManifestInfo.checkSameVersion
to true
, we don't have anyhow information from the Manifest, the check is pointless.
Will probably take a look next week during Scala Italy and release and updated version containing the fix.
Sorry for the long delay removed the source cause from akka.util.ManifestInfo
, release is 1.2.5.26
please note that this is not enough to link your example due to missing java8 time implementation in Scala.Js itself.
You can try to use:
https://github.com/cquiroz/scala-java-time
but it has possible limitation as well.
@andreaTP The problem is fixed in version 1.2.5.26, however in version 2.2.6.3 the problem still remains for me. Is the fix #98 also present in version 2.2.6.3?
Hey @ChristianPolt it does indeed: https://github.com/akka-js/akka.js/blob/v2.2.6.3/akka-js-actor/js/src/main/scala/akka/util/ManifestInfo.scala#L165-L185
it's my understanding that this specific method shouldn't give any linking problem anymore.
Can you check if it's a problem with caching running an sbt clean
?
If not probably the liker exception is different, can you please post it and/or provide a reproduction?
The following example does not work with Version "2.2.6.3", but works with Version "1.2.5.26":
build.properties:
sbt.version=1.3.8
plugins.sbt:
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
Main.scala:
package core
import java.time.LocalDateTime
object Main {
def main(args: Array[String]): Unit = {
LocalDateTime.now()
}
}
build.sbt:
val akkaJsVersionNotWorking = "2.2.6.3"
val akkaJsVersionWorking = "1.2.5.26"
lazy val root = (project in file("."))
.enablePlugins(ScalaJSPlugin)
.settings(
name := "akka_js_test",
scalaVersion := "2.12.11",
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"org.akka-js" %%% "akkajsactor" % akkaJsVersionNotWorking,
"io.github.cquiroz" %%% "scala-java-time" % "2.0.0-M12"
)
)
The output (fastOptJS) with the linking errors is attached in this file: LinkingErrors.txt
Thanks for the reproduction @ChristianPolt !
It's not a regression in Akka.Js, this simply depends on the order dependencies are picked-up by the linker that is not deterministic.
Basically Akka.Js ships with scalajs-java-time
that is strictly a minimal subset of scala-java-time
(e.g. it doesn't contain java.time.LocalDateTime
), in this case the fix(and to make a reproduciple build even with 1.2.5.26
) is to exclude from the transitive libraries scalajs-java-time
:
"org.akka-js" %%% "akkajsactor" % akkaJsVersionNotWorking exclude("org.scala-js", "scalajs-java-time")
Since this is a problem that happened in the past and most likely is going to affect users in the future I will follow up with this explanation in the readme (if @cquiroz doesn't have a better suggestion :-) ).
Here's a minimal project to reproduce it: https://github.com/pishen/circe_akka_js_sbt
This only happen when using Akka.js and circe-java8 and sbt 1.3.0 together. If I downgrade to sbt 1.2.8 or remove circe-java8 or remove akka.js, things will work.
When running
fastOptJS
, I saw this:The whole error message is available here: https://gist.github.com/pishen/e000860e99a58637bf5fd33dd0659edc