0.4.4 (2022-03-02)¶
We’re happy to announce the new patch release of Scala Native v0.4.4, which brings improved support for Arm64, introduces experimental embeding of resources and adds dedicated ScalaNativeJUnitPlugin for easier setup of tests. Also in this release we’have fixed all the issues found in the recent support for Scala 3, including Selectables, cross version with Scala 2.13 dependencies and many more.
Commits since last release | 29 |
Merged PRs | 27 |
Contributors | 6 |
Top changes¶
Experimental support for embedding resources¶
Thanks to the effort of @jchyb you can embed resources of your project and use them at runtime using Class[_].getResourceAsInputStream()
in the same way as on the JVM. If you use some native sources in your project, e.g. written in C, you don’t need to worry about increased size of binary - all files in resources/scala-native
directory would be ignored.
To enable experimental support of this feature enable it in Native Config:
nativeConfig ~= { _.withEmbedResources(true) }
More information about this new feature can be found here
New sbt plugin - ScalaNativeJUnitPlugin¶
In this release we have added a new sbt plugin dedicated for easier setup of JUnit tests framework. ScalaNativeJUnitPlugin
is a port of similar feature from Scala.js - it allows you to forget about specifying dedicated library dependencies for tests runtime. It does also ensure that JUnit plugin would no longer be included in dependencies of downstream libraries.
When migrating to newer version of Scala Native you enable both Scala Native support and setup JUnit runtime with the current version using only one setting in your project enablePlugins(ScalaNativeJUnitPlugin)
. If building with a cross project you can use the following syntax to add it to the cross project: .nativeConfigure(_.enablePlugins(ScalaNativeJUnitPlugin))
. Remember to remove the old settings needed for JUnit support:
addCompilerPlugin("org.scala-native" % "junit-plugin" % nativeVersion cross CrossVersion.full)
libraryDependencies += "org.scala-native" %%% "junit-runtime" % nativeVersion % Test
Improved Arm64 support¶
Last but not least we have improved our support for Arm64 architecture. This means that you can now use Scala Native on Apple M1 chips and Linux based arm64 devices.
Contributors¶
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v0.4.3..v0.4.4
19 Wojciech Mazur
4 Jan Chyb
3 Eric K Richardson
1 Arman Bilge
1 Shadaj Laddad
1 algobardo
Merged PRs¶
v0.4.4 (2022-03-02)¶
Merged pull requests:
New features¶
Add getResourceAsStream() via embedding resources #2475 (jchyb)
Add
ScalaNativeJUnitPlugin
for easy setup of JUnit tests #2556 (WojciechMazur)Port
java.util.BitSet
#2565 (armanbilge)
Bug fixes¶
Fix UnixPath.relativize when containing .. #2542 (algobardo)
Fix #2547: java.util.TimeZone stub is used instead of scala-java-time #2548 (ekrich)
Fix failing to link
CFuncPtr
created from adapted function #2551 (WojciechMazur)Add support for
scala.reflect.Selectable
#2549 (WojciechMazur)Fix incorrect self type of closures #2554 (WojciechMazur)
Fix conflicting cross version suffixes when using
Cross.for3Use_2.13
#2553 (WojciechMazur)Fix failing to link usages of
.asInstanceOf[Nothing]
#2555 (WojciechMazur)Fix issues with “Is a directory” error in ResourceEmbedder #2568 (jchyb)
Fix runtime errors when cross-compiling to Arm64 #2573 (WojciechMazur)
Fix deprecated constructor
String(Array[Byte], Int, Int, Int)
#2576 (WojciechMazur)Fix NullPointerException when assigning null to non-Ptr types #2575 (WojciechMazur)
Fix negation of floating point numbers #2577 (WojciechMazur)
Add missing contructors for throwables and improve JVM compliance #2578 (WojciechMazur)
Fix runtime problems on MacOS using M1 chips #2579 (WojciechMazur)