matthewshirley / pact_dart

Dart DSL for Pact, the de-facto API contract testing tool.
MIT License
19 stars 10 forks source link

Issue with running on Apple M1 #17

Open Vrungel322 opened 1 year ago

Vrungel322 commented 1 year ago

As "Installation" bloc requires - I launch bouth commands. But while launch test - has error dart:ffi new DynamicLibrary.open

package:pact_dart/src/ffi/dylib.dart 29:25           openLibrary
package:pact_dart/src/bindings/bindings.dart 78:15   new PactFFIBindings
package:pact_dart/src/bindings/bindings.dart 173:53  bindings
package:pact_dart/src/pact_mock_service.dart 23:5    new PactMockService
test/Pact_test.dart 10:17                            main.<fn>.<fn>

Invalid argument(s): Failed to load dynamic library '/usr/local/lib/libpact_ffi.dylib': dlopen(/usr/local/lib/libpact_ffi.dylib, 0x0001): tried: '/usr/local/lib/libpact_ffi.dylib' (code signature in <74A29074-0E83-3779-B194-CBE75F011DC6> '/usr/local/lib/libpact_ffi.dylib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libpact_ffi.dylib' (no such file), '/usr/local/lib/libpact_ffi.dylib' (code signature in <74A29074-0E83-3779-B194-CBE75F011DC6> '/usr/local/lib/libpact_ffi.dylib' not valid for use in process: library load disallowed by system policy)

As I understand issue in Apple M1 ?

MartinStorz commented 1 year ago

Problem is that the install script only downloads x86_64 architecture, not arm64. PR to fix: https://github.com/matthewshirley/pact_dart/pull/18

Or manually download the correct lib here: https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.4.6 https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.6/libpact_ffi-osx-aarch64-apple-darwin.dylib.gz