Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile for armhf on Raspberry Pi 3B #4

Closed
bizi-betiko opened this issue Jul 17, 2019 · 8 comments
Closed

Unable to compile for armhf on Raspberry Pi 3B #4

bizi-betiko opened this issue Jul 17, 2019 · 8 comments

Comments

@bizi-betiko
Copy link

Since there's no arm binary already uploaded I tried to compile from source on a Raspberry Pi 3B running Raspbian Stretch where the repo go version is 1.7.4. I set $GOPATH to a home subfolder and run "go get -u github.com/tanaikech/goodls" as the manual suggests but I get

package google.golang.org/api/transport/http/internal/propagation: no buildable Go source files in /home/kostis/GoLang/src/google.golang.org/api/transport/http/internal/propagation

So, is there a way to build for armhf? Is perhaps a higher Go version required for this source code? Or perhaps a binary could be uploaded for armhf?

@karser
Copy link

karser commented Dec 3, 2019

I was able to compile it under go version 1.9.7. Here is the instruction:

Get into the golang container:

docker run -it --rm --name goodls -e GOOS=linux -e GOARCH=arm -e GOARM=5 golang:1.9 sh

Then downgrade urfave/cli to the version that supports go v1.9:

go get -v github.com/urfave/cli
#ignore the error and run this:
cd /go/src/github.com/urfave/cli
git checkout v1.20.0
go build

Now we can install and compile the project:

go get -v github.com/tanaikech/goodls
cd /go/src/github.com/tanaikech/goodls
git checkout v1.2.3
go build

Once it's done check the compiled binary (goodls):

# ls -alh 
total 11M
drwxr-xr-x 4 root root 4.0K Dec  3 19:44 .
drwxr-xr-x 4 root root 4.0K Dec  3 19:40 ..
drwxr-xr-x 8 root root 4.0K Dec  3 19:44 .git
-rw-r--r-- 1 root root   66 Dec  3 19:40 .travis.yml
-rw-r--r-- 1 root root 1.1K Dec  3 19:40 LICENCE
-rw-r--r-- 1 root root  13K Dec  3 19:44 README.md
-rw-r--r-- 1 root root 3.3K Dec  3 19:40 const.go
-rw-r--r-- 1 root root 1.5K Dec  3 19:40 doc.go
-rw-r--r-- 1 root root 7.9K Dec  3 19:40 getfilesfromfolder.go
-rwxr-xr-x 1 root root  11M Dec  3 19:44 goodls<--------------------
-rw-r--r-- 1 root root  11K Dec  3 19:40 goodls.go
drwxr-xr-x 2 root root 4.0K Dec  3 19:40 images
-rw-r--r-- 1 root root 8.5K Dec  3 19:40 resumabledownload.go

Now copy the binary to the host machine:

docker cp goodls:/go/src/github.com/tanaikech/goodls/goodls .

@karser
Copy link

karser commented Dec 3, 2019

@tanaikech could you add the arm builds, please?

@tanaikech
Copy link
Owner

Thank you for your support. Unfortunately, I have no information about "the arm builds". This is due to my poor skill. I deeply apologize for this.

@karser
Copy link

karser commented Dec 4, 2019

@tanaikech I'm sorry, I didn't mean/intend to offend you but either I don't understand why did you answer me with sarcasm?
I shared instructions which solve this ticket and suggested that you add the ARM build support.

@tanaikech
Copy link
Owner

Thank you for your support. I deeply apologize for my poor English skill. I don't mean to hurt your feeling. Unfortunately, I cannot understand about what you want. Because I have no information about "the ARM build". The reason that I cannot understand about your replying is due to my skill. So I thought that I have to apologize for this.

@karser
Copy link

karser commented Dec 4, 2019

I see, there is no problem.
What I mean is to add goodls_linux_armv7 and goodls_linux_armv8 builds in here:
image

I think these parameters should work:

#build for ARMv7
GOOS=linux GOARCH=arm GOARM=7 go build
cp goodls goodls_linux_armv7

#build for ARMv8
GOOS=linux GOARCH=arm64 go build
cp goodls goodls_linux_armv8

@tanaikech
Copy link
Owner

Thank you for replying. I could understand about your proposal. So I added them to here. Could you please confirm it?

@karser
Copy link

karser commented Dec 4, 2019

Yes, it works, thank you! This issue is 100% resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants