Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-built Go binaries #12

Closed
denisidoro opened this issue Jun 11, 2018 · 11 comments
Closed

Pre-built Go binaries #12

denisidoro opened this issue Jun 11, 2018 · 11 comments

Comments

@denisidoro
Copy link

I'm currently trying to use https://github.com/Sylvain303/docopts and I'd like to know if someone can provide pre-built binaries for OSX and ARM
Thanks

@Sylvain303
Copy link
Collaborator

Hi @denisidoro

Do you have OSX ARM hardware available?
Is it 2 binaries OSX and ARM?
or is it an OSX running on ARM CPU?

Would you like 32bits or 64bits binary?

@Sylvain303
Copy link
Collaborator

@denisidoro is seems quite easy to build with go :-)

With branch: https://github.com/Sylvain303/docopts/tree/docopts-go

Not tested.

Expiration : 2018-07-11
docopts-OSX
https://framadrop.org/r/GrgZEEYQGZ#+jFWDDNoVmcTaLaYVZUWdnMFMSQp9a+ckIMWq3f5RlU=

docopts-arm
https://framadrop.org/r/MolQK-Liet#SBRxCEmyDEjg0V0hgFsqkkfV1degNgtIgCAjssv1CMg=

copy and rename the file as you need.

Given a working go environment, it seems cross-compiling is trivial:

OSX:

env GOOS=darwin GOARCH=386 go build -o docopts-OSX docopts.go

arm:

env GOOS=linux GOARCH=arm go build -o docopts-arm docopts.go

built with:

go version
go version go1.10.1 linux/amd64

Tell me if it works.
Regards.

@denisidoro
Copy link
Author

Thank you for the quick response!
Could you also compile for Android ARM?
I intend to use it with Termux

I tried compiling it with

env GOOS=android GOARCH=arm go build docopts.go

but it failed because /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1

I tried with gomobile as well but couldn't find out the correct command.

Also, it would be nice to add this command to some package managers! (apt, homebrew, etc)
Do you plan to do so?

@Sylvain303
Copy link
Collaborator

nope. As it, the compilation fail:

$ env GOOS=android GOARCH=arm go build -o docopts-android docopts.go
# command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
gcc: error: unrecognized command line option ‘-marm’; did you mean ‘-mabm’?

Don't hesitate to ask for help toward your local mobile developer, Linux User Group, or what ever skilled people you may reach easily.

I will ask on my side.

About packaging…
It would probably come. I will do the debian package when the soft will be ready.

I will attach some pre-built version with each release at first. Now I can add OSX and arm like a charm.
I added a Makefile to build all 4 versions.

@denisidoro denisidoro changed the title Pre-built Go binary for OSX and ARM Pre-built Go binaries Jun 12, 2018
@denisidoro
Copy link
Author

Maybe this can help: junegunn/fzf@28ffb96

@Sylvain303
Copy link
Collaborator

@denisidoro Thanks! Pretty interesting, I will look at it how I can apply it to build docopts release.

Did you try to hack this Dockerfile?

@Sylvain303
Copy link
Collaborator

I did not test the cross-compile to android yet.
@denisidoro did you try something like: http://rafalgolarz.com/blog/2017/01/15/running_golang_on_android/
I've no android, I can't test it.

@Sylvain303
Copy link
Collaborator

OK I tried: https://github.com/karalabe/xgo

$ xgo github.com/Sylvain303/docopts
Checking docker installation...
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.6.2
 Git commit:   092cba3
 Built:        Thu Nov  2 20:40:23 2017
 OS/Arch:      linux/amd64
 Experimental: false

Checking for required docker image karalabe/xgo-latest... found.
Cross compiling github.com/Sylvain303/docopts...
Fetching main repository github.com/Sylvain303/docopts...
github.com/Sylvain303/docopts (download)
github.com/docopt/docopt-go (download)
...

attached as a text file.

use this command to decode:

base64 -d docopts-android-16-arm.base64.txt > docopts-android-16-arm

docopts-android-16-arm.base64.txt

Not tested.

@denisidoro
Copy link
Author

denisidoro commented Jun 15, 2019

Sorry for reviving this thread after so much time, but could you please reupload the binaries? I'm afraid I lost them :/

In any case, I'll try to recompile them in the meantime

@denisidoro denisidoro reopened this Jun 15, 2019
@denisidoro
Copy link
Author

denisidoro commented Jun 15, 2019

Nevermind: https://github.com/denisidoro/docopts/releases/tag/v0.6.3-alpha1

Additional helper script: in my dotfiles

@Sylvain303
Copy link
Collaborator

Sylvain303 commented Jun 16, 2019

Hi @denisidoro ,

Yes, far far away from the past. 😉

EDIT: The base64 binary link is still there, on my last post of 2018.

I added a new issue in the meantime: #32

OSX binaries are easy to produce, arm for android I did not test it, as written in this issue above.

You may contribute, by describing the process to test and build binaries for arm-android.

I can test and build for OSX via travis, or crosscompile from GNU/Linux.

It seems possible to build for android on travis, but I haven't any knowledge on that platform yet.

Thanks for your interest.
Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants