Open flyskywhy opened 5 years ago
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.
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.
Ok, cool. I'll see what happens with gox
Describe the bug When run
textile init -s SUo2u6ngf3mCqqzNN8ZCGAdusQ4pcaAomzagVUCaFY6tnAvY
with arm version textile (0.1.11 ~ 0.2.3), it print the errorTo Reproduce Steps to reproduce the behavior:
textile init -s SUo2u6ngf3mCqqzNN8ZCGAdusQ4pcaAomzagVUCaFY6tnAvY
on a ARM linux boardExpected behavior No such error.
Additional context Maybe need CGO_ENABLED=1 when compiling? Ref to Cross platform build failed and Cross compiling fails .