Skip to content

0.5.2 does not work with Scala 2.13.13 or lower versions due to SIP-51 #3943

@xuwei-k

Description

@xuwei-k

build.sbt

scalaVersion := "2.13.13"

enablePlugins(ScalaNativePlugin)

project/build.properties

sbt.version = 1.10.0

project/plugins.sbt

addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.2")

src/main/scala/Main.scala

object Main {
  def main(args: Array[String]): Unit =
    println("Hello, world!")
}

sbt run

[error] java.lang.RuntimeException: expected `scala-native-example/scalaVersion` to be "2.13.14" or later,
[error] but found "2.13.13"; upgrade scalaVersion to fix the build.
[error] 
[error] to support backwards-only binary compatibility (SIP-51),
[error] the Scala 2.13 compiler cannot be older than scala-library on the
[error] dependency classpath.
[error] see `scala-native-example/evicted` to know why scala-library 2.13.14 is getting pulled in.
[error] 
[error] 	at scala.sys.package$.error(package.scala:30)
[error] 	at sbt.Defaults$.$anonfun$scalaInstanceFromUpdate$14(Defaults.scala:1195)
[error] 	at sbt.Defaults$.$anonfun$scalaInstanceFromUpdate$14$adapted(Defaults.scala:1184)
[error] 	at scala.Option.foreach(Option.scala:407)
[error] 	at sbt.Defaults$.$anonfun$scalaInstanceFromUpdate$12(Defaults.scala:1184)
[error] 	at sbt.Defaults$.$anonfun$scalaInstanceFromUpdate$12$adapted(Defaults.scala:1182)
[error] 	at scala.collection.Iterator.foreach(Iterator.scala:943)
[error] 	at scala.collection.Iterator.foreach$(Iterator.scala:943)
[error] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
[error] 	at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error] 	at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error] 	at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error] 	at sbt.Defaults$.$anonfun$scalaInstanceFromUpdate$11(Defaults.scala:1182)
[error] 	at sbt.Defaults$.$anonfun$scalaInstanceFromUpdate$11$adapted(Defaults.scala:1181)
[error] 	at scala.Option.foreach(Option.scala:407)
[error] 	at sbt.Defaults$.$anonfun$scalaInstanceFromUpdate$1(Defaults.scala:1181)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error] 	at sbt.Execute.work(Execute.scala:292)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] 	at java.base/java.lang.Thread.run(Thread.java:840)
[error] (scalaInstance) expected `scala-native-example/scalaVersion` to be "2.13.14" or later,
[error] but found "2.13.13"; upgrade scalaVersion to fix the build.
[error] 
[error] to support backwards-only binary compatibility (SIP-51),
[error] the Scala 2.13 compiler cannot be older than scala-library on the
[error] dependency classpath.
[error] see `scala-native-example/evicted` to know why scala-library 2.13.14 is getting pulled in.
[error] Total time: 0 s, completed Jun 4, 2024, 3:38:12 AM

note

https://docs.scala-lang.org/sips/drop-stdlib-forwards-bin-compat.html

| 2.13 | 2.13.8 ... 2.13.14 |

nativelib_native0.5_2.13 depends on scala-library 2.13.14

https://repo1.maven.org/maven2/org/scala-native/nativelib_native0.5_2.13/0.5.2/nativelib_native0.5_2.13-0.5.2.pom

<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.13.14</version>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions