Consensys / linea-sequencer

Linea Sequencer Implementation
Other
18 stars 17 forks source link

Native library for macOS not included in released JAR file #72

Closed Gabriel-Trintinalia closed 1 month ago

Gabriel-Trintinalia commented 2 months ago

It seems that the native library for macOS (darwin-aarch64/libcompress_jni.dylib) is not included in the released JAR file. This causes issues when using the downloaded JAR file on macOS, resulting in the following error:

2024-09-10 15:09:38.196+10:00 | main | ERROR | LibCompress | Error loading native compress_jni library
java.io.IOException: Native library (darwin-aarch64/libcompress_jni.dylib) not found in resource path

Steps to reproduce:

Expected behaviour: The native library for macOS should be included in the released JAR file.

Building the project from source code works fine. If we cannot build and include it in the jar (maybe due to macOS restrictions?), can we upload the native library somewhere so that I can include it in the besu-linea-package?

fab-10 commented 1 month ago

GH has macOS runners available: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

So we could use it to build the native lib and save the artifact so it can be later used when packing the final jar

fab-10 commented 1 month ago

@Gabriel-Trintinalia I am adding macOS native lib to the release artifact, since I haven't a mac to test it, could you please verify if this sequencer jar works for you https://github.com/Consensys/linea-sequencer/actions/runs/10943375286? It is from branch https://github.com/Consensys/linea-sequencer/tree/release-macos-native-lib, where I just simulate the release process with the macos-native-lib workflow, that I can just remove after we are sure the artifact is good.

Gabriel-Trintinalia commented 1 month ago

@fab-10 The jar worked fine:

2024-09-20 08:55:16.386+10:00 | main | INFO  | LibCompress | Loaded compress_jni native library from
/Users/gtrintinalia/Library/Caches/JNA/temp/jna9883949350422638547.tmp with compressor_dict /var/folders/l3/rhsks9yj0kxc3hz17ljrt3ww0000gn/T/tempCompressor_dict12141656215189312137bin
...
# Plugin Registration Summary:
# Registered Plugins: 
#  - LineaExtraDataPlugin (linea-sequencer/0.0.0-TEST)