instantiations / es_compression

Compression framework for Dart providing FFI implementations for Brotli, Lz4, Zstd (Zstandard) with ready-to-use prebuilt binaries for Win/Linux/Mac.
https://www.instantiations.com
BSD 3-Clause "New" or "Revised" License
41 stars 8 forks source link

macOS - Apple Silicon - LZ4 wrong architecture (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) #49

Closed iacopo-domotz closed 7 months ago

iacopo-domotz commented 7 months ago

Running for command line, using Dart

Full strack trace:

Invalid argument(s): Failed to load dynamic library '/Users/[anon]/.pub-cache/hosted/pub.dev/es_compression-2.0.11/lib/src/lz4/blobs/eslz4-mac64.dylib': dlopen(/Users/[anon]/.pub-cache/hosted/pub.dev/es_compression-2.0.11/lib/src/lz4/blobs/eslz4-mac64.dylib, 0x0001): tried: '/Users/[anon]/.pub-cache/hosted/pub.dev/es_compression-2.0.11/lib/src/lz4/blobs/eslz4-mac64.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/[anon]/.pub-cache/hosted/pub.dev/es_compression-2.0.11/lib/src/lz4/blobs/eslz4-mac64.dylib' (no such file), '/Users/[anon]/.pub-cache/hosted/pub.dev/es_compression-2.0.11/lib/src/lz4/blobs/eslz4-mac64.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2      OpenLibraryStrategy.open (package:es_compression/src/framework/native/library/open_library_strategy.dart:38:28)
#3      OpenViaPackageRelativeStrategy.openFor (package:es_compression/src/framework/native/library/package_relative_strategy.dart:46:12)
#4      OpenLibrary.openLibrary (package:es_compression/src/framework/native/library/open_library.dart:44:32)
#5      new Lz4Library._ (package:es_compression/src/lz4/ffi/library.dart:54:20)
#6      Lz4Library._instance (package:es_compression/src/lz4/ffi/library.dart:34:50)
#7      Lz4Library._instance (package:es_compression/src/lz4/ffi/library.dart)
#8      new Lz4Library (package:es_compression/src/lz4/ffi/library.dart:49:27)
#9      new Lz4Dispatcher (package:es_compression/src/lz4/ffi/dispatcher.dart:47:31)
#10     new Lz4DecompressFilter (package:es_compression/src/lz4/ffi/decompress_filter.dart:22:37)
#11     _makeLz4DecompressFilter (package:es_compression/src/lz4/decoder.dart:57:5)
#12     new _Lz4DecoderSink._ (package:es_compression/src/lz4/decoder.dart:47:13)
#13     Lz4Decoder.startChunkedConversion (package:es_compression/src/lz4/decoder.dart:38:28)
#14     CodecConverter.convert (package:es_compression/src/framework/converters.dart:20:7)
sethloco commented 7 months ago

Prebuilt macos is currently still Intel.

It is likely in a subsequent update I will provide prebuilt Macos/Arm and drop Macos/Intel. I do not have an ETA on when that will be but I will make a note to revisit this.

I provided the tool/blob_builder cmake scripts for anyone that needed an arch different than the prebuilt targets, so you can, of course, easily build these Macos/ARM libraries today