Closed jhagerer closed 2 years ago
Is it due to Kotlin Native aka Konan? Presumably it should work on the Raspberry Pi 3, but also on 4?
Yes, Kotlin Native does support ARM on Linux (see also https://kotlinlang.org/docs/mpp-supported-platforms.html), but I had to explicitly add support for it. I did have issues building it on a Raspberry Pi, but building it on a normal computer did work fine, although I didn't test running it.
If you do want to build it on a normal computer, you have to execute ./gradlew linkReleaseSharedLinuxArm64
or ./gradlew linkReleaseSharedLinuxArm32Hfp
and install the files. The locations can be derived from the Makefile, but you can also ask if you have problems there.
Compilation works flawlessly on Intel laptop with ./gradlew linkReleaseSharedLinuxArm64
. To run Radicale with DecSync storage backend, I installed everything according to the readme and copied the libs like this:
$ sudo pip3 install radicale
$ sudo pip3 install radicale_storage_decsync
$ nano ~/.config/radicale/config # adding the config
$ sudo cp ~/libdecsync/build/bin/linuxArm64/releaseShared/libdecsync.so . /usr/local/lib/python3.7/dist-packages/libdecsync/libs
$ sudo chmod 644 /usr/local/lib/python3.7/dist-packages/libdecsync/libs/libdecsync.so
$ radicale
[2021-05-11 13:38:57 +0200] [19703] [CRITICAL] An exception occurred during server startup: Failed to load storage module 'radicale_storage_decsync': libdecsync: A 64bit platform is required. Found '32bit'.
I also tried it with the binaries from linuxArm32Hfp, but it yields the same results. Any ideas? Thanks a lot BTW!
This is because the Python bindings check for a 64bit platform, corresponding to the original libdecsync.so
. As you are already changing the library, you might as well try changing that too. See here for the relevant part.
Uncommenting lines 40 and 41 yields
[2021-05-17 19:44:17 +0200] [3881] [CRITICAL] An exception occurred during server startup: Failed to load storage module 'radicale_storage_decsync': /usr/local/lib/python3.7/dist-packages/libdecsync/libs/libdecsync.so: cannot open shared object file: No such file or directory
The file under that file path exists though. It is the 32-bit binary, as Raspberry Pi OS and its kernel is still 32-bit per default (arm71, the CPU is 64-bit capable, but not Raspberry Pi OS). Also python3 is 32-bit compiled. I don't know how to get it running.
The latest version of the Python bindings do have the suitable .so files. Does that work? (If you are still trying.)
I get this error when building the AUR package on my PinePhone:
./gradlew linkReleaseSharedlinuxArm64
Starting a Gradle Daemon (subsequent builds will be faster)
> Configure project :
Please wait while Kotlin/Native compiler 1.5.31 is being installed.
Download https://download.jetbrains.com/kotlin/native/builds/releases/1.5.31/linux-aarch64/kotlin-native-prebuilt-linux-aarch64-1.5.31.tar.gz
FAILURE: Build failed with an exception.
* Where:
Build file '/home/alarm/.cache/yay/libdecsync/src/libdecsync-2.1.2/build.gradle' line: 74
* What went wrong:
A problem occurred evaluating root project 'libdecsync-2.1.2'.
> Could not resolve all files for configuration ':detachedConfiguration2'.
> Could not resolve :kotlin-native-prebuilt-linux-aarch64:1.5.31.
Required by:
project :
> Could not resolve :kotlin-native-prebuilt-linux-aarch64:1.5.31.
> Could not get resource 'https://download.jetbrains.com/kotlin/native/builds/releases/1.5.31/linux-aarch64/kotlin-native-prebuilt-linux-aarch64-1.5.31.tar.gz'.
> Could not HEAD 'https://download-cdn.jetbrains.com/kotlin/native/builds/releases/1.5.31/linux-aarch64/kotlin-native-prebuilt-linux-aarch64-1.5.31.tar.gz'. Received status code 403 from server: Forbidden
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 4m 59s
make: *** [Makefile:35: build/bin/linuxArm64/releaseShared/libdecsync_api.h] Error 1
==> Entering fakeroot environment...
==> Starting package()...
./gradlew linkReleaseSharedlinuxArm64
Exception in thread "main" java.lang.RuntimeException: Could not create parent directory for lock file /root/.gradle/wrapper/dists/gradle-6.5-bin/6nifqtx7604sqp1q6g8wikw7p/gradle-6.5-bin.zip.lck
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:43)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
make: *** [Makefile:35: build/bin/linuxArm64/releaseShared/libdecsync_api.h] Error 1
==> ERROR: A failure occurred in package().
Aborting...
-> error making: libdecsync
I found this relevant discussion regarding compiling kotlin on arm64: https://youtrack.jetbrains.com/issue/KT-36871
It looks like arm64 isn't supported as a host, but might be supported in the future. It might be worth creating a binary package for AUR in the meantime
I just created the AUR package libdecsync-bin exclusive to aarch64 for the pinephone/pinephone pro
If you could make the .so files available in the releases that would make things easier!
Thanks! I will also add them to the releases.
I just created the AUR package libdecsync-bin exclusive to aarch64 for the pinephone/pinephone pro
If you could make the .so files available in the releases that would make things easier!
libxcrypt-compat should be added as a dependency due to issue #14
After apt-get installing all dependencies as written in the README.md,
make
fails as shown below. Architecture is Raspberry Pi 4, i.e., arm64-v71, with Raspbian 10. Any advice?