Consider building for Raspberry Pi (arm64)
We got the following mail some time back. I guess this should be quite easy when using pinpit after !274 (merged) is merged, @sebkur?
Dear Briar team,
for some time I have been following the development of the Briar app. First it was the Android app only, which I use on a regular basis for some time now. Recently I'm trying to include the Linux desktop into my Briar environment. My intention was to run the desktop version of the Briar app on a Raspberry Pi system.
But the app crashes right at the start during initialization. After some searching the net I think the issue may be minor and could (possibly, hopefully) be easily fixed. (If not, please excuse my ignorance, I'm not a programmer).
There are two links with hints to a possible resolve for the issue:
- https://github.com/JetBrains/compose-jb/issues/1170
- https://stackoverflow.com/questions/70150052/org-jetbrains-skiko-libraryloadexception-cannot-find-libskiko-macos-arm64-dylib
According to these links, somewhere in the sources a call like this may be present:
implementation(compose.desktop.currentOs)
It may help to replace it with:
implementation(compose.desktop.linux_arm64)
Or with some kind of dynamic reference to the OS it is run on.
As can be seen with uname -a
(see below) the architecture seems to identify itself as aarch64
, not as arm64
as seen in the exception error text.
Here is what I get when I try to start the app:
> java -jar Briar-Desktop.jar
22:32:18.679 [main] INFO org.briarproject.briar.desktop.Main - This is briar-desktop version 0.3.0-beta
22:32:18.690 [main] INFO org.briarproject.briar.desktop.Main - Build info:
22:32:18.692 [main] INFO org.briarproject.briar.desktop.Main - Git hash 0a8c574cdd0942bee6fe709e0987a56c0360d349
22:32:18.697 [main] INFO org.briarproject.briar.desktop.Main - Commit time 2022-09-30 13:50:28
22:32:18.700 [main] INFO org.briarproject.briar.desktop.Main - Tag 0.3.0-beta
Exception in thread "main" java.lang.ExceptionInInitializerError
at androidx.compose.ui.awt.ComposeLayer.<init>(ComposeLayer.desktop.kt:72)
at androidx.compose.ui.awt.ComposeWindowDelegate.<init>(ComposeWindowDelegate.desktop.kt:50)
at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:43)
at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:40)
at androidx.compose.ui.window.Window_desktopKt$Window$3.invoke(Window.desktop.kt:161)
at androidx.compose.ui.window.Window_desktopKt$Window$3.invoke(Window.desktop.kt:156)
at androidx.compose.ui.window.Window_desktopKt$Window$10$1.invoke(Window.desktop.kt:367)
at androidx.compose.ui.window.Window_desktopKt$Window$10$1.invoke(Window.desktop.kt:366)
at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2.invoke(AwtWindow.desktop.kt:75)
at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2.invoke(AwtWindow.desktop.kt:74)
at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:81)
at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:801)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:647)
at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:763)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:433)
at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:220)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: org.jetbrains.skiko.LibraryLoadException: Cannot find libskiko-linux-arm64.so.sha256, proper native dependency missing.
at org.jetbrains.skiko.Library.findAndLoad(Library.kt:105)
at org.jetbrains.skiko.Library.load(Library.kt:59)
at org.jetbrains.skiko.SkiaLayer.<clinit>(SkiaLayer.awt.kt:27)
The java archive file used is the current beta version (101M):
briar-desktop-linux-0.3.0-beta.jar
The above mentioned jar file works fine on a AMD64 Linux system (Debian testing). No issue with the file, then. By the way, the same error occurred with the older version 0.2.1-beta as well.
The system the app was crashing on is a Raspberry Pi with current stable 64 bit PiOS. The hardware is a Raspberry Pi 4 with 4 GB of RAM and plenty of it is free.
Some other Java applications like MediathekView run without issues.
This leads me to the conclusion that the error is somewhere in the code.
I hope the information provided helps to get Briar running on a Raspberry Pi with a future release of the desktop app.
> cat /etc/issue
Debian GNU/Linux 11 \n \l
> uname -a
Linux myhost 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux
> java --version
openjdk 17.0.4 2022-07-19
OpenJDK Runtime Environment (build 17.0.4+8-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.4+8-Debian-1deb11u1, mixed mode, sharing)