docopts icon indicating copy to clipboard operation
docopts copied to clipboard

get_docopts.sh does not support macOS ARM

Open stephenchu opened this issue 4 years ago • 3 comments

It is due to the pre-built binaries don't have a "darwin" and "arm", I think.

Since M1 macs are out for a while now, do you think the pre-built binary releases can support a new "darwin" "arm" download? Thanks.

stephenchu avatar Apr 13 '22 07:04 stephenchu

Hello @stephenchu,

As you may have guessed, I'm not a mac user. Could you give me more details?

The build and pre-build is automated. I can try a cross-compile for your OS and ARCH.

Will you be able to install a golang build environment on you mac? So we could test together how it works.

I didn't look at the pre-build binaries steps for a while. I see some commented line in the Makefile

# build for OSX
docopts-OSX: docopts.go
   env GOOS=darwin go build -o docopts-OSX docopts.go

So I did:

GOOS=darwin GOARCH=arm64 go build -o docopts-arm64-OSX docopts.go

It's compiled from master branch, base64 encoded:

docopts-arm64-OSX.txt

File signature is of the original binary before base64 encoding is:

md5sum docopts-arm64-OSX
8120da3c7138a63f0e8e928e5b4e2aac  docopts-arm64-OSX

You can get back the compiled binary from:

EDIT (added a command to visually check md5 signature)

$ base64 -d < docopts-arm64-OSX.txt > docopts-arm64-OSX
$ chmod a+x ./docopts-arm64-OSX
# verify signature
$ md5sum docopts-arm64-OSX
8120da3c7138a63f0e8e928e5b4e2aac  docopts-arm64-OSX

tell me is it works.

Regards, Sylvain.

Sylvain303 avatar Apr 15 '22 09:04 Sylvain303

I can confirm the binary is working on my M1 mac

donovanbai-dd avatar Jul 12 '22 01:07 donovanbai-dd

Thanks @donovanbai-dd

I will add this target to the release script. And republish the latest release.

Will it will be done, I will close the issue.

Sylvain303 avatar Jul 21 '22 06:07 Sylvain303