From aa08e7a30429489377a74bba98f09997a843d84e Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 12 Jun 2022 00:24:17 +0000 Subject: [PATCH 1/8] Cross-build for Native --- .github/workflows/ci.yml | 34 +++++++++++++++++-- build.sbt | 26 +++++++------- .../src/main/scala/spire/Platform.scala | 0 project/plugins.sbt | 3 ++ 4 files changed, 47 insertions(+), 16 deletions(-) rename platform/{js => js-native}/src/main/scala/spire/Platform.scala (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49c11eeca..f952d15c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: os: [ubuntu-latest] scala: [2.13.8, 3.1.2] java: [temurin@8, temurin@11, temurin@17] - project: [rootJS, rootJVM] + project: [rootJS, rootJVM, rootNative] exclude: - scala: 2.13.8 java: temurin@11 @@ -40,6 +40,10 @@ jobs: java: temurin@11 - project: rootJS java: temurin@17 + - project: rootNative + java: temurin@11 + - project: rootNative + java: temurin@17 runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -118,6 +122,10 @@ jobs: if: matrix.project == 'rootJS' run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/scalaJSLinkerResult + - name: nativeLink + if: matrix.project == 'rootNative' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/nativeLink + - name: Test run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test @@ -131,11 +139,11 @@ jobs: - name: Make target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: mkdir -p data/.jvm/target legacy/.jvm/target extras/.js/target examples/target target platform/js/target macros/.jvm/target .js/target site/target core/.js/target macros/.js/target laws/.js/target legacy/.js/target core/.jvm/target tests/js/target .jvm/target .native/target platform/jvm/target util/.js/target data/.js/target util/.jvm/target laws/.jvm/target tests/jvm/target extras/.jvm/target benchmark/target project/target + run: mkdir -p data/.jvm/target legacy/.jvm/target extras/.js/target examples/target util/.native/target extras/.native/target target platform/js/target macros/.jvm/target legacy/.native/target .js/target core/.native/target site/target macros/.native/target laws/.native/target core/.js/target macros/.js/target laws/.js/target legacy/.js/target core/.jvm/target tests/js/target .jvm/target .native/target platform/jvm/target util/.js/target platform/native/target data/.js/target util/.jvm/target laws/.jvm/target tests/jvm/target extras/.jvm/target data/.native/target benchmark/target tests/native/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: tar cf targets.tar data/.jvm/target legacy/.jvm/target extras/.js/target examples/target target platform/js/target macros/.jvm/target .js/target site/target core/.js/target macros/.js/target laws/.js/target legacy/.js/target core/.jvm/target tests/js/target .jvm/target .native/target platform/jvm/target util/.js/target data/.js/target util/.jvm/target laws/.jvm/target tests/jvm/target extras/.jvm/target benchmark/target project/target + run: tar cf targets.tar data/.jvm/target legacy/.jvm/target extras/.js/target examples/target util/.native/target extras/.native/target target platform/js/target macros/.jvm/target legacy/.native/target .js/target core/.native/target site/target macros/.native/target laws/.native/target core/.js/target macros/.js/target laws/.js/target legacy/.js/target core/.jvm/target tests/js/target .jvm/target .native/target platform/jvm/target util/.js/target platform/native/target data/.js/target util/.jvm/target laws/.jvm/target tests/jvm/target extras/.jvm/target data/.native/target benchmark/target tests/native/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') @@ -240,6 +248,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (2.13.8, rootNative) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-rootNative + + - name: Inflate target directories (2.13.8, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Download target directories (3.1.2, rootJS) uses: actions/download-artifact@v2 with: @@ -260,6 +278,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (3.1.2, rootNative) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.2-rootNative + + - name: Inflate target directories (3.1.2, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Download target directories (3.1.2, rootJVM) uses: actions/download-artifact@v2 with: diff --git a/build.sbt b/build.sbt index ec53efe62..08d215298 100644 --- a/build.sbt +++ b/build.sbt @@ -16,10 +16,10 @@ import scala.language.existentials lazy val scalaCheckVersion = "1.16.0" -lazy val munit = "0.7.29" -lazy val munitDiscipline = "1.0.9" +lazy val munit = "1.0.0-M5" +lazy val munitDiscipline = "2.0.0-M2" -lazy val algebraVersion = "2.7.0" +lazy val algebraVersion = "2.8-e070e7e-SNAPSHOT" lazy val apfloatVersion = "1.10.1" lazy val jscienceVersion = "4.3.1" @@ -62,14 +62,14 @@ lazy val root = tlCrossRootProject .settings(unidocSettings) .enablePlugins(ScalaUnidocPlugin) -lazy val platform = crossProject(JSPlatform, JVMPlatform) +lazy val platform = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(moduleName := "spire-platform") .settings(spireSettings: _*) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) .dependsOn(macros, util) -lazy val macros = crossProject(JSPlatform, JVMPlatform) +lazy val macros = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Pure) .settings(moduleName := "spire-macros") .settings(spireSettings: _*) @@ -78,21 +78,21 @@ lazy val macros = crossProject(JSPlatform, JVMPlatform) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) -lazy val data = crossProject(JSPlatform, JVMPlatform) +lazy val data = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Pure) .settings(moduleName := "spire-data") .settings(spireSettings: _*) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) -lazy val legacy = crossProject(JSPlatform, JVMPlatform) +lazy val legacy = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Pure) .settings(moduleName := "spire-legacy") .settings(spireSettings: _*) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) -lazy val util = crossProject(JSPlatform, JVMPlatform) +lazy val util = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Pure) .settings(moduleName := "spire-util") .settings(spireSettings: _*) @@ -100,7 +100,7 @@ lazy val util = crossProject(JSPlatform, JVMPlatform) .jsSettings(commonJsSettings: _*) .dependsOn(macros) -lazy val core = crossProject(JSPlatform, JVMPlatform) +lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Pure) .settings(moduleName := "spire") .settings(spireSettings: _*) @@ -109,7 +109,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform) .jsSettings(commonJsSettings: _*) .dependsOn(macros, platform, util) -lazy val extras = crossProject(JSPlatform, JVMPlatform) +lazy val extras = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Pure) .settings(moduleName := "spire-extras") .settings(spireSettings: _*) @@ -140,7 +140,7 @@ lazy val examples = project .settings(commonJvmSettings) .dependsOn(core.jvm, extras.jvm) -lazy val laws = crossProject(JSPlatform, JVMPlatform) +lazy val laws = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Pure) .settings(moduleName := "spire-laws") .settings(spireSettings: _*) @@ -154,7 +154,7 @@ lazy val laws = crossProject(JSPlatform, JVMPlatform) .jsSettings(commonJsSettings: _*) .dependsOn(core, extras) -lazy val tests = crossProject(JSPlatform, JVMPlatform) +lazy val tests = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Full) .settings(moduleName := "spire-tests") .settings(spireSettings: _*) @@ -196,7 +196,7 @@ lazy val commonDeps = Seq( ) lazy val commonSettings = Seq( - resolvers += Resolver.sonatypeRepo("snapshots"), + resolvers += "s01".at("https://s01.oss.sonatype.org/content/repositories/snapshots/"), headerLicense := Some(HeaderLicense.Custom(header)) ) ++ scalaMacroDependencies diff --git a/platform/js/src/main/scala/spire/Platform.scala b/platform/js-native/src/main/scala/spire/Platform.scala similarity index 100% rename from platform/js/src/main/scala/spire/Platform.scala rename to platform/js-native/src/main/scala/spire/Platform.scala diff --git a/project/plugins.sbt b/project/plugins.sbt index fe5134aba..ff957c1ec 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,6 +4,9 @@ val sbtTypelevelVersion = "0.4.12" addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion) addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.4") + addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3") From cd60d37fd7af79dfa0fe743c71424fcef02344f1 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 12 Jun 2022 01:35:18 +0000 Subject: [PATCH 2/8] First attempt Native workaround, broken --- .../src/main/scala/spire/math/poly/Term.scala | 15 +++++++---- .../js/src/main/scala/spire/Platform.scala | 27 +++++++++++++++++++ .../jvm/src/main/scala/spire/Platform.scala | 2 ++ .../src/main/scala/spire/Platform.scala | 2 ++ 4 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 platform/js/src/main/scala/spire/Platform.scala rename platform/{js-native => native}/src/main/scala/spire/Platform.scala (97%) diff --git a/core/src/main/scala/spire/math/poly/Term.scala b/core/src/main/scala/spire/math/poly/Term.scala index 35926fa4a..535a2301e 100644 --- a/core/src/main/scala/spire/math/poly/Term.scala +++ b/core/src/main/scala/spire/math/poly/Term.scala @@ -118,14 +118,19 @@ object Term { // call Regex constructor directly to get rid of compiler warning // replace with "".r once SI-6723 is fixed private val superscriptRegex = - new scala.util.matching.Regex( - "[\\u2070\\u2071\\u2072\\u2073\\u2074\\u2075\\u2076\\u2077\\u2078\\u2079\\u207B\\u00B9\\u00B2\\u00B3]+" - ) + if (Platform.isNative) null + else + new scala.util.matching.Regex( + "[\\u2070\\u2071\\u2072\\u2073\\u2074\\u2075\\u2076\\u2077\\u2078\\u2079\\u207B\\u00B9\\u00B2\\u00B3]+" + ) private[spire] def removeSuperscript(text: String): String = - superscriptRegex.replaceAllIn(text, "^" + _.group(0).map(removeSuperscript)) + if (Platform.isNative) + text.flatMap(c => removeSuperscript.get(c).fold(c.toString)("^" + _)) + else + superscriptRegex.replaceAllIn(text, "^" + _.group(0).map(removeSuperscript)) private val superscript: (Char => Char) = Map(digitToSuperscript.toIndexedSeq: _*) - private val removeSuperscript: (Char => Char) = Map(digitToSuperscript.map(_.swap).toIndexedSeq: _*) + private val removeSuperscript = Map(digitToSuperscript.map(_.swap).toIndexedSeq: _*) } diff --git a/platform/js/src/main/scala/spire/Platform.scala b/platform/js/src/main/scala/spire/Platform.scala new file mode 100644 index 000000000..102188305 --- /dev/null +++ b/platform/js/src/main/scala/spire/Platform.scala @@ -0,0 +1,27 @@ +/* + * **********************************************************************\ + * * Project ** + * * ______ ______ __ ______ ____ ** + * * / ____/ / __ / / / / __ / / __/ (c) 2011-2021 ** + * * / /__ / /_/ / / / / /_/ / / /_ ** + * * /___ / / ____/ / / / __ / / __/ Erik Osheim, Tom Switzer ** + * * ____/ / / / / / / / | | / /__ ** + * * /_____/ /_/ /_/ /_/ |_| /____/ All rights reserved. ** + * * ** + * * Redistribution and use permitted under the MIT license. ** + * * ** + * \*********************************************************************** + */ + +package spire + +import scala.collection._ + +object Platform { + final val isNative = false + + type TrieMap[K, V] = mutable.Map[K, V] + + @inline + def TrieMap[K, V](): TrieMap[K, V] = mutable.Map() +} diff --git a/platform/jvm/src/main/scala/spire/Platform.scala b/platform/jvm/src/main/scala/spire/Platform.scala index 968e59869..2e55cc600 100644 --- a/platform/jvm/src/main/scala/spire/Platform.scala +++ b/platform/jvm/src/main/scala/spire/Platform.scala @@ -18,6 +18,8 @@ package spire import scala.collection._ object Platform { + final val isNative = false + type TrieMap[K, V] = concurrent.TrieMap[K, V] @inline diff --git a/platform/js-native/src/main/scala/spire/Platform.scala b/platform/native/src/main/scala/spire/Platform.scala similarity index 97% rename from platform/js-native/src/main/scala/spire/Platform.scala rename to platform/native/src/main/scala/spire/Platform.scala index 1f8b511bd..410198c4a 100644 --- a/platform/js-native/src/main/scala/spire/Platform.scala +++ b/platform/native/src/main/scala/spire/Platform.scala @@ -18,6 +18,8 @@ package spire import scala.collection._ object Platform { + final val isNative = true + type TrieMap[K, V] = mutable.Map[K, V] @inline From de492a22401022ca23fb4924325c949e6be6d7ca Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 12 Jun 2022 02:46:21 +0000 Subject: [PATCH 3/8] Proper workaround for removeSuperscript on Native --- .../src/main/scala/spire/math/poly/Term.scala | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/core/src/main/scala/spire/math/poly/Term.scala b/core/src/main/scala/spire/math/poly/Term.scala index 535a2301e..57290848f 100644 --- a/core/src/main/scala/spire/math/poly/Term.scala +++ b/core/src/main/scala/spire/math/poly/Term.scala @@ -125,9 +125,26 @@ object Term { ) private[spire] def removeSuperscript(text: String): String = - if (Platform.isNative) - text.flatMap(c => removeSuperscript.get(c).fold(c.toString)("^" + _)) - else + if (Platform.isNative) { + var i = 0 + val n = text.length + var sup = false + val sb = new scala.collection.mutable.StringBuilder(text.length + text.length / 2) + while (i < n) { + val c = text(i) + removeSuperscript + .get(c) + .fold { + sup = false + sb += c + } { d => + if (!sup) sb += '^' + sup = true + sb += d + } + } + if (sb.length() != n) sb.result() else text + } else superscriptRegex.replaceAllIn(text, "^" + _.group(0).map(removeSuperscript)) private val superscript: (Char => Char) = Map(digitToSuperscript.toIndexedSeq: _*) From a7bd8b8c945816ad4b2f9ddec66a20d1584a1f11 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 12 Jun 2022 02:53:10 +0000 Subject: [PATCH 4/8] woooooops :) --- core/src/main/scala/spire/math/poly/Term.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/scala/spire/math/poly/Term.scala b/core/src/main/scala/spire/math/poly/Term.scala index 57290848f..73bd29b22 100644 --- a/core/src/main/scala/spire/math/poly/Term.scala +++ b/core/src/main/scala/spire/math/poly/Term.scala @@ -142,6 +142,7 @@ object Term { sup = true sb += d } + i += 1 } if (sb.length() != n) sb.result() else text } else From 960c6b2aa5196fb2c6dfeef600f7d0b47ff33967 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 12 Jun 2022 03:07:12 +0000 Subject: [PATCH 5/8] Revert workaround --- .../src/main/scala/spire/math/poly/Term.scala | 33 +++---------------- .../src/main/scala/spire/Platform.scala | 2 -- .../js/src/main/scala/spire/Platform.scala | 27 --------------- .../jvm/src/main/scala/spire/Platform.scala | 2 -- 4 files changed, 5 insertions(+), 59 deletions(-) rename platform/{native => js-native}/src/main/scala/spire/Platform.scala (97%) delete mode 100644 platform/js/src/main/scala/spire/Platform.scala diff --git a/core/src/main/scala/spire/math/poly/Term.scala b/core/src/main/scala/spire/math/poly/Term.scala index 73bd29b22..35926fa4a 100644 --- a/core/src/main/scala/spire/math/poly/Term.scala +++ b/core/src/main/scala/spire/math/poly/Term.scala @@ -118,37 +118,14 @@ object Term { // call Regex constructor directly to get rid of compiler warning // replace with "".r once SI-6723 is fixed private val superscriptRegex = - if (Platform.isNative) null - else - new scala.util.matching.Regex( - "[\\u2070\\u2071\\u2072\\u2073\\u2074\\u2075\\u2076\\u2077\\u2078\\u2079\\u207B\\u00B9\\u00B2\\u00B3]+" - ) + new scala.util.matching.Regex( + "[\\u2070\\u2071\\u2072\\u2073\\u2074\\u2075\\u2076\\u2077\\u2078\\u2079\\u207B\\u00B9\\u00B2\\u00B3]+" + ) private[spire] def removeSuperscript(text: String): String = - if (Platform.isNative) { - var i = 0 - val n = text.length - var sup = false - val sb = new scala.collection.mutable.StringBuilder(text.length + text.length / 2) - while (i < n) { - val c = text(i) - removeSuperscript - .get(c) - .fold { - sup = false - sb += c - } { d => - if (!sup) sb += '^' - sup = true - sb += d - } - i += 1 - } - if (sb.length() != n) sb.result() else text - } else - superscriptRegex.replaceAllIn(text, "^" + _.group(0).map(removeSuperscript)) + superscriptRegex.replaceAllIn(text, "^" + _.group(0).map(removeSuperscript)) private val superscript: (Char => Char) = Map(digitToSuperscript.toIndexedSeq: _*) - private val removeSuperscript = Map(digitToSuperscript.map(_.swap).toIndexedSeq: _*) + private val removeSuperscript: (Char => Char) = Map(digitToSuperscript.map(_.swap).toIndexedSeq: _*) } diff --git a/platform/native/src/main/scala/spire/Platform.scala b/platform/js-native/src/main/scala/spire/Platform.scala similarity index 97% rename from platform/native/src/main/scala/spire/Platform.scala rename to platform/js-native/src/main/scala/spire/Platform.scala index 410198c4a..1f8b511bd 100644 --- a/platform/native/src/main/scala/spire/Platform.scala +++ b/platform/js-native/src/main/scala/spire/Platform.scala @@ -18,8 +18,6 @@ package spire import scala.collection._ object Platform { - final val isNative = true - type TrieMap[K, V] = mutable.Map[K, V] @inline diff --git a/platform/js/src/main/scala/spire/Platform.scala b/platform/js/src/main/scala/spire/Platform.scala deleted file mode 100644 index 102188305..000000000 --- a/platform/js/src/main/scala/spire/Platform.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * **********************************************************************\ - * * Project ** - * * ______ ______ __ ______ ____ ** - * * / ____/ / __ / / / / __ / / __/ (c) 2011-2021 ** - * * / /__ / /_/ / / / / /_/ / / /_ ** - * * /___ / / ____/ / / / __ / / __/ Erik Osheim, Tom Switzer ** - * * ____/ / / / / / / / | | / /__ ** - * * /_____/ /_/ /_/ /_/ |_| /____/ All rights reserved. ** - * * ** - * * Redistribution and use permitted under the MIT license. ** - * * ** - * \*********************************************************************** - */ - -package spire - -import scala.collection._ - -object Platform { - final val isNative = false - - type TrieMap[K, V] = mutable.Map[K, V] - - @inline - def TrieMap[K, V](): TrieMap[K, V] = mutable.Map() -} diff --git a/platform/jvm/src/main/scala/spire/Platform.scala b/platform/jvm/src/main/scala/spire/Platform.scala index 2e55cc600..968e59869 100644 --- a/platform/jvm/src/main/scala/spire/Platform.scala +++ b/platform/jvm/src/main/scala/spire/Platform.scala @@ -18,8 +18,6 @@ package spire import scala.collection._ object Platform { - final val isNative = false - type TrieMap[K, V] = concurrent.TrieMap[K, V] @inline From 124068304680ee44e3fef2cf41ebfb82b0241fd3 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 12 Jun 2022 03:16:06 +0000 Subject: [PATCH 6/8] Modernize the regex instead --- core/src/main/scala/spire/math/poly/Term.scala | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/main/scala/spire/math/poly/Term.scala b/core/src/main/scala/spire/math/poly/Term.scala index 35926fa4a..476045cc8 100644 --- a/core/src/main/scala/spire/math/poly/Term.scala +++ b/core/src/main/scala/spire/math/poly/Term.scala @@ -117,10 +117,7 @@ object Term { // call Regex constructor directly to get rid of compiler warning // replace with "".r once SI-6723 is fixed - private val superscriptRegex = - new scala.util.matching.Regex( - "[\\u2070\\u2071\\u2072\\u2073\\u2074\\u2075\\u2076\\u2077\\u2078\\u2079\\u207B\\u00B9\\u00B2\\u00B3]+" - ) + private val superscriptRegex = "[⁰¹²³⁴⁵⁶⁷⁸⁹⁻ⁱ]+".r private[spire] def removeSuperscript(text: String): String = superscriptRegex.replaceAllIn(text, "^" + _.group(0).map(removeSuperscript)) From b7d1c7608e08720a5d9ebc17d72fa245c1a44e67 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Sun, 12 Jun 2022 06:13:06 +0000 Subject: [PATCH 7/8] Try disabling trouble prop --- .../scala/spire/math/SafeLongScalaCheckSuite.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/shared/src/test/scala/spire/math/SafeLongScalaCheckSuite.scala b/tests/shared/src/test/scala/spire/math/SafeLongScalaCheckSuite.scala index 89eca5970..fd5b9060a 100644 --- a/tests/shared/src/test/scala/spire/math/SafeLongScalaCheckSuite.scala +++ b/tests/shared/src/test/scala/spire/math/SafeLongScalaCheckSuite.scala @@ -155,12 +155,13 @@ class SafeLongScalaCheckSuite extends munit.ScalaCheckSuite { } } - property("x >> k") { - forAll { (x: BigInt, k: Byte) => - intercept[RuntimeException] { SafeLong(x) >> Int.MinValue } - invariant(SafeLong(x) >> k) == SafeLong(x >> k) + if (!sys.props.get("java.vm.name").contains("Scala Native")) + property("x >> k") { + forAll { (x: BigInt, k: Byte) => + intercept[RuntimeException] { SafeLong(x) >> Int.MinValue } + invariant(SafeLong(x) >> k) == SafeLong(x >> k) + } } - } property("long safelongs") { forAll { (x: Long) => From 511585a6d31a37355eb5c50e202c0713505ebc44 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Thu, 16 Jun 2022 21:36:40 +0000 Subject: [PATCH 8/8] Bump to algebra 2.8.0 final --- build.sbt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 08d215298..efa43ce9e 100644 --- a/build.sbt +++ b/build.sbt @@ -19,7 +19,7 @@ lazy val scalaCheckVersion = "1.16.0" lazy val munit = "1.0.0-M5" lazy val munitDiscipline = "2.0.0-M2" -lazy val algebraVersion = "2.8-e070e7e-SNAPSHOT" +lazy val algebraVersion = "2.8.0" lazy val apfloatVersion = "1.10.1" lazy val jscienceVersion = "4.3.1" @@ -196,7 +196,6 @@ lazy val commonDeps = Seq( ) lazy val commonSettings = Seq( - resolvers += "s01".at("https://s01.oss.sonatype.org/content/repositories/snapshots/"), headerLicense := Some(HeaderLicense.Custom(header)) ) ++ scalaMacroDependencies