From 5f21f627d6141280db1c67fc7289d80929173be6 Mon Sep 17 00:00:00 2001 From: Matt Fellows Date: Thu, 11 Mar 2021 17:38:10 +1100 Subject: [PATCH] chore: hard code OSX paths to /opt/pact for now --- v3/installer/installer.go | 12 +++++++----- v3/internal/native/mock_server/mock_server.go | 1 - v3/internal/native/mock_server/mock_server_darwin.go | 2 +- v3/internal/native/verifier/verifier_darwin.go | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/v3/installer/installer.go b/v3/installer/installer.go index 20a19fc3c..19cd40d4f 100644 --- a/v3/installer/installer.go +++ b/v3/installer/installer.go @@ -14,8 +14,10 @@ import ( getter "github.com/hashicorp/go-getter" goversion "github.com/hashicorp/go-version" + // can't use these packages, because then the CLI installer wouldn't work - go won't run without it! + // "github.com/pact-foundation/pact-go/v3/internal/native/verifier" // mockserver "github.com/pact-foundation/pact-go/v3/internal/native/mock_server" - // verifier "github.com/pact-foundation/pact-go/v3/internal/native/verifier" + "github.com/spf13/afero" ) @@ -125,7 +127,7 @@ func (i *Installer) checkPackageInstall() error { return err } - // if err := checkVersion(info.testCommand(), info.libName, info.semverRange); err != nil { + // if err := checkVersion(info.libName, info.testCommand(), info.semverRange); err != nil { // return err // } } @@ -255,15 +257,15 @@ var packages = map[string]packageInfo{ verifierPackage: { libName: "libpact_verifier_ffi", version: "0.0.2", - semverRange: ">= 0.8.3, < 1.0.0", + semverRange: ">= 0.0.2, < 1.0.0", // testCommand: func() string { // return (&verifier.Verifier{}).Version() // }, }, mockServerPackage: { libName: "libpact_mock_server_ffi", - version: "0.0.14", - semverRange: ">= 0.0.14, < 1.0.0", + version: "0.0.15", + semverRange: ">= 0.0.15, < 1.0.0", // testCommand: func() string { // return mockserver.Version() // }, diff --git a/v3/internal/native/mock_server/mock_server.go b/v3/internal/native/mock_server/mock_server.go index 2d19fad0c..08f2638fc 100644 --- a/v3/internal/native/mock_server/mock_server.go +++ b/v3/internal/native/mock_server/mock_server.go @@ -230,7 +230,6 @@ func GetTLSConfig() *tls.Config { // Version returns the current semver FFI interface version func Version() string { v := C.version() - defer libRustFree(v) return C.GoString(v) } diff --git a/v3/internal/native/mock_server/mock_server_darwin.go b/v3/internal/native/mock_server/mock_server_darwin.go index 81969b719..b528df546 100644 --- a/v3/internal/native/mock_server/mock_server_darwin.go +++ b/v3/internal/native/mock_server/mock_server_darwin.go @@ -1,7 +1,7 @@ package mock_server /* -#cgo LDFLAGS: -v ${SRCDIR}/../../../../libs/libpact_mock_server_ffi.dylib +#cgo LDFLAGS: -v /opt/pact/libpact_mock_server_ffi.dylib // NOTE: have to rename the id in the library using this command: diff --git a/v3/internal/native/verifier/verifier_darwin.go b/v3/internal/native/verifier/verifier_darwin.go index 40f0a9ba8..880e1c3be 100644 --- a/v3/internal/native/verifier/verifier_darwin.go +++ b/v3/internal/native/verifier/verifier_darwin.go @@ -1,7 +1,7 @@ package verifier /* -#cgo LDFLAGS: ${SRCDIR}/../../../../libs/libpact_verifier_ffi.dylib +#cgo LDFLAGS: -v /opt/pact/libpact_verifier_ffi.dylib // Library headers typedef int bool;