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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

scala-native Scala 3 support #2097

Closed
xuwei-k opened this issue Jan 23, 2022 · 25 comments
Closed

scala-native Scala 3 support #2097

xuwei-k opened this issue Jan 23, 2022 · 25 comments

Comments

@xuwei-k
Copy link

xuwei-k commented Jan 23, 2022

馃檹

@cheeseng
Copy link
Contributor

@xuwei-k Fyi we are unable to release Scala 3 build for scala-native yet, but I have bumped up scala-native used to build artifacts for 3.2.11 and staged them. We'll work on add on build for Scala 3 scala-native for 3.2.11.

@cheeseng
Copy link
Contributor

@xuwei-k Unfortunately this is now blocked by scala-xml 2.0.1 not being published for Scala 3 native:

https://mvnrepository.com/artifact/org.scala-lang.modules/scala-xml

@SethTisue Any chance the scala-xml build for Scala 3 native can be published?

Thanks.

@cheeseng
Copy link
Contributor

@xuwei-k @SethTisue Seems like this needs to be completed first:

scala/scala-xml#584

@SethTisue
Copy link
Contributor

I can't really afford to learn about Scala Native details myself, but I can certainly roll a scala-xml release once Yoshida-san and/or other volunteers finish that PR.

@sideeffffect
Copy link
Contributor

There's a PR now for scala-xml, just waiting to be merged scala/scala-xml#592

@catap
Copy link
Contributor

catap commented Apr 4, 2022

@cheeseng scala-xml-2.1.0 was released with support of scala3 at scala-native.

May I ask you to move forward here? Thanks!

@catap
Copy link
Contributor

catap commented Apr 4, 2022

Here it is: #2114

@cheeseng
Copy link
Contributor

cheeseng commented Apr 5, 2022

@catap Sure, I'll work on it, thanks for informing!

@cheeseng
Copy link
Contributor

@catap I have staged 3.2.10 that includes scala-native build for scala 3, but when I tried to use it from scalatestplus-scalacheck I encountered the following error:

