Comments (4)
@lgierth @ligi If you specify a full import path, xgo will try to download it and all deps from the internet. The reason behind this decision was to allow reproducible builds that are not sensitive on some local dependency having a different version, causing weird failures.
However, xgo does have support for building local stuff, but it has to be pointed to it using a relative or absolute path, not an import path.
If the path is not a canonical import path, but rather a local path (starts with a dot . or a dash /), xgo will use the local GOPATH contents for the cross compilation.
$ mkdir /tmp/workspace
$ cd /tmp/workspace/
$ export GOPATH=/tmp/workspace/
$ export PATH=$GOPATH/bin:$PATH
$ go get -d github.com/ipfs/go-ipfs
$ cd $GOPATH/src/github.com/ipfs/go-ipfs
$ make toolkit_upgrade
$ make deps
$ xgo --targets=android-23/* ./cmd/ipfs
$ ls -al
-rwxr-xr-x 1 root root 27820792 May 3 14:43 ipfs-android-23-386
drwxr-xr-x 3 root root 4096 May 3 14:44 ipfs-android-23-aar
-rwxr-xr-x 1 root root 27458756 May 3 14:42 ipfs-android-23-arm
-rwxr-xr-x 1 root root 36925472 May 3 14:44 ipfs-android-23-arm64
from xgo.
@ligi did you make deps
?
@karalabe I'm wildly guessing because I've never used xgo -- does it respect GOPATH? The output looks like it downloads its own copy of the package(s), which breaks gx's non-go-get package management.
@whyrusleeping have a look -- this might be solved by gx-go rewrite --undo
.
from xgo.
@karalabe thanks for the info & your work! Closing this issue then as this seems to be a feature and no bug
from xgo.
Ah yes that makes a lot of sense, thanks @karalabe
from xgo.
Related Issues (20)
- Handle ellipsis (cmd/...) syntax for producing multiple distinct programs HOT 2
- Cleanup leftover docker containers on main process kill
- Outside project not in GOPATH can't use go mod with build tags -mod=vendor
- Using with libgit2 (git2go) HOT 1
- How to set go env `GOPROXY=https://goproxy.cn,direct` in the docker container? HOT 1
- Provide precompiled binary on gh-action
- [Feature Request] Support building MSI
- Can't cross-compile a project because of the need for Go 1.14. Is this project still in development?
- Zig equivalent
- How do I set CGO_CFLAGS?
- compile gon2n error
- No $GOPATH is set or forwarded to xgo HOT 1
- Is this project dead? HOT 1
- Upgrade to Go 1.16 (latest) HOT 2
- provide additional header files HOT 1
- Windows binaries silently fail to execute
- Stable release? HOT 2
- Support for go1.16 HOT 1
- C/C++ equivalent?
- Windows 10 Defender flags exe as trojan HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xgo.