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

Scala-native support #6

Open
rssh opened this issue Jun 11, 2023 · 2 comments
Open

Scala-native support #6

rssh opened this issue Jun 11, 2023 · 2 comments

Comments

@rssh
Copy link
Owner

rssh commented Jun 11, 2023

Thanks @lavrov for initial part.
Progress can be reported in the scala-native branch.
Currently we have issue with

rssh@rssh4> sbt catsEffectNative/test                                                              ~/work/oss/dotty-cps-async-connect
[info] welcome to sbt 1.9.0 (Homebrew Java 18.0.2.1)
[info] loading global plugins from /Users/rssh/.sbt/1.0/plugins
[info] loading settings for project dotty-cps-async-connect-build from plugins.sbt ...
[info] loading project definition from /Users/rssh/work/oss/dotty-cps-async-connect/project
[info] loading settings for project root from build.sbt,publish.sbt ...
[info] resolving key references (13939 settings) ...
[info] set current project to root (in build file:/Users/rssh/work/oss/dotty-cps-async-connect/)
[error] scala.scalanative.util.UnreachableException$
[error] 	at scala.scalanative.util.UnreachableException$.<clinit>(UnreachableException.scala)
[error] 	at scala.scalanative.util.package$.unreachable(package.scala:9)
[error] 	at scala.scalanative.linker.Reach.reachInst(Reach.scala:774)
[error] 	at scala.scalanative.linker.Reach.$anonfun$reachInsts$1(Reach.scala:748)
[error] 	at scala.scalanative.linker.Reach.$anonfun$reachInsts$1$adapted(Reach.scala:748)
[error] 	at scala.collection.Iterator.foreach(Iterator.scala:943)
[error] 	at scala.collection.Iterator.foreach$(Iterator.scala:943)
[error] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
[error] 	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error] 	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error] 	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error] 	at scala.scalanative.linker.Reach.reachInsts(Reach.scala:748)
[error] 	at scala.scalanative.linker.Reach.reachDefine(Reach.scala:666)
[error] 	at scala.scalanative.linker.Reach.reachDefn(Reach.scala:230)
[error] 	at scala.scalanative.linker.Reach.$anonfun$reachDefn$2(Reach.scala:211)
[error] 	at scala.scalanative.linker.Reach.$anonfun$reachDefn$2$adapted(Reach.scala:200)
[error] 	at scala.Option.fold(Option.scala:251)
[error] 	at scala.scalanative.linker.Reach.reachDefn(Reach.scala:200)
[error] 	at scala.scalanative.linker.Reach.process(Reach.scala:161)
[error] 	at scala.scalanative.linker.Reach$.apply(Reach.scala:1006)
[error] 	at scala.scalanative.linker.Link$.apply(Link.scala:13)
[error] 	at scala.scalanative.build.core.ScalaNative$.$anonfun$link$1(ScalaNative.scala:34)
[error] 	at scala.scalanative.build.Logger.time(Logger.scala:35)
[error] 	at scala.scalanative.build.Logger.time$(Logger.scala:32)
[error] 	at scala.scalanative.build.Logger$$anon$3.time(Logger.scala:88)
[error] 	at scala.scalanative.build.core.ScalaNative$.link(ScalaNative.scala:34)
[error] 	at scala.scalanative.build.Build$.$anonfun$build$1(Build.scala:73)
[error] 	at scala.scalanative.build.Logger.time(Logger.scala:35)
[error] 	at scala.scalanative.build.Logger.time$(Logger.scala:32)
[error] 	at scala.scalanative.build.Logger$$anon$3.time(Logger.scala:88)
[error] 	at scala.scalanative.build.Build$.build(Build.scala:61)
[error] 	at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.$anonfun$scalaNativeConfigSettings$9(ScalaNativePluginInternal.scala:197)
[error] 	at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.interceptBuildException(ScalaNativePluginInternal.scala:366
[error] 	at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.buildNew$1(ScalaNativePluginInternal.scala:197)
[error] 	at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.$anonfun$scalaNativeConfigSettings$11(ScalaNativePluginInternal.scala:231)
[error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
[error] 	at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.$anonfun$scalaNativeConfigSettings$10(ScalaNativePluginInternal.scala:235)
[error] 	at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.$anonfun$scalaNativeConfigSettings$10$adapted(ScalaNativePluginInternal.scala:219)
[error] 	at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
[error] 	at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.buildIfChanged$1(ScalaNativePluginInternal.scala:253)
[error] 	at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.$anonfun$scalaNativeConfigSettings$4(ScalaNativePluginInternal.scala:256)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] 	at sbt.Execute.work(Execute.scala:291)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] 	at java.base/java.lang.Thread.run(Thread.java:833)
[error] (catsEffectNative / Test / nativeLink) scala.scalanative.util.UnreachableException$
[error] Total time: 3 s, completed 11 Jun 2023, 11:47:34

