From e145629e0312f405a66e1be2e403509098f90e27 Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Thu, 16 Oct 2025 21:51:54 +0200 Subject: [PATCH 1/6] Define _POSIX_C_SOURCE for signal_helper.c --- core/native/src/main/resources/scala-native/signal_helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/native/src/main/resources/scala-native/signal_helper.c b/core/native/src/main/resources/scala-native/signal_helper.c index 52c13c9dde..4232c64d67 100644 --- a/core/native/src/main/resources/scala-native/signal_helper.c +++ b/core/native/src/main/resources/scala-native/signal_helper.c @@ -1,5 +1,9 @@ #ifdef CATS_EFFECT_SIGNAL_HELPER + #include + +// we'll need POSIX for `sigaction`: +#define _POSIX_C_SOURCE 1 #include typedef void (*Handler)(int); @@ -19,4 +23,5 @@ int cats_effect_install_handler(int signum, Handler handler) { } return sigaction(signum, &action, NULL); } + #endif From 4cdbd6673a39d471fd65ca898563aee746918a06 Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Thu, 16 Oct 2025 22:26:34 +0200 Subject: [PATCH 2/6] SN 0.5.9 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index aa8c3e8cf7..8060409b75 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,7 +3,7 @@ libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "1.1.1" addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.8.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.18.2") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.8") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.9") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.7.2") addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.8.0") From 6eaad9616864a732a84a12ec116d3f65036c1312 Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Thu, 16 Oct 2025 22:46:39 +0200 Subject: [PATCH 3/6] Move define to the beginning of the source file --- core/native/src/main/resources/scala-native/signal_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/native/src/main/resources/scala-native/signal_helper.c b/core/native/src/main/resources/scala-native/signal_helper.c index 4232c64d67..a99cf50f92 100644 --- a/core/native/src/main/resources/scala-native/signal_helper.c +++ b/core/native/src/main/resources/scala-native/signal_helper.c @@ -1,9 +1,9 @@ #ifdef CATS_EFFECT_SIGNAL_HELPER -#include - // we'll need POSIX for `sigaction`: #define _POSIX_C_SOURCE 1 + +#include #include typedef void (*Handler)(int); From 58f77f50c4e9ee1799806357d9c1b2954bbc2f87 Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Fri, 17 Oct 2025 00:28:23 +0200 Subject: [PATCH 4/6] Protect define with ifndef --- core/native/src/main/resources/scala-native/signal_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/native/src/main/resources/scala-native/signal_helper.c b/core/native/src/main/resources/scala-native/signal_helper.c index a99cf50f92..50b4786332 100644 --- a/core/native/src/main/resources/scala-native/signal_helper.c +++ b/core/native/src/main/resources/scala-native/signal_helper.c @@ -1,7 +1,9 @@ #ifdef CATS_EFFECT_SIGNAL_HELPER // we'll need POSIX for `sigaction`: +#ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 1 +#endif #include #include From e40493b12bd07987c4f68b7641b0713a8380c931 Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Fri, 17 Oct 2025 12:15:03 +0200 Subject: [PATCH 5/6] Let's try it with .generateFunctionSourcePositions(true) --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 437677c02f..03857c2a7d 100644 --- a/build.sbt +++ b/build.sbt @@ -363,7 +363,7 @@ Global / tlCommandAliases ++= Map( lazy val nativeTestSettings = Seq( nativeConfig ~= { c => - c.withSourceLevelDebuggingConfig(_.enableAll.generateFunctionSourcePositions(false)) + c.withSourceLevelDebuggingConfig(_.enableAll) .withOptimize( true ) // `false` doesn't work due to https://github.com/scala-native/scala-native/issues/4366 From fc18357e85f5c86816436b7920cc2df98e72f459 Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Fri, 17 Oct 2025 12:15:35 +0200 Subject: [PATCH 6/6] Add clue to assert --- tests/shared/src/test/scala/cats/effect/IOFiberSuite.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/shared/src/test/scala/cats/effect/IOFiberSuite.scala b/tests/shared/src/test/scala/cats/effect/IOFiberSuite.scala index 8a259f562b..6d7e5d4679 100644 --- a/tests/shared/src/test/scala/cats/effect/IOFiberSuite.scala +++ b/tests/shared/src/test/scala/cats/effect/IOFiberSuite.scala @@ -33,7 +33,7 @@ class IOFiberSuite extends BaseSuite with DetectPlatform { s <- IO(f.toString) // _ <- IO.println(s) _ <- f.cancel - _ <- IO(assert(s.matches(pattern))) + _ <- IO(assert(s.matches(pattern), s)) } yield () } @@ -48,7 +48,7 @@ class IOFiberSuite extends BaseSuite with DetectPlatform { _ <- IO.sleep(100.milli) s <- IO(f.toString) _ <- f.cancel - _ <- IO(assert(s.matches(pattern))) + _ <- IO(assert(s.matches(pattern), s)) } yield () } } else {