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

Broken Scala Native tests on v1.0.0-M9 #695

Closed
valencik opened this issue Sep 14, 2023 · 3 comments · Fixed by #700
Closed

Broken Scala Native tests on v1.0.0-M9 #695

valencik opened this issue Sep 14, 2023 · 3 comments · Fixed by #700

Comments

@valencik
Copy link
Collaborator

valencik commented Sep 14, 2023

The latest milestone release (v1.0.0-M9) appears to break tests on Scala Native.
The likely culprit is some complication with #693 interacting with cats-effect.

Related links:

Edit: If downstream users see an error like:

[error] /usr/bin/ld: /home/runner/work/lucille/lucille/core/.native/target/scala-3.3.1/native-test/native-code-nativelib_native0.4_3-0.4.15-1/scala-native/gc/immix/Marker.c.o: in function `Object_IsWeakReference':
[error] Marker.c:(.text+0x88): undefined reference to `__weak_ref_ids_min'
[error] /usr/bin/ld: Marker.c:(.text+0xa2): undefined reference to `__weak_ref_ids_max'
[error] clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is actually caused by not being on the latest Scala Native 0.4.15

@armanbilge
Copy link
Contributor

More details in this CE issue.

I'm operating under the assumption that this is a CE bug, but I'm not sure yet.

@armanbilge
Copy link
Contributor

I was able to reproduce without CE.

//> using dep org.scalameta::munit::1.0.0-M9
//> using nativeVersion 0.4.15

import scala.concurrent.duration.*
import scala.concurrent.*

class MySuite extends munit.FunSuite:
  override implicit def munitExecutionContext = ExecutionContext.global

  test("boo"):
    val p = Promise[Unit]()
    ExecutionContext.global.execute { () =>
      Thread.sleep(1000)
      p.success(())
    }
    p.future

@valencik
Copy link
Collaborator Author

One tiny step further, we can drop the Thread.sleep() and still get the failure on native.
Note that this now also runs on Scala JS and passes there.

//> using dep org.scalameta::munit::1.0.0-M9
//> using nativeVersion 0.4.15

import scala.concurrent.duration.*
import scala.concurrent.*

class MySuite extends munit.FunSuite:
  override implicit def munitExecutionContext = ExecutionContext.global

  test("boo"):
    val p = Promise[Unit]()
    ExecutionContext.global.execute { () => p.success(()) }
    p.future

scala-cli test --native iss695.scala

MySuite:
  + boo 0.00s
Test runner interrupted by fatal signal 9
Error: scala.scalanative.testinterface.common.RPCCore$ClosedException: scala.scalanative.testinterface.NativeRunnerRPC$RunTerminatedException

scala-cli test --js iss695.scala

MySuite:
  + boo 0.00s

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

Successfully merging a pull request may close this issue.

2 participants