Make Netty native transport work on Linux AArch64
and RISC-V
(besides x86-64
)
#12405
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I run Linux on a MacBook M1 Pro:
Also it seems more cloud services offer Linux arm64 (=aarch64) virtual machines nowadays. The problem is currently when running Play with the netty backend on such CPUs with
play.server.netty.transport = "native"
configured, you end up with this error:The solution is quite simple, just adding the
linux-aarch_64
native library as dependency works:I also added the RISC-V native library, because it's also available now, just since December:
Currently no other native transports (on Linux) are available: https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.107.Final/
Adding those native transport does not do any harm (besides occupying a couple of bytes on the disk if not used), but make the out of the box experience of
play.server.netty.transport = "native"
much nicer. (Only the library for the used architecture gets loaded: https://github.com/netty/netty/blob/netty-4.1.107.Final/transport-classes-epoll/src/main/java/io/netty/channel/epoll/Native.java#L319-L332 - of course, because the others would fail to load if trying to load on the wrong architecture)More links: