Skip to content

Commit

Permalink
Release 0.4.3 (#2537)
Browse files Browse the repository at this point in the history
* Set version to 0.4.3
* Add changelog
  • Loading branch information
WojciechMazur committed Jan 22, 2022
1 parent 02a9a36 commit 605c0a7
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 3 deletions.
204 changes: 204 additions & 0 deletions docs/changelog/0.4.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@

# 0.4.3 (2022-01-21)

We're happy to announce the release of Scala Native v0.4.3, which brings support for Scala 3!

This release does also contain performance-critical bug fixes to performing operations on Strings,
leading to significant improvement of regexes throughput. Furthermore it comes with improvements
to the sbt plugin in the area of incremental compilation and implementation of some missing methods
from Java standard library.

## Breaking changes in release 0.4.3
The minimal version of Scala 3 supported by Scala Native is 3.1.0, due to fatal blockers in Scala 3.0.x.
In the future, when improved backward compatibility support in Scala 3.2 would implemented, Scala Native
might be backported to the older version of the compiler.

### Changes to the main method resolving
In the previous versions of Scala Native main entry point was always resolved based on the companion object defining the main method.
This behaviour however lead to multiple issues in situations when an actual main method was introduced via inheritance. Because of that issue,
build tools needed to always add `$` suffix to actual main class to make sure that entry method would be found.
With the 0.4.3 release, Scala Native does generate static method forwarders in the same way as it is done in JVM and Scala.js.
Build tools should make sure to no longer add `$` to the discovered main class name.

### Source compatibity of `stackalloc[T]` and `alloc[T]` methods
No-param methods `scalanative.unsafe.stackalloc[T]` and `scalanative.unsafe.alloc[T]` were removed from Scala 3 `unsafe` package.
In Scala 2 these methods have been deprecated and it is recommended to use empty-param variants of these methods instead, eg. `scalanative.unsafe.stackalloc[T]()`.
This change was introduced due to changes of how does Scala 3 interpret source code as it could lead to dangerous, hard to debug, runtime errors.
As an example call to `stackalloc[Byte](10)` in Scala 2 would result in allocating memory of size `10 * sizeof(Byte)`. In Scala 3 however,
the given snippet would be interpreted as `stackalloc[Byte].apply(10)` which is still valid, but leads to allocating `1 * sizeof(Byte)` chunk of memory and
accessing its 10th element, which would lead to undefined behaviour.
More information can be found in [#2480](https://github.com/scala-native/scala-native/pull/2480)

## Known issues
### Cannot create documentation using scaladoc in Scala Native sbt project
When trying to generate documentation using Scaladoc for projects using Scala Native compilation would fail with an exception.
This issue is common for most of the compiler plugins and was already fixed in Scala 3.1.1 compiler. As a workaround in Scala 3.1.0 we would recomend adjusting sbt build, by filtering out all `-Xplugin` settings from `Compile / doc / scalacOptions`. Workaround can be find in [this discussion](https://github.com/scala-native/scala-native/issues/2503#issuecomment-1005290906)

<table>
<tbody>
<tr>
<td>Commits since last release</td>
<td align="center">65</td>
</tr>
<tr>
<td>Merged PRs</td>
<td align="center">62</td>
</tr>
<tr>
<td>Contributors</td>
<td align="center">7</td>
</tr>
</tbody>
</table>

## Contributors

Big thanks to everybody who contributed to this release or reported an issue!

```
$ git shortlog -sn --no-merges v0.4.2..v0.4.3
54 Wojciech Mazur
5 Eric K Richardson
2 Jan Chyb
1 Anton Sviridov
1 Kamil Podsiadło
1 Lorenzo Gabriele
1 Ruslan Shevchenko
```

## Merged PRs

## [v0.4.3](https://github.com/scala-native/scala-native/tree/v0.4.3) (2022-01-21)

[Full Changelog](https://github.com/scala-native/scala-native/compare/v0.4.2...v0.4.3)

**Merged pull requests:**

### Bug fixes
- Initialize _String with `_` `Array[Char]`
[\#2449](https://github.com/scala-native/scala-native/pull/2449)
([lolgab](https://github.com/lolgab))
- Fix ARM64 MacOS varargs
[\#2448](https://github.com/scala-native/scala-native/pull/2448)
([keynmol](https://github.com/keynmol))
- Fix certain absolute file paths being shown as relative on Windows
[\#2471](https://github.com/scala-native/scala-native/pull/2471)
([jchyb](https://github.com/jchyb))
- Make `java.nio.MappedByteBuffer` JDK9+ compliant
[\#2453](https://github.com/scala-native/scala-native/pull/2453)
([WojciechMazur](https://github.com/WojciechMazur))
- Remove redundant coversion of `CharSequence` into `Array` in `Character.codePoint{at, before}` methods
[\#2495](https://github.com/scala-native/scala-native/pull/2495)
([WojciechMazur](https://github.com/WojciechMazur))

### Native library
- Adapt `unsafe` package for upcoming Scala 3 support
[\#2454](https://github.com/scala-native/scala-native/pull/2454)
([WojciechMazur](https://github.com/WojciechMazur))
- Enforce usage of empty parens variant of `stackalloc[T]` and `alloc[T]` in Scala 3
[\#2480](https://github.com/scala-native/scala-native/pull/2480)
([WojciechMazur](https://github.com/WojciechMazur))

### Standard Java library
- Port URLDecoder from Scala.js
[\#2506](https://github.com/scala-native/scala-native/pull/2506)
([kpodsiad](https://github.com/kpodsiad))
- Allign implemenation of UTF-8 and UTF-16 charsets with Scala.js
[\#2515](https://github.com/scala-native/scala-native/pull/2515)
([WojciechMazur](https://github.com/WojciechMazur))
- ProcessMonitor should not busy wait if there are no active processess
[\#2518](https://github.com/scala-native/scala-native/pull/2518)
([WojciechMazur](https://github.com/WojciechMazur))
- System.properties define `os.arch`
[\#2452](https://github.com/scala-native/scala-native/pull/2452)
([WojciechMazur](https://github.com/WojciechMazur))
- Start adding JDK 11 support
[\#2450](https://github.com/scala-native/scala-native/pull/2450)
([ekrich](https://github.com/ekrich))
- Touch up NIO for Java 9+
[\#2455](https://github.com/scala-native/scala-native/pull/2455)
([ekrich](https://github.com/ekrich))
- Add missing java.io.channels.Channels methods
[\#2532](https://github.com/scala-native/scala-native/pull/2532)
([jchyb](https://github.com/jchyb))
- Fix runtime errors in BigDecimal arithmetic operations
[\#2534](https://github.com/scala-native/scala-native/pull/2534)
([WojciechMazur](https://github.com/WojciechMazur))

### Compiler plugin / NIR
- Use encoded names for methods and fields in NIR
[\#2458](https://github.com/scala-native/scala-native/pull/2458)
([WojciechMazur](https://github.com/WojciechMazur))
([WojciechMazur](https://github.com/WojciechMazur))
- Define `Field` operation in NIR
[\#2460](https://github.com/scala-native/scala-native/pull/2460)
([WojciechMazur](https://github.com/WojciechMazur))
- Port NIR generation compiler plugin to Scala 3
[\#2462](https://github.com/scala-native/scala-native/pull/2462)
([WojciechMazur](https://github.com/WojciechMazur))
- Adapt LazyVals to work in Scala Native
[\#2465](https://github.com/scala-native/scala-native/pull/2465)
([WojciechMazur](https://github.com/WojciechMazur))
- Port JUnit Plugin to Scala 3
[\#2467](https://github.com/scala-native/scala-native/pull/2467)
([WojciechMazur](https://github.com/WojciechMazur))
- Introduce static scope and generate static method forwarders in Scala 3
[\#2472](https://github.com/scala-native/scala-native/pull/2472)
([WojciechMazur](https://github.com/WojciechMazur))
- Generate static method forwarders in Scala 2
[\#2476](https://github.com/scala-native/scala-native/pull/2476)
([WojciechMazur](https://github.com/WojciechMazur))
- Use public static main method forwarder as entry point
[\#2481](https://github.com/scala-native/scala-native/pull/2481)
([WojciechMazur](https://github.com/WojciechMazur))
- Improvements to generation and invocation of static methods
[\#2489](https://github.com/scala-native/scala-native/pull/2489)
([WojciechMazur](https://github.com/WojciechMazur))
- Fix #2504 - Use correct self value when generating Apply trees
[\#2509](https://github.com/scala-native/scala-native/pull/2509)
([WojciechMazur](https://github.com/WojciechMazur))
- Fix off by 1 `nir.Positions` produced in Scala 3
[\#2510](https://github.com/scala-native/scala-native/pull/2510)
([WojciechMazur](https://github.com/WojciechMazur))
- Fix compilation errors when using lazy vals in quoted macros
[\#2511](https://github.com/scala-native/scala-native/pull/2511)
([WojciechMazur](https://github.com/WojciechMazur))
- Better error messages for `CFuncPtr.fromScalaFunction`
[\#2512](https://github.com/scala-native/scala-native/pull/2512)
([WojciechMazur](https://github.com/WojciechMazur))
- When enabling reflective instantiation check base classess instead of parents
[\#2521](https://github.com/scala-native/scala-native/pull/2521)
([WojciechMazur](https://github.com/WojciechMazur))

### sbt plugin
- Store config cached fingerprints seperetly for each version of Scala
[\#2516](https://github.com/scala-native/scala-native/pull/2516)
([WojciechMazur](https://github.com/WojciechMazur))
- Add `-test` suffix to artifact path of test executables
[\#2524](https://github.com/scala-native/scala-native/pull/2524)
([WojciechMazur](https://github.com/WojciechMazur))

### Linker
- Make reachablity phase more user friendly
[\#2469](https://github.com/scala-native/scala-native/pull/2469)
([WojciechMazur](https://github.com/WojciechMazur))

### Misc
- Allow to define top-level extern definitons in Scala 3
[\#2496](https://github.com/scala-native/scala-native/pull/2496)
([WojciechMazur](https://github.com/WojciechMazur))
- Add missing `Show` implementation for `Inst.LinktimeIf`
[\#2513](https://github.com/scala-native/scala-native/pull/2513)
([WojciechMazur](https://github.com/WojciechMazur))
- Implement time zone offset
[\#2508](https://github.com/scala-native/scala-native/pull/2508)
([ekrich](https://github.com/ekrich))
- Add Scala 2.13.8 to the build
[\#2525](https://github.com/scala-native/scala-native/pull/2525)
([WojciechMazur](https://github.com/WojciechMazur))
- Allow to compile Scala 2.11 scalalib with JDK 17
[\#2530](https://github.com/scala-native/scala-native/pull/2530)
([rssh](https://github.com/rssh))
- Add Scala 3.1.1 to the build
[\#2536](https://github.com/scala-native/scala-native/pull/2536)
([WojciechMazur](https://github.com/WojciechMazur))
1 change: 1 addition & 0 deletions docs/changelog/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changelog
.. toctree::
:maxdepth: 1

0.4.3
0.4.3-RC2
0.4.3-RC1
0.4.2
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def generateScalaNativeCurrentYear():
# built documents.
#
# The short X.Y version.
version = u'0.4.3-SNAPSHOT'
version = u'0.4.3'
# The full version, including alpha/beta/rc tags.
release = u'0.4.3-SNAPSHOT'
release = u'0.4.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion nir/src/main/scala/scala/scalanative/nir/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object Versions {
final val revision: Int = 9 // a.k.a. MINOR version

/* Current public release version of Scala Native. */
final val current: String = "0.4.3-SNAPSHOT"
final val current: String = "0.4.3"
final val currentBinaryVersion: String = binaryVersion(current)

private object FullVersion {
Expand Down

0 comments on commit 605c0a7

Please sign in to comment.