The current state of my POC can be found here: <ht...
# protobufs
r
The current state of my POC can be found here: https://github.com/ringods/pulumi-pact-poc But when running
go test -v .
, I get this output:
Copy code
$ go test -v .
# <http://github.com/ringods/pulumi-pact-poc.test|github.com/ringods/pulumi-pact-poc.test>
/usr/local/Cellar/go/1.19.3/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: -no_pie is deprecated when targeting new OS versions
Undefined symbols for architecture x86_64:
  "_pactffi_verifier_add_provider_transport", referenced from:
      __cgo_6fba9656f5d3_Cfunc_pactffi_verifier_add_provider_transport in 000004.o
     (maybe you meant: __cgo_6fba9656f5d3_Cfunc_pactffi_verifier_add_provider_transport)
  "_pactffi_verifier_set_no_pacts_is_error", referenced from:
      __cgo_6fba9656f5d3_Cfunc_pactffi_verifier_set_no_pacts_is_error in 000004.o
     (maybe you meant: __cgo_6fba9656f5d3_Cfunc_pactffi_verifier_set_no_pacts_is_error)
  "_pactffi_with_header_v2", referenced from:
      __cgo_6fba9656f5d3_Cfunc_pactffi_with_header_v2 in 000003.o
     (maybe you meant: __cgo_6fba9656f5d3_Cfunc_pactffi_with_header_v2)
  "_pactffi_with_query_parameter_v2", referenced from:
      __cgo_6fba9656f5d3_Cfunc_pactffi_with_query_parameter_v2 in 000003.o
     (maybe you meant: __cgo_6fba9656f5d3_Cfunc_pactffi_with_query_parameter_v2)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

FAIL    <http://github.com/ringods/pulumi-pact-poc|github.com/ringods/pulumi-pact-poc> [build failed]
FAIL
I don’t really have a test yet. I’m trying to get our language host started. (FYI, language host is a Pulumi concept, see the readme of my repo) But does this error tell you something whether I’m missing something in my setup?
y
Have you ran the go install command for pact to install the pre req libs? I should be in the readme on the v2 branch Assume you are on an m1 mac? are you in rosetta mode? You prob need to be in darwin m1 mode
uname -sm
should be
arm64
i think. You get different results using the x86_64 libs on an m1 machine
ty for sharing the link to the POC, look forward to getting the chance to glance over it https://github.com/pact-foundation/pact-go/tree/2.x.x#installation
m
it should work in rosetta mode and in pure M1 mode. But that does look like maybe you have an old library
running
pact-go install -f
should force install the latest version
r
@Yousaf Nabi (pactflow.io) I’m still on an Intel Mac.
Doesn’t help. I ran these 2 commands directly one after the other:
Copy code
$ pact-go -l DEBUG install -f
2022/12/07 15:04:09 [INFO] downloading library from <https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.3.2/libpact_ffi-osx-x86_64.dylib.gz> to /usr/local/lib/libpact_ffi.dylib
&{}
2022/12/07 15:04:11 [DEBUG] obtaining hash for file /usr/local/lib/libpact_ffi.dylib
2022/12/07 15:04:11 [DEBUG] writing config {map[libpact_ffi:{libpact_ffi 0.3.2 d6503769896eecbc027815d20aff19c3}]}
2022/12/07 15:04:11 [DEBUG] writing yaml config to file libraries:
  libpact_ffi:
    libname: libpact_ffi
    version: 0.3.2
    hash: d6503769896eecbc027815d20aff19c3

2022/12/07 15:04:11 [INFO] setting install_name on library libpact_ffi for osx
2022/12/07 15:04:16 [DEBUG] output from command []
2022/12/07 15:04:16 [INFO] package libpact_ffi found
2022/12/07 15:04:16 [INFO] checking version 0.3.2 of libpact_ffi against semver constraint >= 0.3.0, < 1.0.0
2022/12/07 15:04:16 [DEBUG] 0.3.2 satisfies constraints 0.3.2 >= 0.3.0, < 1.0.0
2022/12/07 15:04:16 [INFO] package libpact_ffi is correctly installed
2022/12/07 15:04:16 [DEBUG] skip checking ffi version() call because FFI not loaded. This is expected when running the 'pact-go' command.
Time: 0h:00m:07s                                                                                                                                                                                                                                                                                       

$ go test -v .
# <http://github.com/ringods/pulumi-pact-poc.test|github.com/ringods/pulumi-pact-poc.test>
/usr/local/Cellar/go/1.19.3/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: -no_pie is deprecated when targeting new OS versions
Undefined symbols for architecture x86_64:
  "_pactffi_verifier_add_provider_transport", referenced from:
      __cgo_6fba9656f5d3_Cfunc_pactffi_verifier_add_provider_transport in 000004.o
     (maybe you meant: __cgo_6fba9656f5d3_Cfunc_pactffi_verifier_add_provider_transport)
  "_pactffi_verifier_set_no_pacts_is_error", referenced from:
      __cgo_6fba9656f5d3_Cfunc_pactffi_verifier_set_no_pacts_is_error in 000004.o
     (maybe you meant: __cgo_6fba9656f5d3_Cfunc_pactffi_verifier_set_no_pacts_is_error)
  "_pactffi_with_header_v2", referenced from:
      __cgo_6fba9656f5d3_Cfunc_pactffi_with_header_v2 in 000003.o
     (maybe you meant: __cgo_6fba9656f5d3_Cfunc_pactffi_with_header_v2)
  "_pactffi_with_query_parameter_v2", referenced from:
      __cgo_6fba9656f5d3_Cfunc_pactffi_with_query_parameter_v2 in 000003.o
     (maybe you meant: __cgo_6fba9656f5d3_Cfunc_pactffi_with_query_parameter_v2)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

FAIL    <http://github.com/ringods/pulumi-pact-poc|github.com/ringods/pulumi-pact-poc> [build failed]
FAIL
Time: 0h:00m:05s
For your information:
Copy code
$ ls -lsa /usr/local/lib/libpact_ffi.dylib
43392 -rw-------  1 ringods  staff  22214200  7 Dec 15:04 /usr/local/lib/libpact_ffi.dylib
y
🤔 hmmm weird! It has downloaded the correct x86_64 binary for the intel platform, but this line here
/usr/local/Cellar/go/1.19.3/libexec/pkg/tool/darwin_amd64/link
shows
darwin_amd64
I've had it running on my m1 mac, I've got an intel mac (although it's a hackintosh) will test on there today at some point (might take a little while, as I haven't used the machine in quite a while) Which version of
pact-go
are you using? The pact ffi version is
0.3.2
- Pact-go on v2.0.0-beta.16 https://github.com/pact-foundation/pact-go/releases/tag/v2.0.0-beta.16 is using
0.3.15
Copy code
❯ go version
go version go1.19.3 darwin/arm64
Just pulled the latest pact-go to install the latest binary on my m1, had to sudo as install doesn't have perms to write to
/usr/local/lib
Running your POC on the m1 👍
So I think the issue is your FFI lib is too old https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.3.2 latest is https://github.com/pact-foundation/pact-reference/releases?q=%22Pact+FFI+Library%22&amp;expanded=true quite a few changes, not sure these should have all gone under patch tho 🤔
r
Copy code
$ pact-go version
Pact Go CLI v2.0.0-beta.11%
with pact-go on beta17, reinstalling the ffi lib, it indeed gives a better outcome! Tnx for the help!
🙌 2
y
awesome good news buddy, best of luck!
m
Thanks for your help Yousaf, and sorry for the pain Ringo - when in doubt, upgrade 😛
🙌 1