[error] Found 8 missing definitions while linking
[error] Not found Top(org.scalatest.SuitesL20org.scalatest.SuitesL30scala.collection.immutable.Seq$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.SuitesL20org.scalatest.SuitesL30scala.collection.immutable.Seq$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/core.native/target/scala-3/src_managed/main/org/scalatest/Suites.scala:57
[error] Not found Top(org.scalatest.funspec.AnyFunSpecL32org.scalatest.funspec.AnyFunSpec$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.funspec.AnyFunSpecL32org.scalatest.funspec.AnyFunSpec$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/funspec.native/target/scala-3/src_managed/main/org/scalatest/funspec/AnyFunSpec.scala:1631
[error] Not found Top(org.scalatest.funsuite.AnyFunSuiteL34org.scalatest.funsuite.AnyFunSuite$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.funsuite.AnyFunSuiteL34org.scalatest.funsuite.AnyFunSuite$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/funsuite.native/target/scala-3/src_managed/main/org/scalatest/funsuite/AnyFunSuite.scala:1563
[error] Not found Top(org.scalatest.tools.FrameworkL29org.scalatest.tools.Framework$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.tools.FrameworkL29org.scalatest.tools.Framework$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/core.native/target/scala-3/src_managed/main/org/scalatest/tools/Framework.scala:24
[error] Undefined definitions found in reachability phase
[error] (Test / nativeLink) Undefined definitions found in reachability phase
[error] Total time: 29 s, completed Apr 19, 2022 8:58:55 PM

Do you have any idea how we can fix this?

@catap
Copy link
Contributor

catap commented Apr 19, 2022

@cheeseng may I ask you which commit / branch have you used to test it? Because it is a things that blocking me I'd love to help :)

@cheeseng
Copy link
Contributor

@catap Sure, I am staging 3.2.12 from this branch of my fork, in this PR:

#2121

and the exact branch URL is:

https://github.com/cheeseng/scalatest/tree/feature-3.2.12-rel

It is late here so I'll have to call it a day, hopefully we can continue to publish 3.2.12 that includes a working scala-native build for scala 3 tomorrow!

Thanks! :)

@cheeseng
Copy link
Contributor

@catap Just fyi you may run the scala-native for scala 3 tests by:

sbt scalatestTestDottyNative/test

which seems to run the tests fine, but after I staged it and use it from scalatestplus-scalacheck it encountered the above error, same build for scala 2.12 and 2.13 did work though.

I read from other discussion that it may be due to osgi, that does match with the breaking behavior of happening only after being staged to Sonatype though. cc @LeeTibbert

@catap
Copy link
Contributor

catap commented Apr 19, 2022

@cheeseng the first idea is cheeseng#4 can I ask you to try it?

@cheeseng
Copy link
Contributor

@catap Sure I'll try it a try today, thanks for the PR!

@cheeseng
Copy link
Contributor

@catap Hmm, unfortunately it still failed with the same error:

[error] Found 8 missing definitions while linking
[error] Not found Top(org.scalatest.SuitesL20org.scalatest.SuitesL30scala.collection.immutable.Seq$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.SuitesL20org.scalatest.SuitesL30scala.collection.immutable.Seq$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/core.native/target/scala-3/src_managed/main/org/scalatest/Suites.scala:57
[error] Not found Top(org.scalatest.funspec.AnyFunSpecL32org.scalatest.funspec.AnyFunSpec$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.funspec.AnyFunSpecL32org.scalatest.funspec.AnyFunSpec$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/funspec.native/target/scala-3/src_managed/main/org/scalatest/funspec/AnyFunSpec.scala:1631
[error] Not found Top(org.scalatest.funsuite.AnyFunSuiteL34org.scalatest.funsuite.AnyFunSuite$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.funsuite.AnyFunSuiteL34org.scalatest.funsuite.AnyFunSuite$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/funsuite.native/target/scala-3/src_managed/main/org/scalatest/funsuite/AnyFunSuite.scala:1563
[error] Not found Top(org.scalatest.tools.FrameworkL29org.scalatest.tools.Framework$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.tools.FrameworkL29org.scalatest.tools.Framework$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/core.native/target/scala-3/src_managed/main/org/scalatest/tools/Framework.scala:24
[error] Undefined definitions found in reachability phase
[error] (Test / nativeLink) Undefined definitions found in reachability phase

Build for Scala 2.13 and 2.12 still works though.

@catap
Copy link
Contributor

catap commented Apr 20, 2022

@cheeseng can you share exactly command which have you used to have this error? sbt scalatestTestDottyNative/test works fine on my side, but I may have some caching / etc somewhere, and if it the command I'll clone the fresh repo to try it one more time.

@cheeseng
Copy link
Contributor

@catap Yes sbt scalatestTestDottyNative/test should work fine, I hit the error only when I tried to use the artifacts I staged in Sonatype from scalatestplus-scalacheck in this branch:

https://github.com/scalatest/scalatestplus-scalacheck/tree/feature-3.2.12.0-rel

to get the error you can run:

sbt ++3.1.2 scalatestPlusScalaCheckNative/test

To test that you'll need to add the staged repo in your ~/.sbt/ , can I email the repo urls to kirill@korins.ky ?

@catap
Copy link
Contributor

catap commented Apr 20, 2022

Yep, this is my email, feel free to use it

@cheeseng
Copy link
Contributor

@catap I just sent you the repo url, can you check your inbox?

@catap
Copy link
Contributor

catap commented Apr 20, 2022

@cheeseng on my machine I have:

[error] Found 8 missing definitions while linking
[error] Not found Top(org.scalatest.SuitesL20org.scalatest.SuitesL30scala.collection.immutable.Seq$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.SuitesL20org.scalatest.SuitesL30scala.collection.immutable.Seq$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/core.native/target/scala-3/src_managed/main/org/scalatest/Suites.scala:57
[error] Not found Top(org.scalatest.funspec.AnyFunSpecL32org.scalatest.funspec.AnyFunSpec$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.funspec.AnyFunSpecL32org.scalatest.funspec.AnyFunSpec$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/funspec.native/target/scala-3/src_managed/main/org/scalatest/funspec/AnyFunSpec.scala:1631
[error] Not found Top(org.scalatest.funsuite.AnyFunSuiteL34org.scalatest.funsuite.AnyFunSuite$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.funsuite.AnyFunSuiteL34org.scalatest.funsuite.AnyFunSuite$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/funsuite.native/target/scala-3/src_managed/main/org/scalatest/funsuite/AnyFunSuite.scala:1563
[error] Not found Top(org.scalatest.tools.FrameworkL29org.scalatest.tools.Framework$scalanative$ReflectivelyInstantiate$)
[error] Not found Member(Top(org.scalatest.tools.FrameworkL29org.scalatest.tools.Framework$scalanative$ReflectivelyInstantiate$),RE)
[error] 	at /home/cheeseng/git/scalatest/dotty/core.native/target/scala-3/src_managed/main/org/scalatest/tools/Framework.scala:24
[error] Undefined definitions found in reachability phase
[error] (scalatestPlusScalaCheckNative / Test / nativeLink) Undefined definitions found in reachability phase

=> seems you have published wrong paths. Try to understand why.

@cheeseng
Copy link
Contributor

@catap I think I found the cause, for Scala 3 it seems to have this extra package in the compiled classes:

Screenshot from 2022-04-21 09-51-35

I'll include it in the osgi export package list and try again, I'll drop the staged repo I sent you earlier.

@cheeseng
Copy link
Contributor

@catap Fyi seems to fix with the following commit:

f4e133c

Had to use wildcard for the osgi export package settings to include the generated package mentioned above, a bit weird that it is not needed for scala 2 build though.

Anyway I'll re-stage 3.2.12 release today, as I think scala-js needs this release also.

Thanks for your help!

@catap
Copy link
Contributor

catap commented Apr 21, 2022

@cheeseng I glade that you figured it out. I just re-published it from scratch on my machine to start digging :)

@lolgab
Copy link

lolgab commented Apr 28, 2022

@cheeseng Can this issue be closed now? It seems to be solved by scalatest 3.2.12

@cheeseng
Copy link
Contributor

Build included in 3.2.12. Thanks.

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

6 participants