-
Notifications
You must be signed in to change notification settings - Fork 560
Labels
Description
I wanted to try cats-effect 3.7.0-RC1 against the latest release of Scala Native 0.5.9. Unfortunately producing binary fails with a following error:
Compiling project (Scala 3.7.2, Scala Native 0.5.9)
Compiled project (Scala 3.7.2, Scala Native 0.5.9)
[info] Linking (multithreadingEnabled=true, disable if not used) (9700 ms)
[info] Discovered 2666 classes and 17685 methods after classloading
[info] Checking intermediate code (quick) (497 ms)
[info] Discovered 2638 classes and 13835 methods after optimization
[info] Optimizing (debug mode) (20444 ms)
[info] Produced 13 LLVM IR files
[info] Generating intermediate code (14405 ms)
[error] /tmp/3168152424178068910/.scala-build/3168152424178068910_16c8be8ad5-2b2bc60792/native/native/dependencies/cats-effect_native0.5_3-3.7.0-RC1-1/scala-native/signal_helper.c:9:22: error: variable has incomplete type 'struct sigaction'
[error] 9 | struct sigaction action;
[error] | ^
[error] /tmp/3168152424178068910/.scala-build/3168152424178068910_16c8be8ad5-2b2bc60792/native/native/dependencies/cats-effect_native0.5_3-3.7.0-RC1-1/scala-native/signal_helper.c:9:12: note: forward declaration of 'struct sigaction'
[error] 9 | struct sigaction action;
[error] | ^
[error] /tmp/3168152424178068910/.scala-build/3168152424178068910_16c8be8ad5-2b2bc60792/native/native/dependencies/cats-effect_native0.5_3-3.7.0-RC1-1/scala-native/signal_helper.c:12:13: error: call to undeclared function 'sigemptyset'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[error] 12 | error = sigemptyset(&action.sa_mask);
[error] | ^
[error] /tmp/3168152424178068910/.scala-build/3168152424178068910_16c8be8ad5-2b2bc60792/native/native/dependencies/cats-effect_native0.5_3-3.7.0-RC1-1/scala-native/signal_helper.c:16:13: error: call to undeclared function 'sigaddset'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[error] 16 | error = sigaddset(&action.sa_mask, 13); // mask SIGPIPE
[error] | ^
[error] /tmp/3168152424178068910/.scala-build/3168152424178068910_16c8be8ad5-2b2bc60792/native/native/dependencies/cats-effect_native0.5_3-3.7.0-RC1-1/scala-native/signal_helper.c:20:12: error: call to undeclared function 'sigaction'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[error] 20 | return sigaction(signum, &action, NULL);
[error] | ^
[error] 4 errors generated.
[info] Compiling to native code (10068 ms)
[info] Total (52793 ms)
Exception in thread "main" scala.scalanative.build.BuildException: Failed to compile /tmp/3168152424178068910/.scala-build/3168152424178068910_16c8be8ad5-2b2bc60792/native/native/dependencies/cats-effect_native0.5_3-3.7.0-RC1-1/scala-native/signal_helper.c
at scala.scalanative.build.LLVM$.$anonfun$compileFile$1(LLVM.scala:123)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
at scala.util.Success.$anonfun$map$1(Try.scala:255)
at scala.util.Success.map(Try.scala:213)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:42)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:74)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
Error: scala.build.errors.ScalaNativeBuildError: Error compiling with Scala Native
Here's a minimal gist to reproduce it https://gist.github.com/majk-p/af00a196ab8c193994992bf8ad7d2c89
To reproduce run: scala run https://gist.github.com/majk-p/af00a196ab8c193994992bf8ad7d2c89