Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Can't textile init on ARM Linux #805

Open
flyskywhy opened this issue Jun 6, 2019 · 3 comments
Open

Can't textile init on ARM Linux #805

flyskywhy opened this issue Jun 6, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@flyskywhy
Copy link
Contributor

Describe the bug
When run textile init -s SUo2u6ngf3mCqqzNN8ZCGAdusQ4pcaAomzagVUCaFY6tnAvY with arm version textile (0.1.11 ~ 0.2.3), it print the error

initialize failed: sql: unknown driver "sqlite3" (forgotten import?)

To Reproduce
Steps to reproduce the behavior:

  1. Download go-textile_v0.2.3_linux-arm.tar.gz
    from https://github.com/textileio/go-textile/releases
  2. run textile init -s SUo2u6ngf3mCqqzNN8ZCGAdusQ4pcaAomzagVUCaFY6tnAvY on a ARM linux board
  3. See error

Expected behavior
No such error.

Additional context
Maybe need CGO_ENABLED=1 when compiling? Ref to Cross platform build failed and Cross compiling fails .

@flyskywhy flyskywhy added the bug Something isn't working label Jun 6, 2019
@sanderpick
Copy link
Member

sanderpick commented Jun 11, 2019

Perhaps we need CGOENABLED=1 here with gox: https://github.com/textileio/go-textile/blob/master/.circleci/config.yml#L67

I'll try that on the next master build and point you to a build to try.

@flyskywhy
Copy link
Contributor Author

If just

CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc go build -ldflags "-extldflags -static -w $(FLAGS)" -i -o textile textile.go

in Makefile, still initialize failed: sql: unknown driver "sqlite3" (forgotten import?)

Ref to https://stackoverflow.com/a/47514836/6318705 , run

CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 go get github.com/mattn/go-sqlite3

and then make build, and the textile init runs well on ARM linux.

////////////////////////////////////////////////////////////////

A strange thing left: then I delete ~/go/ , then make setup again, and no need to

CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 go get github.com/mattn/go-sqlite3

just

CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc go build -ldflags "-extldflags -static -w $(FLAGS)" -i -o textile textile.go

the textile init still runs well on ARM linux.

@sanderpick
Copy link
Member

Ok, cool. I'll see what happens with gox

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants