inconshreveable / gonative Goto Github PK
View Code? Open in Web Editor NEWBuild Go Toolchains /w native libs for cross-compilation
Build Go Toolchains /w native libs for cross-compilation
Does this works for the go projects using sqlite3? I tried to compile and got an error
15 errors occurred:
--> darwin/386 error: exit status 1
Stderr: sqlite3.go:13:2: C source files not allowed when not using cgo: sqlite3.c
--> darwin/amd64 error: exit status 1
Stderr: sqlite3.go:13:2: C source files not allowed when not using cgo: sqlite3.c
--> linux/386 error: exit status 1
Stderr: sqlite3.go:13:2: C source files not allowed when not using cgo: sqlite3.c
--> linux/arm error: exit status 1
Stderr: sqlite3.go:13:2: C source files not allowed when not using cgo: sqlite3.c
--> freebsd/amd64 error: exit status 1
Stderr: sqlite3.go:13:2: C source files not allowed when not using cgo: sqlite3.c
--> freebsd/386 error: exit status 1
Stderr: sqlite3.go:13:2: C source files not allowed when not using cgo: sqlite3.c
--> openbsd/386 error: exit status 1
Stderr: sqlite3.go:13:2: C source files not allowed when not using cgo: sqlite3.c
--> windows/386 error: exit status 1
Stderr: sqlite3.go:13:2: C source files not allowed when not using cgo: sqlite3.c
$ godep go install
# github.com/inconshreveable/axiom
../axiom/axiom.go:108: too few values in struct initializer
../axiom/axiom.go:109: too few values in struct initializer
../axiom/axiom.go:110: too few values in struct initializer
../axiom/axiom.go:231: too few values in struct initializer
../axiom/axiom.go:330: too few values in struct initializer
godep: go exit status 2
$ go version
go version go1.5.1 darwin/amd64
$ godep version
godep v3 (darwin/amd64/go1.5)
The current URL does not work for versions > 1.2.1 (fails for both 1.2.2 and 1.3beta1). This change seems to fix:
-const distUrl = "https://go.googlecode.com/files/go%s.%s.tar.gz"
+const distUrl = "https://storage.googleapis.com/golang/go%s.%s.tar.gz"
Don't manage to run the following command, it fails with 404, so I guess a wrong URL is being used somewhere...
Cheers!
gonative build -src=/home/ubuntu/cache/go '-platforms=windows_amd64 darwin_amd64 linux_amd64' -version=go1.4
INFO[01-23|10:05:28] building go version=go1.4 src=/home/ubuntu/cache/go target=/home/ubuntu/cache/gonative/go platforms="[{OS:windows Arch:amd64} {OS:darwin Arch:amd64} {OS:linux Arch:amd64}]"
INFO[01-23|10:05:28] start download plat=windows_amd64 url=https://storage.googleapis.com/golang/gogo1.4.windows-amd64.zip
INFO[01-23|10:05:28] start download plat=darwin_amd64 url=https://storage.googleapis.com/golang/gogo1.4.darwin-amd64-osx10.8.tar.gz
INFO[01-23|10:05:28] start download plat=linux_amd64 url=https://storage.googleapis.com/golang/gogo1.4.linux-amd64.tar.gz
INFO[01-23|10:05:29] cp -rp /home/ubuntu/cache/go /home/ubuntu/cache/gonative/go err=nil
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, linux/amd64.
lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
cmd/6a
cmd/6c
cmd/6g
runtime
errors
sync/atomic
sync
io
unicode
unicode/utf8
unicode/utf16
bytes
math
strings
strconv
bufio
sort
container/heap
encoding/base64
syscall
time
os
reflect
fmt
encoding
encoding/json
flag
path/filepath
path
io/ioutil
log
regexp/syntax
regexp
go/token
go/scanner
go/ast
go/parser
os/exec
os/signal
net/url
text/template/parse
text/template
go/doc
go/build
cmd/go
# Building packages and commands for linux/amd64.
runtime
errors
sync/atomic
unicode
sync
io
unicode/utf8
math
bytes
bufio
syscall
strconv
time
reflect
os
strings
fmt
encoding/binary
sort
regexp/syntax
cmd/internal/goobj
cmd/internal/rsc.io/arm/armasm
cmd/internal/rsc.io/x86/x86asm
debug/dwarf
debug/elf
debug/gosym
debug/macho
debug/pe
debug/plan9obj
regexp
text/tabwriter
flag
log
hash
crypto
cmd/internal/objfile
crypto/md5
go/token
path/filepath
go/scanner
cmd/addr2line
go/ast
io/ioutil
go/parser
go/printer
os/exec
path
cmd/cgo
go/format
cmd/fix
container/heap
encoding
encoding/base64
unicode/utf16
encoding/json
encoding/xml
net/url
text/template/parse
compress/flate
text/template
hash/crc32
compress/gzip
container/list
crypto/subtle
crypto/cipher
crypto/aes
go/doc
crypto/des
math/rand
go/build
math/big
crypto/hmac
internal/syscall
crypto/rc4
crypto/sha1
crypto/sha256
crypto/elliptic
encoding/asn1
crypto/rand
crypto/ecdsa
crypto/rsa
crypto/dsa
crypto/sha512
crypto/x509/pkix
encoding/hex
encoding/pem
runtime/cgo
mime
net/http/internal
os/signal
runtime/pprof
cmd/gofmt
net
cmd/nm
cmd/objdump
cmd/pack
crypto/x509
net/textproto
mime/multipart
crypto/tls
cmd/pprof/internal/profile
cmd/pprof/internal/plugin
html
html/template
net/http
cmd/pprof/internal/report
cmd/pprof/internal/svg
cmd/pprof/internal/tempfile
cmd/pprof/internal/commands
cmd/go
cmd/pprof/internal/driver
cmd/pprof/internal/fetch
cmd/pprof/internal/symbolizer
cmd/pprof/internal/symbolz
cmd/pprof
cmd/yacc
archive/tar
archive/zip
compress/bzip2
compress/lzw
hash/adler32
container/ring
database/sql/driver
compress/zlib
encoding/ascii85
database/sql
encoding/base32
encoding/csv
encoding/gob
expvar
hash/crc64
hash/fnv
image/color
image
image/color/palette
image/draw
image/jpeg
image/gif
image/png
index/suffixarray
log/syslog
math/cmplx
net/http/cgi
net/http/cookiejar
net/http/httptest
net/http/fcgi
net/http/httputil
net/http/pprof
net/mail
net/rpc
net/smtp
os/user
net/rpc/jsonrpc
runtime/debug
runtime/race
testing
testing/iotest
testing/quick
text/scanner
---
Installed Go for linux/amd64 in /home/ubuntu/cache/gonative/go
Installed commands in /home/ubuntu/cache/gonative/go/bin
INFO[01-23|10:06:18] boostraping go compilers
lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
cmd/6a
cmd/6c
cmd/6g
runtime
errors
sync/atomic
sync
io
unicode
unicode/utf8
unicode/utf16
bytes
math
strings
strconv
bufio
sort
container/heap
encoding/base64
syscall
time
os
reflect
fmt
encoding
encoding/json
flag
path/filepath
path
io/ioutil
log
regexp/syntax
regexp
go/token
go/scanner
go/ast
go/parser
os/exec
os/signal
net/url
text/template/parse
text/template
go/doc
go/build
cmd/go
runtime (windows/amd64)
lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
cmd/6a
cmd/6c
cmd/6g
runtime
errors
sync/atomic
sync
io
unicode
unicode/utf8
unicode/utf16
bytes
math
strings
strconv
bufio
sort
container/heap
encoding/base64
syscall
time
os
reflect
fmt
encoding
encoding/json
flag
path/filepath
path
io/ioutil
log
regexp/syntax
regexp
go/token
go/scanner
go/ast
go/parser
os/exec
os/signal
net/url
text/template/parse
text/template
go/doc
go/build
cmd/go
runtime (darwin/amd64)
lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
cmd/6a
cmd/6c
cmd/6g
runtime
errors
sync/atomic
sync
io
unicode
unicode/utf8
unicode/utf16
bytes
math
strings
strconv
bufio
sort
container/heap
encoding/base64
syscall
time
os
reflect
fmt
encoding
encoding/json
flag
path/filepath
path
io/ioutil
log
regexp/syntax
regexp
go/token
go/scanner
go/ast
go/parser
os/exec
os/signal
net/url
text/template/parse
text/template
go/doc
go/build
cmd/go
CRIT[01-23|10:06:50] command failed err="Bad response for download: 404"
Building Go 1.5+ from source requires that an existing 1.4 Go toolchain be on your machine and specified via the GOROOT_BOOTSTRAP
environment variable. gonative will fail if that's not supplied right now if you're building Go1.5+. Instead, if the env var is unspecified, gonative should download a Go 1.4 installation native to your platform and use that for the bootstrap process.
I am using gonative
and gox
to cross-compile an executable using os/user
. It has always been working, but it broke down when CircleCI upgraded their Golang to 1.5.1 I think. Now I am getting user: Current not implemented on darwin/amd64
from the cross-compiled executables. Any ideas what might be wrong now before I try to dive deep into Go 1.5 cross-compilation changes myself?
This may be more general, but I cannot create a successful build on 10.8 for 1.2.2 or 1.3beta1, using the standard OS X gcc (which I believe is actually clang), or gcc4.6 (from homebrew).
e.g.
$ make
/Users/untoldone/Source/go/src/github.com/inconshreveable/gonative/Godeps/_workspace/bin/godep restore
godep: open /Users/untoldone/Source/go/src/github.com/inconshreveable/gonative/Godeps/Godeps.json: no such file or directory
make: *** [workspace] Error 1
You could quickly use https://github.com/c4milo/unzipit for this. My two cents.
All of the unix-specific code has been replaced with Go now, so absent any differences in how Go bootstraps itself, gonative should start to work on Windows. Needs testing.
> go get -u github.com/inconshreveable/gonative
# github.com/inconshreveable/go-update
c:\Projects\golang\src\github.com\inconshreveable\go-update\update.go:116: import c:\Projects\golang\pkg\windows_amd64/bitbucket.org/kardianos/osext.a: object is [windows amd64 go1.3.3 X:precisestack] expected [windows amd64 go1.4 X:precisestack]
Hello,
You post a comment on some other issue saying gonative should be considered as deprecated
gonative is very, very old and almost certainly no longer necessary or the right way to do whatever it is that you're trying to do. i no longer use it and you should consider it a deprecated tool.
For my information, what are you using now for having a cross compiling toolchain ? Or what is the right way to do ?
Could gonative help in building Go binaries that target musl instead of glibc?
so if we use --version='1.4.2', gonative stop because it did not found freebsd package
jb@build:/usr/local/gonative$ ~/bin/gonative -version=1.3
Building go:
Version: 1.3
Source: (from internet)
Target: /usr/local/gonative
Platforms: [{linux 386} {linux amd64} {linux arm} {darwin 386} {darwin amd64} {windows 386} {windows amd64} {freebsd 386} {freebsd amd64}]
Fetching Go sources from https://storage.googleapis.com/golang/go1.3.src.tar.gz
...
cp -rp freebsd_386-788246966/go/pkg/freebsd_386 /usr/local/gonative/go/pkg
cp -rp darwin_amd64-349208609/go/pkg/darwin_amd64 /usr/local/gonative/go/pkg
Failed to build Go: Bad response for download: 404
jb@build:/usr/local/gonative$
#$ go get github.com/inconshreveable/gonative
# github.com/inconshreveable/gonative
../go/src/github.com/inconshreveable/gonative/gonative.go:67: cannot use "" (type string) as type bool in field value
../go/src/github.com/inconshreveable/gonative/gonative.go:67: cannot use nil as type string in field value
../go/src/github.com/inconshreveable/gonative/gonative.go:67: too few values in struct initializer
../go/src/github.com/inconshreveable/gonative/gonative.go:68: cannot use "" (type string) as type bool in field value
../go/src/github.com/inconshreveable/gonative/gonative.go:68: cannot use nil as type string in field value
../go/src/github.com/inconshreveable/gonative/gonative.go:68: too few values in struct initializer
../go/src/github.com/inconshreveable/gonative/gonative.go:69: cannot use "" (type string) as type bool in field value
../go/src/github.com/inconshreveable/gonative/gonative.go:69: cannot use nil as type string in field value
../go/src/github.com/inconshreveable/gonative/gonative.go:69: too few values in struct initializer
../go/src/github.com/inconshreveable/gonative/gonative.go:70: cannot use "" (type string) as type bool in field value
../go/src/github.com/inconshreveable/gonative/gonative.go:70: too many errors
Thanks for gonative. I believe that the call to "make.bash" should be converted to "all.bash" to also install the race enabled stdlib packages.
# github.com/inconshreveable/gonative
../../inconshreveable/gonative/gonative.go:67:70: cannot use nil as type bool in field value
../../inconshreveable/gonative/gonative.go:67:70: too few values in struct initializer
../../inconshreveable/gonative/gonative.go:68:99: cannot use nil as type bool in field value
../../inconshreveable/gonative/gonative.go:68:99: too few values in struct initializer
../../inconshreveable/gonative/gonative.go:69:81: cannot use nil as type bool in field value
../../inconshreveable/gonative/gonative.go:69:81: too few values in struct initializer
../../inconshreveable/gonative/gonative.go:70:176: cannot use nil as type bool in field value
../../inconshreveable/gonative/gonative.go:70:176: too few values in struct initializer```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.