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

Update zio and reactivate native multi threading (#720) #732

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:
jvm: ${{ matrix.java }}
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Install libuv
- name: Install Bohem GC
if: matrix.platform == 'Native'
run: sudo apt-get update && sudo apt-get install -y libuv1-dev
run: sudo apt-get update && sudo apt-get install -y libgc-dev
- name: Run tests
run: sbt ++${{ matrix.scala }}! test${{ matrix.platform }}

Expand Down
16 changes: 14 additions & 2 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import BuildInfoKeys.*
import scalafix.sbt.ScalafixPlugin.autoImport.*
import scalanativecrossproject.NativePlatform

import scala.scalanative.build.{ GC, Mode }
import scala.scalanative.sbtplugin.ScalaNativePlugin.autoImport.nativeConfig

object BuildHelper {
Expand All @@ -27,7 +28,7 @@ object BuildHelper {
val Scala213: String = versions("2.13")
val Scala3: String = versions("3.3")

val zioVersion = "2.1.7"
val zioVersion = "2.1.9"
val zioJsonVersion = "0.7.2"
val zioPreludeVersion = "1.0.0-RC28"
val zioOpticsVersion = "0.2.2"
Expand Down Expand Up @@ -188,7 +189,18 @@ object BuildHelper {
baseDirectory.value
)
},
nativeConfig ~= { _.withMultithreading(false) }
nativeConfig ~= { cfg =>
val os = System.getProperty("os.name").toLowerCase
// For some unknown reason, we can't run the test suites in debug mode on MacOS
if (os.contains("mac")) cfg.withMode(Mode.releaseFast)
else cfg.withGC(GC.boehm) // See https://github.com/scala-native/scala-native/issues/4032
},
scalacOptions += {
if (crossProjectPlatform.value == NativePlatform)
"-P:scalanative:genStaticForwardersForNonTopLevelObjects"
else ""
},
Test / fork := crossProjectPlatform.value == JVMPlatform // set fork to `true` on JVM to improve log readability, JS and Native need `false`
)

def buildInfoSettings(packageName: String) = Seq(
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.3")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.5")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.6")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.4.0-alpha.22")

Expand Down
Loading