(looks like bug in munit)

@rssh
Copy link
Owner Author

rssh commented Jun 11, 2023

After scala-native-1.14 - better, but looks like all munit should be recompiled

[1] rssh@rssh4> sbt catsEffectNative/test                                                          ~/work/oss/dotty-cps-async-connect
[info] welcome to sbt 1.9.0 (Homebrew Java 18.0.2.1)
[info] loading global plugins from /Users/rssh/.sbt/1.0/plugins
[info] loading settings for project dotty-cps-async-connect-build from plugins.sbt ...
[info] loading project definition from /Users/rssh/work/oss/dotty-cps-async-connect/project
[info] loading settings for project root from build.sbt,publish.sbt ...
[info] resolving key references (13940 settings) ...
[info] set current project to root (in build file:/Users/rssh/work/oss/dotty-cps-async-connect/)
[info] Starting process '/Users/rssh/work/oss/dotty-cps-async-connect/cats-effect/native/target/scala-3.3.0/cps-async-connect-cats-effect-test-out' on port '59346'.
[info] Starting process '/Users/rssh/work/oss/dotty-cps-async-connect/cats-effect/native/target/scala-3.3.0/cps-async-connect-cats-effect-test-out' on port '59348'.
[info] Starting process '/Users/rssh/work/oss/dotty-cps-async-connect/cats-effect/native/target/scala-3.3.0/cps-async-connect-cats-effect-test-out' on port '59350'.
[info] Starting process '/Users/rssh/work/oss/dotty-cps-async-connect/cats-effect/native/target/scala-3.3.0/cps-async-connect-cats-effect-test-out' on port '59351'.
cps.catsEffect.FutureInteropSuite:
cps.catsEffect.ResourceMonadSuite:/ compileIncremental 0s
[info] Starting process '/Users/rssh/work/oss/dotty-cps-async-connect/cats-effect/native/target/scala-3.3.0/cps-async-connect-cats-effect-test-out' on port '59352'.
[info] Starting process '/Users/rssh/work/oss/dotty-cps-async-connect/cats-effect/native/target/scala-3.3.0/cps-async-connect-cats-effect-test-out' on port '59354'.
cps.catsEffect.StupidFizzBuzzSuite:
[info] Starting process '/Users/rssh/work/oss/dotty-cps-async-connect/cats-effect/native/target/scala-3.3.0/cps-async-connect-cats-effect-test-out' on port '59356'.
  + make sure that IO async can adopt Future 0.02s
cps.catsEffect.LazyEffectSuite:le / compileIncremental 0s
  + make sure that Future async can adopt IO 0.00s
  + make sure that F:Async async can adopt Future 0.00s
  + make sure that F:Async is callable from IO 0.00s
  + make sure tagless API wrapped in IO is callable from Future 0.00s
cps.catsEffect.DCAIssue65Suite:
  + use cats resource as scope 0.03s
cps.catsEffecct.ResourceSuite:
  + make sure that async expressions are not evaluating early 0.02s
cps.catsEffect.ApiExampleDJSSuite:
  + make sure that exception is catched inside async expression  0.00s
  + use cats resource as scope with automaticColoring 0.01s
  + use cats resource 0.03s
  + dotty-cps-async:65:global:reading by iterator with global execution context 0.06s
