Gox

A dead simple, no frills Go cross compile tool

  • 所有者: mitchellh/gox
  • 平台:
  • 许可证: Mozilla Public License 2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Gox - Simple Go Cross Compilation

Gox is a simple, no-frills tool for Go cross compilation that behaves a
lot like standard go build. Gox will parallelize builds for multiple
platforms. Gox will also build the cross-compilation toolchain for you.

Installation

To install Gox, please use go get. We tag versions so feel free to
checkout that tag and compile.

$ go get github.com/mitchellh/gox
...
$ gox -h
...

Usage

If you know how to use go build, then you know how to use Gox. For
example, to build the current package, specify no parameters and just
call gox. Gox will parallelize based on the number of CPUs you have
by default and build for every platform by default:

$ gox
Number of parallel builds: 4

-->      darwin/386: github.com/mitchellh/gox
-->    darwin/amd64: github.com/mitchellh/gox
-->       linux/386: github.com/mitchellh/gox
-->     linux/amd64: github.com/mitchellh/gox
-->       linux/arm: github.com/mitchellh/gox
-->     freebsd/386: github.com/mitchellh/gox
-->   freebsd/amd64: github.com/mitchellh/gox
-->     openbsd/386: github.com/mitchellh/gox
-->   openbsd/amd64: github.com/mitchellh/gox
-->     windows/386: github.com/mitchellh/gox
-->   windows/amd64: github.com/mitchellh/gox
-->     freebsd/arm: github.com/mitchellh/gox
-->      netbsd/386: github.com/mitchellh/gox
-->    netbsd/amd64: github.com/mitchellh/gox
-->      netbsd/arm: github.com/mitchellh/gox
-->       plan9/386: github.com/mitchellh/gox

Or, if you want to build a package and sub-packages:

$ gox ./...
...

Or, if you want to build multiple distinct packages:

$ gox github.com/mitchellh/gox github.com/hashicorp/serf
...

Or if you want to just build for linux:

$ gox -os="linux"
...

Or maybe you just want to build for 64-bit linux:

$ gox -osarch="linux/amd64"
...

And more! Just run gox -h for help and additional information.

Versus Other Cross-Compile Tools

A big thanks to these other options for existing. They each paved the
way in many aspects to make Go cross-compilation approachable.

  • Dave Cheney's golang-crosscompile -
    Gox compiles for multiple platforms and can therefore easily run on
    any platform Go supports, whereas Dave's scripts require a shell. Gox
    will also parallelize builds. Dave's scripts build sequentially. Gox has
    much easier to use OS/Arch filtering built in.

  • goxc -
    A very richly featured tool that can even do things such as build system
    packages, upload binaries, generate download webpages, etc. Gox is a
    super slim alternative that only cross-compiles binaries. Gox builds packages in parallel, whereas
    goxc doesn't. Gox doesn't enforce a specific output structure for built
    binaries.

主要指标

概览
名称与所有者mitchellh/gox
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证Mozilla Public License 2.0
所有者活动
创建于2013-11-17 03:11:35
推送于2023-05-02 06:26:10
最后一次提交2022-06-30 21:42:38
发布数6
最新版本名称v1.0.1 (发布于 )
第一版名称v0.1.0 (发布于 )
用户参与
星数4.6k
关注者数81
派生数357
提交数128
已启用问题?
问题数108
打开的问题数48
拉请求数22
打开的拉请求数20
关闭的拉请求数22
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?