-
Notifications
You must be signed in to change notification settings - Fork 334
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
Support scala-natve 0.5.0 #2318
Conversation
fa33f8d
to
df0ef77
Compare
df0ef77
to
826299c
Compare
826299c
to
91d0686
Compare
BTW to build it you must to publish localy |
1c69be4
to
9cdd90d
Compare
@catap I am trying this, seems like when building with Scala 3 it will fail with:
Perhaps the related scala-xml is not published yet? |
9cdd90d
to
2262672
Compare
@cheeseng ineed, I've locally updated to scala-xml-2.2.0, and publish it for Scala-Native-0.5.0-RC2 to unblock it. Unfortently my yesterday test wasn't full, and required changed leads to update of scala3 version as well (otherwise it will be missmatch of ABI verison), and the last leads to a wired error:
So, if you have any advice how to fix it, I'd like any help. Or, feel free to push into my branch. My goal is prepare scalatest for the future release of scala-native, at least locally, to run heavy unit test on my code base, which usually allows to catch wired bugs :) |
2262672
to
0bcfaf8
Compare
Well, seems that downgrade to I continue to test it, and as soon as it's fully tested will convert this draft back to PR. |
BTW opened a question in scala-xml: scala/scala-xml#713 |
@catap Fyi to build with Scala 3.4 you'll need: main...cheeseng:scalatest:feature-scala-3.4 But I think Scala 3.3 should be the better target since it is LTS. |
@cheeseng everything had passed with scala-3.3.3 |
@cheeseng you seems the right person to ask. During my test migration a few tests are failed with reason:
can you suggest any easy way to unblock it? |
And...
seems to fix this test |
After future digging, just thoughts. Probably #1858 need to be "adjusted". It doesn't requires for Scala-Native-0.5.0 anymore when Multithreading is enabled. It can be checked via But it exists on 0.5.0 only, so everything before will be literally broken. I have no idea how to support old scala native and new one on the same code base. |
@catap Hmm, I wonder if we still want to support scala-native 0.4 going forward? If need to we probably can do so with a generator in sbt build I think. |
On Sun, 17 Mar 2024 01:07:10 +0100, Chua Chee Seng wrote:
@catap Hmm, I wonder if we still want to support scala-native 0.4 going forward? If need to we probably can do so with a generator in sbt build I think.
Frankly speaking I had thought the same. Scala-Native 0.5.0 brings support
of multithreading which is a kind of deal breaker.
As far as I can say the only platform where it doesn't work which SN
supports is NetBSD. Why? Because I haven't found enough time to polish it,
but I absolutley sure that I'll do it sooner or later.
And I assume that set of users of Scala-Native on NetBSD is empty because
I've added experemental support a week ago, and such use case can be
ignored.
So, where I stay it seems that droping support of scala-native before 0.5.0
at the next release and make things easy to support... well, I haven't see
why not.
Special that SN-0.5.0 doesn't binary compatible with old version and
requires to republish everything.
Or, add some macros like SCALA-NATIVE-BEFORE-0.5.0 but when it should end?
…--
wbr, Kirill
|
@cheeseng I just added one more commit which rework #1858 and brokes compatibillity with Scala-Native before 0.5.0 Trivial test case work on both enabled and disabled multithreading builds. The whole test case almost work, but it may stuck on some random test. Probably related to issues inside SN itself, see for example: scala-native/scala-native#3846 |
//SCALATESTNATIVE-ONLY implicit override def executionContext = | ||
//SCALATESTNATIVE-ONLY if (scala.scalanative.meta.LinktimeInfo.isMultithreadingEnabled) | ||
//SCALATESTNATIVE-ONLY scala.concurrent.ExecutionContext.Implicits.global | ||
//SCALATESTNATIVE-ONLY else super.executionContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really needed? Scala Native does already use real, ForkJoinPool based ExecutionContext when multithreading is enabled or QueueExecutionContext in singlet-hreaded mode. Although I don't know what lives under super.executionContext
https://github.com/scala-native/scala-native/blob/8ac5d27670389495ca3493213a61105df9a6f95b/scalalib/overrides-2.13/scala/concurrent/ExecutionContext.scala.patch#L16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WojciechMazur thanks fro you feedback. It uses https://github.com/scalatest/scalatest/blob/3.2.x-new/jvm/core/src/main/scala/org/scalatest/concurrent/SerialExecutionContext.scala under super.executionContext
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long story short: with this version it work with and without multithreading out the box.
I had encountered two issues scala-native/scala-native#3846 and scala-native/scala-native#3848 with enabled multithreading, but it seems to be Scala-Native related or/and my code (libuv integration) which I still "clean" for multithreading.
I think this PR still is not ready and needs adaption to added multithreading support in Scala Native. Test command: [error] Failed tests:
[error] org.scalatest.featurespec.DeprecatedAsyncFeatureSpecSpec
[error] org.scalatest.featurespec.AsyncFeatureSpecLikeSpec
[error] org.scalatest.featurespec.FixtureAsyncFeatureSpecLikeSpec
[error] org.scalatest.featurespec.DeprecatedAsyncFeatureSpecLikeSpec
[error] org.scalatest.featurespec.AsyncFeatureSpecSpec
[error] org.scalatest.featurespec.FixtureAsyncFeatureSpecSpec It might be related to using single threaded stubs for java.util.concurrent types |
On Sun, 24 Mar 2024 23:38:53 +0100, Wojciech Mazur wrote:
I think this PR still is not ready and needs adaption to added multithreading support in Scala Native.
Theres a plenty of tests that fail especially the async one that were referenced in reported SN issue.
Test command: `scalatestFeatureSpecTestDottyNative/test`
Output:
```scala
[error] Failed tests:
[error] org.scalatest.featurespec.DeprecatedAsyncFeatureSpecSpec
[error] org.scalatest.featurespec.AsyncFeatureSpecLikeSpec
[error] org.scalatest.featurespec.FixtureAsyncFeatureSpecLikeSpec
[error] org.scalatest.featurespec.DeprecatedAsyncFeatureSpecLikeSpec
[error] org.scalatest.featurespec.AsyncFeatureSpecSpec
[error] org.scalatest.featurespec.FixtureAsyncFeatureSpecSpec
```
Good point. I'll dig into this and do somethig with all these tests.
Maybe it allows to reproduce the deadlock.
…--
wbr, Kirill
|
472f6a4
to
0bcfaf8
Compare
@catap can we somehow help with this? |
On Fri, 12 Apr 2024 15:08:14 +0200, Łukasz Biały wrote:
@catap can we somehow help with this?
As soon as scala-xml and other dependencies are released for SN-0.5.0, I'll
update this branch.
Right now it works well with one deadlock which can be reproduced by
specific edge case (my codebase), and I think it should be fixed inside SN,
and not scalatests.
So, I live with assumption that as soon as dependencies are updated, it
should pass CI and can be merged and released.
…--
wbr, Kirill
|
@catap I just tried with the released 0.5.0, seems working fine for Scala 2.12 and 2.13 (Scala 2.11 seems not supported), but for the scala-xml 2.2.0 the build for Scala 3 seems like not available yet:
|
@cheeseng PR to switch scala-xml to scala-native-0.5.0 is here: scala/scala-xml#716 I hope that it will be merged and released soon. |
It has a few changes in build plugin, which requires to cleanup a bit build script. And one deprectated class was removed. Tested as: ``` export SCALANATIVE_VERSION=0.5.0 sbt clean sbt ++2.12.17 "project scalacticNative" clean publishLocal sbt ++2.13.10 "project scalacticNative" clean publishLocal sbt "project scalacticDottyNative" clean publishLocal sbt ++2.12.17 "project scalatestNative" clean publishLocal sbt ++2.13.10 "project scalatestNative" clean publishLocal sbt "project scalatestDottyNative" clean publishLocal sbt ++2.12.17 "project scalatestAppNative" clean publishLocal sbt ++2.13.10 "project scalatestAppNative" clean publishLocal sbt "project scalatestAppDottyNative" clean publishLocal ```
0bcfaf8
to
1d7043c
Compare
Now it's blocked by https://github.com/scala/scala-parser-combinators |
Linked issue: scala/scala-parser-combinators#550 |
1d7043c
to
de7f0df
Compare
de7f0df
to
39eb8d9
Compare
39eb8d9
to
5053c34
Compare
@cheeseng CI is failing on scala-js. Anyway, I assume that you have already figured it out because main branch has updated version as well. So, feel free to harvest from this PR support of SN-0.5.0 and dependencies. But all of them should be used with modern enoug Scala.js. |
@catap Fyi I am trying this now. |
Closed in favour of #2322 |
* Update Scala, dependencies and sbt plugins * Remove warnings * Rollback scala-native to v.0.4.x Because of scalatest/scalatest#2318 * Fix compilation errors * Fix compilation errors * scalacheck 1.18.0 is only build for scala-native v.0.5.x * Clean ci.yml * Improve `testJvms` CI step to test on 11, 17 and 21 * Remove compilation errors * Remove compilation errors * Simplify scala versions declarations * Unify CI declarations * Fix import * Remove compilation errors * Remove custom sbt script * Update actions/setup-java * Update actions/checkout * Fix CI * Remove compilation errors * Try fix CI error: ``` [warn] In the last 10 seconds, 5.18 (52.6%) were spent in GC. [Heap: 0.00GB free of 1.00GB, max 1.00GB] Consider increasing the JVM heap using `-Xmx` or try a different collector, e.g. `-XX:+UseG1GC`, for better performance. [warn] In the last 10 seconds, 6.369 (67.4%) were spent in GC. [Heap: 0.00GB free of 1.00GB, max 1.00GB] Consider increasing the JVM heap using `-Xmx` or try a different collector, e.g. `-XX:+UseG1GC`, for better performance. total used free shared buffers cache available Mem: 16768 2589 11296 35 230 2652 13780 Swap: 7516 0 7516 Total: 24284 2589 18812 [error] ## Exception when compiling 16 sources to /home/runner/work/zio/zio/scalafix/input/target/scala-2.13/classes ``` * scalafmt * Fix CI * Fix CI * `Compile / fork := false` is declared twice in the `doc` module * Debug sbt command * Put back `JVM_OPTS` envvar * Rollback `Compile / fork` change * debug * debug * debug * debug * debug * debug * debug * Use .jvmopts-ci * Prefer `SBT_OPTS` * Debug $SBT_OPTS * Rollback: Debug $SBT_OPTS * clean * Add more debug for future maintainers * clean * Remove Java 17 from `testJvms` CI step. It's already tested in other jobs * Fix compilation * Fix `build-website` CI step
It has a few changes in build plugin, which requires to cleanup a bit build script.
And one deprectated class was removed.
Tested as: