sqlite icon indicating copy to clipboard operation
sqlite copied to clipboard

Crouton Ubuntu xenial support

Open mandolyte opened this issue 7 years ago • 6 comments

Should this work? This is on my armv8 Chromebook using crouton Ubuntu. After the errors here, I show my go env. Works fine on my "real" Linux box.

(xenial)cecil@localhost:~/go/src/github.com$ go get github.com/cznic/sqlite package github.com/cznic/ccir/libc/errno: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/errno package github.com/cznic/ccir/libc/pthread: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/pthread package github.com/cznic/ccir/libc/stdio: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/stdio package github.com/cznic/ccir/libc/unistd: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/unistd (xenial)cecil@localhost:~/go/src/github.com$ go env GOARCH="arm64" GOBIN="/home/cecil/go/bin" GOEXE="" GOHOSTARCH="arm64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/cecil/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build295188118=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" (xenial)cecil@localhost:~/go/src/github.com$

mandolyte avatar Feb 09 '18 02:02 mandolyte

Possibly messed up build tags, have to investigate.

cznic avatar Feb 09 '18 06:02 cznic

@mandolyte

Turns out, it's actually expected to fail. The documentation for Supported platforms and architectures refers to ccir and there can be seen

Supported platforms and architectures

In GOOS_GOARCH form

linux_386 linux_amd64 windows_386 windows_amd64

If you can access a machine with a not yet supported os/arch and you would like to contribute to porting this package, you may want to start by trying

$ cd $GOPATH/src/github.com/cznic/ccir/libc $ go generate

Please fill an issue for the port and let's discuss it there.

As the sqlite2go project is getting close to its initial release, adding support for ARM would be welcome. Would you like to give it a try? Note that ccir/libc support is used by both of the sqlite and sqlite2go projects.

cznic avatar Feb 09 '18 08:02 cznic

@cznic I tried the go generate, which led to several packages to "go get". But in the end, there are still some error messages. I made a complete transcript and pasted below. One thing that may help is that initially I installed Go using the Armv6 download and it didn't work. I finally noticed that there is a second Arm download listed under "other ports". That one did work; and it is for Arm V8.

I am willing to help, but what you are doing is way over my head! But I can follow instructions and am fairly conversant with Linux as a user. So about the only thing I can do is be guided... here is the transcript (which is also here where I accumulated the outputs).

(xenial)cecil@localhost:~/go/src/github.com/mandolyte$ cd ../cznic/ccir
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir$ ls
AUTHORS  CONTRIBUTORS  LICENSE  Makefile  README.md  all_test.go  ccir.go  etc.go  libc  model.go  testdata
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir$ cd libc
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$ go generate
generator.go:24:2: cannot find package "github.com/cznic/cc" in any of:
        /usr/local/go/src/github.com/cznic/cc (from $GOROOT)
        /home/cecil/go/src/github.com/cznic/cc (from $GOPATH)
../ccir.go:43:2: cannot find package "github.com/cznic/ir" in any of:
        /usr/local/go/src/github.com/cznic/ir (from $GOROOT)
        /home/cecil/go/src/github.com/cznic/ir (from $GOPATH)
../ccir.go:45:2: cannot find package "github.com/cznic/strutil" in any of:
        /usr/local/go/src/github.com/cznic/strutil (from $GOROOT)
        /home/cecil/go/src/github.com/cznic/strutil (from $GOPATH)
../ccir.go:46:2: cannot find package "github.com/cznic/virtual" in any of:
        /usr/local/go/src/github.com/cznic/virtual (from $GOROOT)
        /home/cecil/go/src/github.com/cznic/virtual (from $GOPATH)
../ccir.go:47:2: cannot find package "github.com/cznic/xc" in any of:
        /usr/local/go/src/github.com/cznic/xc (from $GOROOT)
        /home/cecil/go/src/github.com/cznic/xc (from $GOPATH)
libc.go:1: running "go": exit status 1
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$ go get github.com/cznic/cc
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$ go generate
../ccir.go:43:2: cannot find package "github.com/cznic/ir" in any of:
        /usr/local/go/src/github.com/cznic/ir (from $GOROOT)
        /home/cecil/go/src/github.com/cznic/ir (from $GOPATH)
../ccir.go:46:2: cannot find package "github.com/cznic/virtual" in any of:
        /usr/local/go/src/github.com/cznic/virtual (from $GOROOT)
        /home/cecil/go/src/github.com/cznic/virtual (from $GOPATH)
libc.go:1: running "go": exit status 1
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$ go get github.com/cznic/ir
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$ go generate
../ccir.go:46:2: cannot find package "github.com/cznic/virtual" in any of:
        /usr/local/go/src/github.com/cznic/virtual (from $GOROOT)
        /home/cecil/go/src/github.com/cznic/virtual (from $GOPATH)
libc.go:1: running "go": exit status 1
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$ go get github.com/cznic/virtual
../../virtual/pthread.go:12:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/errno
../../virtual/pthread.go:13:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/pthread
../../virtual/stdio.go:18:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/stdio
../../virtual/machine.go:17:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/stdlib
../../virtual/sys_socket_linux.go:18:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/sys/socket
../../virtual/unistd_linux.go:17:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/unistd
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$ go generate
../../virtual/pthread.go:12:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/errno
../../virtual/pthread.go:13:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/pthread
../../virtual/stdio.go:18:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/stdio
../../virtual/machine.go:17:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/stdlib
../../virtual/sys_socket_linux.go:18:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/sys/socket
../../virtual/unistd_linux.go:17:2: build constraints exclude all Go files in /home/cecil/go/src/github.com/cznic/ccir/libc/unistd
libc.go:1: running "go": exit status 1
(xenial)cecil@localhost:~/go/src/github.com/cznic/ccir/libc$

mandolyte avatar Feb 09 '18 14:02 mandolyte

@mandolyte

I'm far from being sure about this, but I think there's unfortunately a nasty bootstrap circular dependency issue when starting a new arch/platform port.

I guess it's necessary in the first step to just copy some ccir/libc files for an already supported arch/platform combo to the newly developed one while modifying the build tags in the copies properly. Save the temporary commit as it will get overwritten once the go generate will be executed, but correctly/successfully only after some more fiddling rounds, I do expect.

Maybe @steffengy can recall more than I as he has authored the Windows port and may possibly have some hints...?

cznic avatar Feb 09 '18 17:02 cznic

Yeah that sounds like the target specific implementations in virtual and libc are not implemented yet. Copying/Adjusting them is the first step and then figuring out if that works already.

Currently the higher-level implementations all depend on platform APIs in some sort, which are not available since they are not implemented/included for the target, leading to build failures.

With Windows being very different, it even was especially funny to find all places that assumed some usual unix libc conventions.

steffengy avatar Feb 09 '18 17:02 steffengy

With Windows being very different, it even was especially funny to find all places that assumed some usual unix libc conventions.

Shame on me :innocent: - but thanks a lot for the input! :+1:

cznic avatar Feb 09 '18 17:02 cznic