{"id":13567663,"url":"https://github.com/techknowlogick/xgo","last_synced_at":"2026-02-10T01:12:06.693Z","repository":{"id":34958677,"uuid":"170704360","full_name":"techknowlogick/xgo","owner":"techknowlogick","description":"Go CGO cross compiler","archived":false,"fork":false,"pushed_at":"2026-02-09T22:17:04.000Z","size":922,"stargazers_count":542,"open_issues_count":31,"forks_count":84,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-09T23:15:00.957Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"karalabe/xgo","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techknowlogick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"techknowlogick"}},"created_at":"2019-02-14T14:29:52.000Z","updated_at":"2026-02-07T19:53:39.000Z","dependencies_parsed_at":"2023-09-23T14:34:55.238Z","dependency_job_id":"debaeb78-1d51-4fb9-b14a-e64043677761","html_url":"https://github.com/techknowlogick/xgo","commit_stats":{"total_commits":392,"total_committers":42,"mean_commits":9.333333333333334,"dds":0.7040816326530612,"last_synced_commit":"313dedef864f13792340a15b3e825be9cdbbdbc3"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/techknowlogick/xgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fxgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fxgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fxgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fxgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techknowlogick","download_url":"https://codeload.github.com/techknowlogick/xgo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Fxgo/sbom","scorecard":{"id":294780,"data":{"date":"2025-08-11","repo":{"name":"github.com/techknowlogick/xgo","commit":"5180ad15e81b2eb2f677bd2cedf7698566dea328"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"name":"Maintained","score":7,"reason":"8 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 1/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/build_images.yml:13","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/cron_generate_pr.yml:14","Warn: no topLevel permission defined: .github/workflows/build_images.yml:1","Warn: no topLevel permission defined: .github/workflows/cron_generate_pr.yml:1","Warn: no topLevel permission defined: .github/workflows/test_pr.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/build_images.yml:10"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build_images.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:92: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:110: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build_images.yml:122: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/build_images.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cron_generate_pr.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/cron_generate_pr.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cron_generate_pr.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/cron_generate_pr.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test_pr.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/test_pr.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test_pr.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/test_pr.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test_pr.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/test_pr.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test_pr.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/techknowlogick/xgo/test_pr.yml/main?enable=pin","Warn: containerImage not pinned by hash: docker/build/Dockerfile:6","Warn: containerImage not pinned by hash: docker/go-1.24.6/Dockerfile:2","Warn: containerImage not pinned by hash: docker/go-1.24.x/Dockerfile:2","Warn: containerImage not pinned by hash: docker/go-1.25.0/Dockerfile:2","Warn: containerImage not pinned by hash: docker/go-1.25.x/Dockerfile:2","Warn: containerImage not pinned by hash: docker/go-latest/Dockerfile:2: pin your Docker image by updating techknowlogick/xgo:go-1.25.x to techknowlogick/xgo:go-1.25.x@sha256:bf83743069bd1b2ed2580466e1229c8c4a07cb82a3782991676873278e4bbbcf","Warn: containerImage not pinned by hash: docker/toolchain/Dockerfile:7: pin your Docker image by updating ubuntu:24.04 to ubuntu:24.04@sha256:7c06e91f61fa88c08cc74f7e1b7c69ae24910d745357e0dfe1d2c0322aaf20f9","Warn: goCommand not pinned by hash: docker/toolchain/bootstrap_pure.sh:31","Warn: pipCommand not pinned by hash: .github/workflows/cron_generate_pr.yml:24","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  12 third-party GitHubAction dependencies pinned","Info:   0 out of   7 containerImage dependencies pinned","Info:  20 out of  21 goCommand dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}}]},"last_synced_at":"2025-08-17T19:12:04.482Z","repository_id":34958677,"created_at":"2025-08-17T19:12:04.482Z","updated_at":"2025-08-17T19:12:04.482Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29287940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"ssl_error","status_checked_at":"2026-02-09T21:57:11.537Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-08-01T13:02:38.350Z","updated_at":"2026-02-10T01:12:06.647Z","avatar_url":"https://github.com/techknowlogick.png","language":"Shell","funding_links":["https://github.com/sponsors/techknowlogick","https://github.com/sponsors/techknowlogick/"],"categories":["Shell"],"sub_categories":[],"readme":"# xgo - Go CGO cross compiler\n\nAlthough Go strives to be a cross platform language, cross compilation from one\nplatform to another is not as simple as it could be, as you need the Go sources\nbootstrapped to each platform and architecture.\n\nThe first step towards cross compiling was Dave Cheney's [golang-crosscompile](https://github.com/davecheney/golang-crosscompile)\npackage, which automatically bootstrapped the necessary sources based on your\nexisting Go installation. Although this was enough for a lot of cases, certain\ndrawbacks became apparent where the official libraries used CGO internally: any\ndependency to third party platform code is unavailable, hence those parts don't\ncross compile nicely (native DNS resolution, system certificate access, etc).\n\nA step forward in enabling cross compilation was Alan Shreve's [gonative](https://github.com/inconshreveable/gonative)\npackage, which instead of bootstrapping the different platforms based on the\nexisting Go installation, downloaded the official pre-compiled binaries from the\ngolang website and injected those into the local toolchain. Since the pre-built\nbinaries already contained the necessary platform specific code, the few missing\ndependencies were resolved, and true cross compilation could commence... of pure\nGo code.\n\nHowever, there was still one feature missing: cross compiling Go code that used\nCGO itself, which isn't trivial since you need access to OS specific headers and\nlibraries. This becomes very annoying when you need access only to some trivial\nOS specific functionality (e.g. query the CPU load), but need to configure and\nmaintain separate build environments to do it.\n\n## Enter xgo\n\nMy solution to the challenge of cross compiling Go code with embedded C/C++ snippets\n(i.e. CGO_ENABLED=1) is based on the concept of [lightweight Linux containers](http://en.wikipedia.org/wiki/LXC).\nAll the necessary Go tool-chains, C cross compilers and platform headers/libraries\nhave been assembled into a single Docker container, which can then be called as if\na single command to compile a Go package to various platforms and architectures.\n\n## Supporters\n\nThanks to the following projects for supporting XGO\n\n* [Gitea](https://gitea.io/) - A painless self-hosted Git service.\n* [Offen](https://www.offen.dev/) - The fair and lightweight alternative to common web analytics tools.\n* [Vikunja](https://vikunja.io/) - The to-do app to organize your life.\n* [Woodpecker CI](https://woodpecker-ci.org/) - Woodpecker is a simple CI engine with great extensibility.\n\nYou too can [sponsor](https://github.com/sponsors/techknowlogick/) this project to ensure its continued maintenance.\n\n## Installation\n\nAlthough you could build the container manually, it is available as an automatic\ntrusted build from Docker's container registry (not insignificant in size):\n\n    docker pull techknowlogick/xgo:latest\n\nTo prevent having to remember a potentially complex Docker command every time,\na lightweight Go wrapper was written on top of it.\n\n    go get src.techknowlogick.com/xgo\n\nFor go \u003e= 1.17, `go get` is deprecated, so you'll have to use this command:\n    \n    go install src.techknowlogick.com/xgo@latest\n\n## Usage\n\nSimply specify the import path you want to build, and xgo will do the rest:\n\n    $ xgo github.com/project-iris/iris\n    ...\n\n    $ ls -al\n    -rwxr-xr-x  1 root  root    6776500 Nov 24 16:44 iris-darwin-10.6-386\n    -rwxr-xr-x  1 root  root    8755532 Nov 24 16:44 iris-darwin-10.6-amd64\n    -rwxr-xr-x  1 root  root   10135248 Nov 24 16:44 iris-linux-386\n    -rwxr-xr-x  1 root  root   12598472 Nov 24 16:44 iris-linux-amd64\n    -rwxr-xr-x  1 root  root   10040464 Nov 24 16:44 iris-linux-arm\n    -rwxr-xr-x  1 root  root    7516368 Nov 24 16:44 iris-windows-4.0-386.exe\n    -rwxr-xr-x  1 root  root    9549416 Nov 24 16:44 iris-windows-4.0-amd64.exe\n\n\nIf the path is not a canonical import path, but rather a local path (starts with\na dot `.` or a dash `/`), xgo will use the local GOPATH contents for the cross\ncompilation.\n\n\n### Build flags\n\nA handful of flags can be passed to `go build`. The currently supported ones are\n\n  - `-v`: prints the names of packages as they are compiled\n  - `-x`: prints the build commands as compilation progresses\n  - `-race`: enables data race detection (supported only on amd64, rest built without)\n  - `-tags='tag list'`: list of build tags to consider satisfied during the build\n  - `-ldflags='flag list'`: arguments to pass on each go tool link invocation\n  - `-gcflags='flag list'`: arguments to pass on each go tool compile invocation\n  - `-buildmode=mode`: binary type to produce by the compiler\n\n\n### Go releases\n\nAs newer versions of the language runtime, libraries and tools get released,\nthese will get incorporated into xgo too as extensions layers to the base cross\ncompilation image (only Go 1.13 and above will be supported).\n\nYou can select which Go release to work with through the `-go` command line flag\nto xgo and if the specific release was already integrated, it will automatically\nbe retrieved and installed.\n\n    $ xgo -go go-1.13.2 github.com/project-iris/iris\n\nAdditionally, a few wildcard release strings are also supported:\n\n  - `latest` will use the latest Go release (this is the default)\n  - `go-1.13.x` will use the latest point release of a specific Go version\n\n### Output prefixing\n\nxgo by default uses the name of the package being cross compiled as the output\nfile prefix. This can be overridden with the `-out` flag.\n\n    $ xgo -out iris-v0.3.2 github.com/project-iris/iris\n    ...\n\n    $ ls -al\n    -rwxr-xr-x  1 root  root   6776500 Nov 24 16:44 iris-v0.3.2-darwin-10.6-386\n    -rwxr-xr-x  1 root  root   8755532 Nov 24 16:44 iris-v0.3.2-darwin-10.6-amd64\n    -rwxr-xr-x  1 root  root  10135248 Nov 24 16:44 iris-v0.3.2-linux-386\n    -rwxr-xr-x  1 root  root  12598472 Nov 24 16:44 iris-v0.3.2-linux-amd64\n    -rwxr-xr-x  1 root  root  10040464 Nov 24 16:44 iris-v0.3.2-linux-arm\n    -rwxr-xr-x  1 root  root   7516368 Nov 24 16:44 iris-v0.3.2-windows-4.0-386.exe\n    -rwxr-xr-x  1 root  root   9549416 Nov 24 16:44 iris-v0.3.2-windows-4.0-amd64.exe\n\n\n### Branch selection\n\nSimilarly to `go get`, xgo also uses the `master` branch of a repository during\nsource code retrieval. To switch to a different branch before compilation pass\nthe desired branch name through the `--branch` argument.\n\n    $ xgo --branch release-branch.go1.4 golang.org/x/tools/cmd/goimports\n    ...\n\n    $ ls -al\n    -rwxr-xr-x  1 root  root   4139868 Nov 24 16:40 goimports-darwin-10.6-386\n    -rwxr-xr-x  1 root  root   5186720 Nov 24 16:40 goimports-darwin-10.6-amd64\n    -rwxr-xr-x  1 root  root   4189456 Nov 24 16:40 goimports-linux-386\n    -rwxr-xr-x  1 root  root   5264136 Nov 24 16:40 goimports-linux-amd64\n    -rwxr-xr-x  1 root  root   4209416 Nov 24 16:40 goimports-linux-arm\n    -rwxr-xr-x  1 root  root   4348416 Nov 24 16:40 goimports-windows-4.0-386.exe\n    -rwxr-xr-x  1 root  root   5415424 Nov 24 16:40 goimports-windows-4.0-amd64.exe\n\n\n### Remote selection\n\nYet again similarly to `go get`, xgo uses the repository remote corresponding to\nthe import path being built. To switch to a different remote while preserving the\noriginal import path, use the `--remote` argument.\n\n    $ xgo --remote github.com/golang/tools golang.org/x/tools/cmd/goimports\n    ...\n\n### Package selection\n\nIf you used the above *branch* or *remote* selection machanisms, it may happen\nthat the path you are trying to build is only present in the specific branch and\nnot the default repository, causing Go to fail at locating it. To circumvent this,\nyou may specify only the repository root for xgo, and use an additional `--pkg`\nparameter to select the exact package within, honoring any prior *branch* and\n*remote* selections.\n\n    $ xgo --pkg cmd/goimports golang.org/x/tools\n    ...\n\n    $ ls -al\n    -rwxr-xr-x  1 root  root   4164448 Nov 24 16:38 goimports-darwin-10.6-386\n    -rwxr-xr-x  1 root  root   5223584 Nov 24 16:38 goimports-darwin-10.6-amd64\n    -rwxr-xr-x  1 root  root   4217184 Nov 24 16:38 goimports-linux-386\n    -rwxr-xr-x  1 root  root   5295768 Nov 24 16:38 goimports-linux-amd64\n    -rwxr-xr-x  1 root  root   4233120 Nov 24 16:38 goimports-linux-arm\n    -rwxr-xr-x  1 root  root   4373504 Nov 24 16:38 goimports-windows-4.0-386.exe\n    -rwxr-xr-x  1 root  root   5450240 Nov 24 16:38 goimports-windows-4.0-amd64.exe\n\nThis argument may at some point be integrated into the import path itself, but for\nnow it exists as an independent build parameter. Also, there is not possibility\nfor now to build mulitple commands in one go.\n\n### Limit build targets\n\nBy default `xgo` will try and build the specified package to all platforms and\narchitectures supported by the underlying Go runtime. If you wish to restrict\nthe build to only a few target systems, use the comma separated `--targets` CLI\nargument:\n\n  * `--targets=linux/arm`: builds only the ARMv5 Linux binaries (`arm-6`/`arm-7` allowed)\n  * `--targets=windows/*,darwin/*`: builds all Windows and OSX binaries\n  * `--targets=*/arm`: builds ARM binaries for all platforms\n  * `--targets=*/*`: builds all suppoted targets (default)\n\nThe supported targets are:\n\n * Platforms: `darwin`, `linux`, `windows`\n * Achitectures: `386`, `amd64`, `arm-5`, `arm-6`, `arm-7`, `arm64`, `mips`, `mipsle`, `mips64`, `mips64le`, `riscv64`\n\n### Platform versions\n\nBy default `xgo` tries to cross compile to the lowest possible versions of every\nsupported platform, in order to produce binaries that are portable among various\nversions of the same operating system. This however can lead to issues if a used\ndependency is only supported by more recent systems. As such, `xgo` supports the\nselection of specific platform versions by appending them to the OS target string.\n\n * `--targets=darwin-10.9/*`: cross compile to Mac OS X Mavericks\n * `--targets=windows-6.0/*`: cross compile to Windows Vista\n\nThe supported platforms are:\n\n * All Windows APIs up to Windows 8.1 limited by `mingw-w64` ([API level ids](https://en.wikipedia.org/wiki/Windows_NT#Releases))\n * OSX APIs in the range of 10.6 - 10.14\n\n### CGO dependencies\n\nThe main differentiator of xgo versus other cross compilers is support for basic\nembedded C/C++ code and target-platform specific OS SDK availability. The current\nxgo release introduces an experimental CGO *dependency* cross compilation, enabling\nbuilding Go programs that require external C/C++ libraries.\n\nIt is assumed that the dependent C/C++ library is `configure/make` based, was\nproperly prepared for cross compilation and is available as a tarball download\n(`.tar`, `.tar.gz` or `.tar.bz2`). Further plans include extending this to cmake\nbased projects, if need arises (please open an issue if it's important to you).\n\nSuch dependencies can be added via the `--deps` argument. They will be retrieved\nprior to starting the cross compilation and the packages cached to save bandwidth\non subsequent calls.\n\nA complex sample for such a scenario is building the Ethereum CLI node, which has\nthe GNU Multiple Precision Arithmetic Library as it's dependency.\n\n    $ xgo --deps=https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2  \\\n        --targets=windows/* github.com/ethereum/go-ethereum/cmd/geth\n    ...\n\n    $ ls -al\n    -rwxr-xr-x 1 root root 16315679 Nov 24 16:39 geth-windows-4.0-386.exe\n    -rwxr-xr-x 1 root root 19452036 Nov 24 16:38 geth-windows-4.0-amd64.exe\n\nSome trivial arguments may be passed to the dependencies' configure script via\n`--depsargs`.\n\n    $ xgo --deps=https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2  \\\n        --targets=ios/* --depsargs=--disable-assembly               \\\n        github.com/ethereum/go-ethereum/cmd/geth\n    ...\n\n    $ ls -al\n    -rwxr-xr-x 1 root root 14804160 Nov 24 16:32 geth-ios-5.0-arm\n\nNote, that since xgo needs to cross compile the dependencies for each platform\nand architecture separately, build time can increase significantly.\n\n### Hooks\n\nTo give the user more power, xgo provides two hook scripts which will be sourced\nduring the build if they are available in a provided hooks directory (provided\nby the `--hooksdir` argument, which mounts that directory into the container).\nThe first one is `setup.sh` which will be sourced after everything is set up.\nThis script can e.g. be used to install additional packages in the container.\nThe second is `build.sh` which will be sourced for each target (before the\nactual build process).\n\nAll environment variables set up by xgo are available in the scripts.\n\nWithin `build.sh` there are several target specific environment variables:\n\n* `XGOOS` and `XGOARCH` are expanded to the actual value defined by the [build targets](#limit-build-targets).\n* `CC`: C cross compiler to use for the build\n* `HOST`: Target platform to build\n* `PREFIX`: File-system path where to install the built binaries.\n\nFor further reference, see [build.sh](docker/base/build.sh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechknowlogick%2Fxgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechknowlogick%2Fxgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechknowlogick%2Fxgo/lists"}