docopt / docopts

Shell interpreter for docopt, the command-line interface description language.
Other
501 stars 53 forks source link

get_docopts.sh does not support macOS ARM #58

Open stephenchu opened 2 years ago

stephenchu commented 2 years ago

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.

Sylvain303 commented 2 years ago

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.

donovanbai-dd commented 2 years ago

I can confirm the binary is working on my M1 mac

Sylvain303 commented 2 years ago

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.