New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x.x: Support for Arm64 Architecture #199
Comments
It looks like you have two versions of Pact Go in your repository - the new 2.x.x and the current 1.x.x line. The current 1.x.x line should work in Rosetta mode, but I think because you also have 2.x.x running you are hitting a separate problem (we use a shared library). I've just pushed up a minor change to the installer, which will pull in the arm artifacts that we publish for the core. But I can see that your test project is not pulling the new dependencies in (1.x.x uses a Ruby shared core, 2.x.x uses a rust shared core. The CLI that you pull in is worth keeping around though, because it has the publishing and other useful commands). Make sure you either run the |
I'll leave this open for you to test and confirm it's all working. |
2022/02/15 09:17:14 [INFO] package libpact_ffi not found
2022/02/15 09:17:14 [INFO] downloading library from https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.1.2/libpact_ffi-osx-aarch64-apple-darwin.dylib.gz to /usr/local/lib/libpact_ffi.dylib
2022/02/15 09:17:15 [INFO] setting install_name on library libpact_ffi for osx
2022/02/15 09:17:15 [INFO] package libpact_ffi found
# github.com/pact-foundation/pact-go/v2/internal/native
Undefined symbols for architecture arm64:
"_pactffi_cleanup_mock_server", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_cleanup_mock_server in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_cleanup_mock_server)
"_pactffi_create_mock_server", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server, __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server_for_pact )
"_pactffi_create_mock_server_for_pact", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server_for_pact in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server_for_pact)
"_pactffi_free_string", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_free_string in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_free_string)
"_pactffi_get_tls_ca_certificate", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_get_tls_ca_certificate in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_get_tls_ca_certificate)
"_pactffi_given", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_given in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_given, __cgo_c5f0653e4b8d_Cfunc_pactffi_given_with_param )
"_pactffi_given_with_param", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_given_with_param in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_given_with_param)
"_pactffi_init", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_init in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_init)
"_pactffi_message_expects_to_receive", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_expects_to_receive in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_expects_to_receive)
"_pactffi_message_given", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_given in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_given_with_param, __cgo_c5f0653e4b8d_Cfunc_pactffi_message_given )
"_pactffi_message_given_with_param", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_given_with_param in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_given_with_param)
"_pactffi_message_reify", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_reify in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_reify)
"_pactffi_message_with_contents", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_with_contents in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_with_contents)
"_pactffi_message_with_metadata", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_with_metadata in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_with_metadata)
"_pactffi_mock_server_mismatches", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_mock_server_mismatches in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_mock_server_mismatches)
"_pactffi_new_interaction", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_new_interaction in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_new_interaction)
"_pactffi_new_message", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_new_message in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_new_message_pact, __cgo_c5f0653e4b8d_Cfunc_pactffi_new_message )
"_pactffi_new_message_pact", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_new_message_pact in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_new_message_pact)
"_pactffi_new_pact", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_new_pact in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_new_pact)
"_pactffi_response_status", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_response_status in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_response_status)
"_pactffi_upon_receiving", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_upon_receiving in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_upon_receiving)
"_pactffi_verify", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_verify in _x005.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_verify)
"_pactffi_version", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_version in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_version)
"_pactffi_with_binary_file", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_binary_file in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_binary_file)
"_pactffi_with_body", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_body in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_body)
"_pactffi_with_header", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_header in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_header)
"_pactffi_with_message_pact_metadata", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_message_pact_metadata in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_message_pact_metadata)
"_pactffi_with_multipart_file", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_multipart_file in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_multipart_file)
"_pactffi_with_pact_metadata", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_pact_metadata in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_pact_metadata)
"_pactffi_with_query_parameter", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_query_parameter in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_query_parameter)
"_pactffi_with_request", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_request in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_request)
"_pactffi_with_specification", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_specification in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_specification)
"_pactffi_write_message_pact_file", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_write_message_pact_file in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_write_message_pact_file)
"_pactffi_write_pact_file", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_write_pact_file in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_write_pact_file)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation) ... |
Thanks, I think I'll need to get an M1 machine to setup builds. Sadly, GH doesn't support it yet. Just to confirm - did you run this in a Rosetta terminal or a normal one? Have you tried running it in Rosetta mode? In rosetta mode, the standard dylib should be used. I was working with a colleague yesterday who was running the new Pact .NET package on an M1 Mac, that used the standard OSX dylib and that worked, so I'm hoping it should work the same here. |
Any update on this? Is there going to be a README section for this? @mefellows |
No update on this - what do you want to see in the README? I'd first like feedback that it does run in Rosetta mode. If that's the case, it'll be the easiest initial fix. Until we get GH build agents with ARM M1 support I can't reliably run and test Pact Go on that setup. |
Hi Matt :) I've followed the same steps as Frederic did and get the same error, in both the normal Terminal and the Rosetta Terminal. I also installed (#199 (comment)) using the Rosetta Terminal. |
OK so today I received a shiny new M1 Max. I'm still figuring things out, but I managed to get this working:
No lib installed
In the
Now the lib is there
(I have to But then running So how did I do it? |
Should be fixed in v2.0.0-beta.11. |
Just noting that as of 7a1c264 it should also work on Linux arm64. |
Software versions
GO111MODULE="on"
GOARCH="arm64"
GOBIN="/Users/f.gendebien/go/bin"
GOCACHE="/Users/f.gendebien/Library/Caches/go-build"
GOENV="/Users/f.gendebien/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/f.gendebien/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/f.gendebien/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.17.6/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.17.6/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.6"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/f.gendebien/Documents/projects/pact-poc/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wj/nz5n4tcj4q78bdnp9zx6s7wh0000gp/T/go-build1088991691=/tmp/go-build -gno-record-gcc-switches -fno-common"
Expected behaviour
The execution of the tests should work correctly
Actual behaviour
The execution crashes:
github.com/pact-foundation/pact-go/v2/internal/native
Undefined symbols for architecture arm64:
"_pactffi_cleanup_mock_server", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_cleanup_mock_server in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_cleanup_mock_server)
"_pactffi_create_mock_server", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server, __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server_for_pact )
"_pactffi_create_mock_server_for_pact", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server_for_pact in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_create_mock_server_for_pact)
"_pactffi_free_string", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_free_string in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_free_string)
"_pactffi_get_tls_ca_certificate", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_get_tls_ca_certificate in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_get_tls_ca_certificate)
"_pactffi_given", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_given in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_given, __cgo_c5f0653e4b8d_Cfunc_pactffi_given_with_param )
"_pactffi_given_with_param", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_given_with_param in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_given_with_param)
"_pactffi_init", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_init in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_init)
"_pactffi_message_expects_to_receive", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_expects_to_receive in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_expects_to_receive)
"_pactffi_message_given", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_given in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_given_with_param, __cgo_c5f0653e4b8d_Cfunc_pactffi_message_given )
"_pactffi_message_given_with_param", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_given_with_param in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_given_with_param)
"_pactffi_message_reify", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_reify in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_reify)
"_pactffi_message_with_contents", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_with_contents in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_with_contents)
"_pactffi_message_with_metadata", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_message_with_metadata in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_message_with_metadata)
"_pactffi_mock_server_mismatches", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_mock_server_mismatches in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_mock_server_mismatches)
"_pactffi_new_interaction", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_new_interaction in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_new_interaction)
"_pactffi_new_message", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_new_message in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_new_message_pact, __cgo_c5f0653e4b8d_Cfunc_pactffi_new_message )
"_pactffi_new_message_pact", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_new_message_pact in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_new_message_pact)
"_pactffi_new_pact", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_new_pact in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_new_pact)
"_pactffi_response_status", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_response_status in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_response_status)
"_pactffi_upon_receiving", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_upon_receiving in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_upon_receiving)
"_pactffi_verify", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_verify in _x005.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_verify)
"_pactffi_version", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_version in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_version)
"_pactffi_with_binary_file", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_binary_file in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_binary_file)
"_pactffi_with_body", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_body in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_body)
"_pactffi_with_header", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_header in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_header)
"_pactffi_with_message_pact_metadata", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_message_pact_metadata in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_message_pact_metadata)
"_pactffi_with_multipart_file", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_multipart_file in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_multipart_file)
"_pactffi_with_pact_metadata", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_pact_metadata in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_pact_metadata)
"_pactffi_with_query_parameter", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_query_parameter in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_query_parameter)
"_pactffi_with_request", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_request in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_request)
"_pactffi_with_specification", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_with_specification in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_with_specification)
"_pactffi_write_message_pact_file", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_write_message_pact_file in _x003.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_write_message_pact_file)
"_pactffi_write_pact_file", referenced from:
__cgo_c5f0653e4b8d_Cfunc_pactffi_write_pact_file in _x004.o
(maybe you meant: __cgo_c5f0653e4b8d_Cfunc_pactffi_write_pact_file)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FAIL github.com/frederic-gendebien/pact-poc/application/server/pkg/interfaces/client [build failed]
FAIL
Steps to reproduce
https://github.com/frederic-gendebien/pact-poc/tree/feature/pact_2.x.x
make -e client-pact-test
Relevent log files
Already provided above
The text was updated successfully, but these errors were encountered: