hyperledger/fabric-ca

Problem building fabric-ca-client on arm64

jmcshane opened this issue · 1 comments

It appears that there are some architecture conflicts here:

% make fabric-ca-client
# golang.org/x/sys/unix
vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go:27:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go:40:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go:28:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go:43:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go:59:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go:75:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go:90:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go:105:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go:121:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go:121:3: too many errors

I can definitely help resolve these, but would need some help to get into the code here. Can you advise as to why these arch dependencies would exist?

My environment:
GOARCH="arm64"
GOOS="darwin"
GOVERSION="go1.18.2"
CGO_ENABLED="1"

I was able to get it to build by doing the following:

go get -u golang.org/x/sys
go mod vendor
make fabric-ca-client

It appears recent work was done to upgrade golang to v1.18. Would it be acceptable to update the vendored sys/unix package in a PR?