0.5.7 (2025-02-26)¶
We’re happy to announce the release of Scala Native 0.5.7.
Breaking changes¶
Scala Native 0.5.7 is backward compatible with all previous Scala Native 0.5 versions, but it is not forward binary compatible with 0.5.6. Users of libraries published using Scala Native 0.5.7 are required to update to Scala Native 0.5.7 or higher
Highlights of the release¶
Scala Native runtime no longer requires C++ standard library (on Unix systems) by default.
@scala.scalanative.unsafe.linkCppRuntime
annotation can be used on extern methods bindings to require linking with C++ standard library if these are used. Scala Native would still use C++ runtime on Windows or if the LTO is enabled, due to not yet resolved issues. Adding-fno-cxx-exceptions
or-fcxx-exceptions
settings toNativeConfig.compileOptions
allows to explicitlly control if Scala Native should use it’s own exception handling implementation or to continue using C++ exception wrappers.StackOverflowError can now be detected and handled instead of terminating program
SCALANATIVE_THREAD_STACK_SIZE
environment variable can now be used to control default platform Thread size at runtime (-Xss on the JVM)Optimized layout of Class virtual tables to reduce size of binaries
Implemented many Java standard library methods introduced in JDK 9 and later
Supported Scala versions¶
Scala Binary Version | Supported Scala Versions |
---|---|
2.12 | 2.12.14 ... 2.12.20 |
2.13 | 2.13.8 ... 2.13.16 |
3 | 3.1.2 ... 3.1.3 3.2.0 ... 3.2.2 3.3.0 ... 3.3.5 3.4.0 ... 3.4.3 3.5.0 ... 3.5.2 3.6.2 ... 3.6.3 |
Upon release of new Scala version (stable, or Scala 3 RC) version dependent artifacts would be published without a new release.
Commits since last release | 90 |
Merged PRs | 85 |
Contributors | 10 |
Contributors¶
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v0.5.6..0.5.7
41 Wojciech Mazur
29 LeeTibbert
11 Lorenzo Gabriele
3 Eric K Richardson
1 Anton Sviridov
1 Arman Bilge
1 Dimi Racordon
1 Jiahui (Jerry) Tan
1 dependabot[bot]
1 faveoled
Merged PRs¶
0.5.7 (2025-02-26)¶
Merged pull requests:
Scala Native compiler plugin¶
Fix generation of closure with type lambda parameters. #4083 (WojciechMazur)
fix: Narrow type used in unwinding from
j.l.Object
toj.l.Throwable
#4089 (WojciechMazur)Fix value class boxing inside lambdas based on failing Scala 2.13.16 partests #4183 (WojciechMazur)
Add Scala 2.13.16 to the build #4165 (WojciechMazur)
Add Scala 3.6.2 to the build #4102 (WojciechMazur)
Fix scalalib compilation for 3.3.5-RC #4177 (WojciechMazur)
Fix LazyVals overrides for Scala 3.3.{0,3} #4178 (WojciechMazur)
Add Scala 3.3.5 to the build cross versions #4184 (WojciechMazur)
Scala Native runtime¶
Replace single TraitDispatchTable with class specific itables to reduce size of binaries #4085 (WojciechMazur)
Fix not inititalizied Posix thread state of Main thread #4112 (WojciechMazur)
Try to fix exceptions during main thread initialization #4188 (WojciechMazur)
Implement minimal C++-like runtime to support exceptions without linking libc++ #4122 (lolgab)
Fallback to C++ exceptions when using LTO or explicitly enabled #4201 (WojciechMazur)
Try optimize collection of stacktraces #4115 (WojciechMazur)
Detect and handle StackOverflowErrors #4153 (WojciechMazur)
Improve Class.toString for primitives. #4187 (WojciechMazur)
Scala Native toolchain¶
Show both original defns and transformed instructions after lowering phase failure #4086 (WojciechMazur)
Cache and reuse unwind handlers for the same nir.Next input #4088 (WojciechMazur)
Enhance build error handling for a build module named native #4092 (ekrich)
Support PIE (Position Independent Executables) #4111 (lolgab)
Generate GC yield instructions when looping on the same block #4119 (WojciechMazur)
Use config.targetsPlatform instead of Platform.isPlatform #4124 (lolgab)
Convert boxing runtime calls into NIR box/unbox instructions #4139 (lolgab)
Emit missing file attribute in debug metadata of BasicMonitor union and scala.Array types #4163 (WojciechMazur)
Fix detection of using system threads when using ThreadBuilders.start API #4162 (WojciechMazur)
Fix missing unwind symbols when linking with lld #4160 (lolgab)
Compilation Support for native Windows toolchain #3866 (ekrich)
Always inline when code is annotated with
@alwaysinline
#4106 (lolgab)Refine when to apply alwaysinline attribute #4170 (WojciechMazur)
Eliminate redundant box -> bitcast -> unbox chains #4158 (lolgab)
Add missing dbg metadata to generated
scalanative_catch
calls #4179 (WojciechMazur)Optimize throwing exception to local handler as jump #4194 (WojciechMazur)
Fix handling of intrinsic methods in lowering in non-optimized builds #4186 (WojciechMazur)
Don’t warn on unresolved intrisnic method call that is defined inside handled intrinsic method #4202 (WojciechMazur)
Improve detection when system threads are used. #4204 (WojciechMazur)
Refine when to check for StackOverflowError #4203 (WojciechMazur)
Scala Native sbt plugin¶
Prevent closing shared scope that can be used concurrently #4151 (WojciechMazur)
Java Standard Library¶
Missing set methods #4096 (kyouko-taiga)
Make some
java.lang.Properties
be evaluated lazily #4103 (lolgab)Implement
java.lang.Class.forName
#4113 (WojciechMazur)Fix signaturs of java.lang.{Math,Runtime} methods #4114 (WojciechMazur)
Port
java.util.concurrent.CompletableFuture
#4117 (WojciechMazur)javalib InputStream#readNBytes(N) now returns correct number of Bytes read #4129 (LeeTibbert)
Add
{ClosedByInterrupt,AsynchronousClose}Exception
#4130 (armanbilge)Implement java.io null{In, Out}putStream #4134 (LeeTibbert)
rework skipping bytes in java.io.InputStream #4138 (LeeTibbert)
java.io.InflaterInputStream#skip can now handle large N bytes #4140 (LeeTibbert)
javalib PipeIO#read(b,o,l) now follows JVM blocking practice #4166 (LeeTibbert)
javalib PipeIO output is now direct #4174 (LeeTibbert)
javalib BigDecimal#floatValue rounding case now matches JVM #4175 (LeeTibbert)
Four small improvements to java.io.InputStreamReader #4192 (LeeTibbert)
java.io.InputStreamReader reads after EOF are now a better match to JVM #4196 (LeeTibbert)
java.math BigDecimal & BigInteger now implement more performant to*String conversions #4210 (LeeTibbert)
javalib BigMath gets TWO for two #4213 (LeeTibbert)
Implement java.util.Objects methods up to JDK 19, inclusive #4226 (LeeTibbert)
Implement JDK 11 String#lines #4227 (LeeTibbert)
Implement JDK11 Predicate#not #4228 (LeeTibbert)
Implement JDK 11 CharSequence#compare #4229 (LeeTibbert)
Implement JDK 15 CharSequence#isEmpty #4230 (LeeTibbert)
Implement JDK11 java.io Reader#nullReader & Writer#nullWriter #4237 (LeeTibbert)
Port JDK 1-dot-1 java.io CharArrayReader & CharArrayWriter from Scala.js #4238 (LeeTibbert)
Implement two JDK 9 & 16 java.lang IndexOutOfBoundsExceptions #4239 (LeeTibbert)
Implement compliant but minimal JDK 9 Process & ProcessHandle changes. #4236 (LeeTibbert)
Implement two JDK 9 Arrays#mismatch() methods #4241 (LeeTibbert)
Implement JDK 12 Files#mismatch(path, path) #4243 (LeeTibbert)
Implement two JDK 15 jl.Math#absExact methods #4247 (LeeTibbert)
Correct signature of java.lang.String#transform #4246 (LeeTibbert)
Align javalib PrintStream with JDK 23 #4245 (LeeTibbert)
Implement ProcessHandle for processes started by Scala Native runtime #4240 (WojciechMazur)