[warn] Force close java.lang.IllegalStateException: Unknown opcode: 4
[warn] Force close java.lang.RuntimeException: Process /Users/rssh/work/oss/dotty-cps-async-connect/cats-effect/native/target/scala-3.3.0/cps-async-connect-cats-effect-test-out finished with non-zero value 137 (0x89)
[error] Test runner interrupted by fatal signal 9
done
  + make sure than API text running ok when all is ok 0.14s
  + make sure than we return error when 1-st text failed 0.11s
abort abort abort
  + make sure than we return false when 2-st request is not ok 0.11s
  + make sure that FizBuzz run N times 1.16s
  + make sure that FizBuzz run N times in async loop 0.00s
  + make sure that FizBuzz run N times in async loop with automatic coloring 0.01s
[error] scala.scalanative.testinterface.common.RPCCore$ClosedException: scala.scalanative.testinterface.NativeRunnerRPC$RunTerminatedException
[error] 	at scala.scalanative.testinterface.common.RPCCore.helpClose(RPCCore.scala:213)
[error] 	at scala.scalanative.testinterface.common.RPCCore.call(RPCCore.scala:151)
[error] 	at scala.scalanative.testinterface.common.RunMuxRPC.call(RunMuxRPC.scala:34)
[error] 	at scala.scalanative.testinterface.adapter.RunnerAdapter.$anonfun$done$1(RunnerAdapter.scala:49)
[error] 	at scala.collection.immutable.List.map(List.scala:297)
[error] 	at scala.scalanative.testinterface.adapter.RunnerAdapter.done(RunnerAdapter.scala:49)
[error] 	at sbt.Defaults$.$anonfun$allTestGroupsTask$16(Defaults.scala:1623)
[error] 	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
[error] 	at scala.collection.immutable.Map$Map1.foreach(Map.scala:193)
[error] 	at scala.collection.TraversableLike.map(TraversableLike.scala:286)
[error] 	at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
[error] 	at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error] 	at sbt.Defaults$.$anonfun$allTestGroupsTask$10(Defaults.scala:1621)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] 	at sbt.Execute.work(Execute.scala:291)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] 	at java.base/java.lang.Thread.run(Thread.java:833)
[error] Caused by: scala.scalanative.testinterface.NativeRunnerRPC$RunTerminatedException
[error] 	at scala.scalanative.testinterface.NativeRunnerRPC.$anonfun$new$1(NativeRunnerRPC.scala:43)
[error] 	at scala.scalanative.testinterface.NativeRunnerRPC.$anonfun$new$1$adapted(NativeRunnerRPC.scala:42)
[error] 	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error] 	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
[error] 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[error] 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
[error] 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
[error] 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
[error] 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
[error] Caused by: java.lang.IllegalStateException: Unknown opcode: 4
[error] 	at scala.scalanative.testinterface.common.RPCCore.$anonfun$handleMessage$1(RPCCore.scala:94)
[error] 	at scala.scalanative.testinterface.common.RPCCore.$anonfun$handleMessage$1$adapted(RPCCore.scala:43)
[error] 	at scala.scalanative.testinterface.common.Serializer$.withInputStream(Serializer.scala:52)
[error] 	at scala.scalanative.testinterface.common.RPCCore.handleMessage(RPCCore.scala:43)
[error] 	at scala.scalanative.testinterface.NativeRunnerRPC.$anonfun$runner$1(NativeRunnerRPC.scala:31)
[error] 	at scala.scalanative.testinterface.NativeRunnerRPC.$anonfun$runner$1$adapted(NativeRunnerRPC.scala:31)
[error] 	at scala.scalanative.testinterface.ComRunner$$anon$1.run(ComRunner.scala:61)
[error] (catsEffectNative / Test / executeTests) scala.scalanative.testinterface.common.RPCCore$ClosedException: scala.scalanative.testinterface.NativeRunnerRPC$RunTerminatedException
[error] Total time: 3 s, completed 11 Jun 2023, 12:33:58
[1] rssh@rssh4>  

@rssh rssh changed the title Scala-native port Scala-native support Jun 11, 2023
@rssh
Copy link
Owner Author

rssh commented Jun 11, 2023

When disabling dotty-cps-async:65 / global exexution context - works.
Need to research

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