From 0aeee30ba511339403963e67f48c97d7e62b0f12 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 8 Mar 2023 16:50:28 +0000 Subject: [PATCH 01/11] Set native link concurrent restriction --- build.sbt | 2 ++ project/plugins.sbt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 1b214881f..26818165b 100644 --- a/build.sbt +++ b/build.sbt @@ -10,6 +10,8 @@ ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11")) ThisBuild / githubWorkflowBuildMatrixExclusions += // TODO MatrixExclude(Map("scala" -> scala3, "project" -> "rootJVM")) +Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1) + val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.1" Global / onChangedBuildSource := ReloadOnSourceChanges diff --git a/project/plugins.sbt b/project/plugins.sbt index a379598d9..22e1cba03 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.9") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.10") From a4f6954bf14bd6f7c1de15617e094cea1c48bda2 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 8 Mar 2023 18:42:45 +0000 Subject: [PATCH 02/11] override `loadedTestFrameworks` --- build.sbt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 26818165b..499b43717 100644 --- a/build.sbt +++ b/build.sbt @@ -157,7 +157,8 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) }.taskValue, libraryDependencies ++= Seq( "io.github.cquiroz" %%% "scala-java-locales" % scalajavaLocalesVersion - ) + ), + Test / loadedTestFrameworks := Map.empty // workaround ) lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) @@ -178,12 +179,13 @@ lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) }.taskValue ) .nativeSettings( - tzdbPlatform := TzdbPlugin.Platform.Native, + tzdbPlatform := TzdbPlugin.Platform.Native, Compile / sourceGenerators += Def.task { val srcDirs = (Compile / sourceManaged).value val destinationDir = (Compile / sourceManaged).value copyAndReplace(Seq(srcDirs), destinationDir) - }.taskValue + }.taskValue, + Test / loadedTestFrameworks := Map.empty // workaround ) .jvmSettings( tzdbPlatform := TzdbPlugin.Platform.Jvm @@ -252,5 +254,6 @@ lazy val demo = crossProject(JSPlatform, JVMPlatform, NativePlatform) tzdbPlatform := TzdbPlugin.Platform.Jvm ) .nativeSettings( - tzdbPlatform := TzdbPlugin.Platform.Native + tzdbPlatform := TzdbPlugin.Platform.Native, + Test / loadedTestFrameworks := Map.empty // workaround ) From 5a33f53114713ffe4d6b8cfa2a7bcc15b6a0ddcf Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 8 Mar 2023 18:42:48 +0000 Subject: [PATCH 03/11] Revert "Set native link concurrent restriction" This reverts commit 0aeee30ba511339403963e67f48c97d7e62b0f12. --- build.sbt | 2 -- project/plugins.sbt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 499b43717..ce80b49e3 100644 --- a/build.sbt +++ b/build.sbt @@ -10,8 +10,6 @@ ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11")) ThisBuild / githubWorkflowBuildMatrixExclusions += // TODO MatrixExclude(Map("scala" -> scala3, "project" -> "rootJVM")) -Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1) - val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.1" Global / onChangedBuildSource := ReloadOnSourceChanges diff --git a/project/plugins.sbt b/project/plugins.sbt index 22e1cba03..a379598d9 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.10") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.9") From dae79bf60454a8f30016c7649a2cbad216e6b077 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Wed, 8 Mar 2023 18:50:33 +0000 Subject: [PATCH 04/11] Revert "Revert "Set native link concurrent restriction"" This reverts commit 5a33f53114713ffe4d6b8cfa2a7bcc15b6a0ddcf. --- build.sbt | 2 ++ project/plugins.sbt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index ce80b49e3..499b43717 100644 --- a/build.sbt +++ b/build.sbt @@ -10,6 +10,8 @@ ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11")) ThisBuild / githubWorkflowBuildMatrixExclusions += // TODO MatrixExclude(Map("scala" -> scala3, "project" -> "rootJVM")) +Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1) + val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.1" Global / onChangedBuildSource := ReloadOnSourceChanges diff --git a/project/plugins.sbt b/project/plugins.sbt index a379598d9..22e1cba03 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.9") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.10") From 4999aedb44e1833a1f1254735666aca18fc0fd8d Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Mar 2023 16:05:48 +0000 Subject: [PATCH 05/11] Bump Scala Native, less mem for JVM --- .jvmopts | 2 +- build.sbt | 6 ++---- project/plugins.sbt | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.jvmopts b/.jvmopts index e24c9fe86..af2c8113c 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xmx4g +-Xmx2g -Xss4m -XX:MaxMetaspaceSize=1g -XX:ReservedCodeCacheSize=512m diff --git a/build.sbt b/build.sbt index 499b43717..d96cc7930 100644 --- a/build.sbt +++ b/build.sbt @@ -157,8 +157,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) }.taskValue, libraryDependencies ++= Seq( "io.github.cquiroz" %%% "scala-java-locales" % scalajavaLocalesVersion - ), - Test / loadedTestFrameworks := Map.empty // workaround + ) ) lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) @@ -254,6 +253,5 @@ lazy val demo = crossProject(JSPlatform, JVMPlatform, NativePlatform) tzdbPlatform := TzdbPlugin.Platform.Jvm ) .nativeSettings( - tzdbPlatform := TzdbPlugin.Platform.Native, - Test / loadedTestFrameworks := Map.empty // workaround + tzdbPlatform := TzdbPlugin.Platform.Native ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 22e1cba03..0e1ddfd53 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.10") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.11") From 740d895676a208bfb9151fe4a5bc46ecf29a3ab2 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Mar 2023 16:07:31 +0000 Subject: [PATCH 06/11] Actually keep the workarounds --- build.sbt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index d96cc7930..499b43717 100644 --- a/build.sbt +++ b/build.sbt @@ -157,7 +157,8 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) }.taskValue, libraryDependencies ++= Seq( "io.github.cquiroz" %%% "scala-java-locales" % scalajavaLocalesVersion - ) + ), + Test / loadedTestFrameworks := Map.empty // workaround ) lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) @@ -253,5 +254,6 @@ lazy val demo = crossProject(JSPlatform, JVMPlatform, NativePlatform) tzdbPlatform := TzdbPlugin.Platform.Jvm ) .nativeSettings( - tzdbPlatform := TzdbPlugin.Platform.Native + tzdbPlatform := TzdbPlugin.Platform.Native, + Test / loadedTestFrameworks := Map.empty // workaround ) From 4bff7b5512ae3ed888cc220c00dc03628b5de6fe Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Mar 2023 16:24:28 +0000 Subject: [PATCH 07/11] 3g mem --- .jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jvmopts b/.jvmopts index af2c8113c..3b064ed1f 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xmx2g +-Xmx3g -Xss4m -XX:MaxMetaspaceSize=1g -XX:ReservedCodeCacheSize=512m From 4a284204d98725d9e7980f737ed3811f12bf1f0f Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Mar 2023 16:44:36 +0000 Subject: [PATCH 08/11] Back to 4G --- .jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jvmopts b/.jvmopts index 3b064ed1f..e24c9fe86 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xmx3g +-Xmx4g -Xss4m -XX:MaxMetaspaceSize=1g -XX:ReservedCodeCacheSize=512m From b80f675644e9504bc07356d6ed379ea834f248c8 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Mar 2023 16:59:14 +0000 Subject: [PATCH 09/11] Run Scala 3 / Native on macOS --- .github/workflows/ci.yml | 17 +++++++---------- build.sbt | 11 ++++++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f22d0c0e..5ad537429 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,9 +31,16 @@ jobs: scala: [2.12.17, 2.13.10, 3.2.1] java: [temurin@11] project: [rootJS, rootJVM, rootNative] + include: + - scala: 3.2.1 + project: rootNative + os: macos-latest exclude: - scala: 3.2.1 project: rootJVM + - scala: 3.2.1 + project: rootNative + os: ubuntu-latest runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -224,16 +231,6 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (3.2.1, rootNative) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootNative - - - name: Inflate target directories (3.2.1, rootNative) - run: | - tar xf targets.tar - rm targets.tar - - name: Import signing key if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' run: echo $PGP_SECRET | base64 -di | gpg --import diff --git a/build.sbt b/build.sbt index 499b43717..4ee81a5f3 100644 --- a/build.sbt +++ b/build.sbt @@ -7,10 +7,15 @@ ThisBuild / tlBaseVersion := "2.5" ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11")) -ThisBuild / githubWorkflowBuildMatrixExclusions += // TODO - MatrixExclude(Map("scala" -> scala3, "project" -> "rootJVM")) +ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( + MatrixExclude(Map("scala" -> scala3, "project" -> "rootJVM")), // TODO + MatrixExclude( + Map("scala" -> scala3, "project" -> "rootNative", "os" -> "ubuntu-latest") + ) // run on macOS instead +) -Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1) +ThisBuild / githubWorkflowBuildMatrixInclusions += + MatrixInclude(Map("scala" -> scala3, "project" -> "rootNative"), Map("os" -> "macos-latest")) val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.1" From 2499d27c5bf6612a92963e853b68cb35367a008c Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Mar 2023 17:05:58 +0000 Subject: [PATCH 10/11] Specify Java --- .github/workflows/ci.yml | 1 + build.sbt | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ad537429..f1b59c62f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: project: [rootJS, rootJVM, rootNative] include: - scala: 3.2.1 + java: temurin@11 project: rootNative os: macos-latest exclude: diff --git a/build.sbt b/build.sbt index 4ee81a5f3..72660b337 100644 --- a/build.sbt +++ b/build.sbt @@ -5,7 +5,8 @@ ThisBuild / crossScalaVersions := Seq("2.12.17", scala213, scala3) ThisBuild / tlBaseVersion := "2.5" -ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11")) +val temurin11 = JavaSpec.temurin("11") +ThisBuild / githubWorkflowJavaVersions := Seq(temurin11) ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( MatrixExclude(Map("scala" -> scala3, "project" -> "rootJVM")), // TODO @@ -15,7 +16,9 @@ ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( ) ThisBuild / githubWorkflowBuildMatrixInclusions += - MatrixInclude(Map("scala" -> scala3, "project" -> "rootNative"), Map("os" -> "macos-latest")) + MatrixInclude(Map("scala" -> scala3, "java" -> temurin11.render, "project" -> "rootNative"), + Map("os" -> "macos-latest") + ) val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.1" From 49c945638ceca1ada79084b4bf0ebbb62f53d723 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Fri, 17 Mar 2023 17:09:51 +0000 Subject: [PATCH 11/11] Remove other workarounds --- build.sbt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 72660b337..74fe2a9b7 100644 --- a/build.sbt +++ b/build.sbt @@ -165,8 +165,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) }.taskValue, libraryDependencies ++= Seq( "io.github.cquiroz" %%% "scala-java-locales" % scalajavaLocalesVersion - ), - Test / loadedTestFrameworks := Map.empty // workaround + ) ) lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) @@ -187,13 +186,12 @@ lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) }.taskValue ) .nativeSettings( - tzdbPlatform := TzdbPlugin.Platform.Native, + tzdbPlatform := TzdbPlugin.Platform.Native, Compile / sourceGenerators += Def.task { val srcDirs = (Compile / sourceManaged).value val destinationDir = (Compile / sourceManaged).value copyAndReplace(Seq(srcDirs), destinationDir) - }.taskValue, - Test / loadedTestFrameworks := Map.empty // workaround + }.taskValue ) .jvmSettings( tzdbPlatform := TzdbPlugin.Platform.Jvm @@ -262,6 +260,5 @@ lazy val demo = crossProject(JSPlatform, JVMPlatform, NativePlatform) tzdbPlatform := TzdbPlugin.Platform.Jvm ) .nativeSettings( - tzdbPlatform := TzdbPlugin.Platform.Native, - Test / loadedTestFrameworks := Map.empty // workaround + tzdbPlatform := TzdbPlugin.Platform.Native )