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

Fix arm rclone build #68

Merged
merged 6 commits into from
Jan 20, 2021
Merged

Fix arm rclone build #68

merged 6 commits into from
Jan 20, 2021

Conversation

escoand
Copy link
Contributor

@escoand escoand commented Jan 15, 2021

Fix the rclone build on arm.

Reference: nodejs/node#4212 (comment)

@escoand
Copy link
Contributor Author

escoand commented Jan 15, 2021

The problem does not occur in your drone build before merge because of this

resticker/.drone.yml

Lines 19 to 22 in 641778f

when:
event:
exclude:
- pull_request

@djmaze
Copy link
Owner

djmaze commented Jan 17, 2021

@escoand Could you please merge the latest master? I adjusted the drone configuration so it will try to build images for PRs like this as well. Then we can see if everything is working.

@escoand
Copy link
Contributor Author

escoand commented Jan 17, 2021

OK, build seems to work but there is no way to pull this containers. Not a problem but something I recognized.

@djmaze
Copy link
Owner

djmaze commented Jan 17, 2021

Okay, I thought about this and changed it so that now an image is built for every PR. Just merge master again and we can try it out directly ;)

@djmaze
Copy link
Owner

djmaze commented Jan 18, 2021

Hmm.. This seems to be broken somehow ;-/

$ docker run -it --rm --entrypoint sh mazzolino/restic-test:pr-68-arm64
/ # rclone
Segmentation fault (core dumped)

Same with the arm32 image (mazzolino/restic-test:pr-68-arm).

@escoand
Copy link
Contributor Author

escoand commented Jan 18, 2021

I can verify the problem on arm as well, but...

$ docker run -it --rm --entrypoint rclone mazzolino/restic-test:pr-68-arm version
standard_init_linux.go:207: exec user process caused "exec format error"

$ docker build -qt mytest https://github.com/escoand/resticker.git#patch-1 && docker run -it --rm --entrypoint rclone mytest version
rclone v1.53.3-DEV
- os/arch: linux/arm
- go version: go 1.15.6

I've compared the previous build for arm https://ci.strahlungsfrei.de/djmaze/resticker/141/2/2

+ /usr/local/bin/docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:23:20 2020
 OS/Arch:           linux/arm
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:44:51 2020
  OS/Arch:          linux/arm
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

with the last not working build https://ci.strahlungsfrei.de/djmaze/resticker/160/2/2:

+ /usr/local/bin/docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:23:06 2020
 OS/Arch:           linux/arm64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:28:48 2020
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

As you can see the OS/Arch switched from linux/arm to linux/arm64. Was this by intention?

@escoand
Copy link
Contributor Author

escoand commented Jan 18, 2021

For arm64 I can't find a problem, but I have no hardware to test the build in general.

@djmaze
Copy link
Owner

djmaze commented Jan 19, 2021

Well, it is a bit embarassing, but the drone configuration was still not correct. I fixed it in #71. Could you please merge master again? Then the arm build should at least be generally working.

@djmaze
Copy link
Owner

djmaze commented Jan 19, 2021

I just built rclone manually inside the docker image on my arm64 machine. I still got the segfault when compiling with go build.

However, if I do a static build, it works! Maybe we should just change it?

CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' .

@djmaze djmaze added the bug label Jan 20, 2021
@djmaze djmaze added this to the 1.3.1 milestone Jan 20, 2021
@djmaze
Copy link
Owner

djmaze commented Jan 20, 2021

Both arm and arm64 work for me now. Great, thanks for your patience! :)

@djmaze djmaze merged commit 235ab46 into djmaze:master Jan 20, 2021
@escoand escoand deleted the patch-1 branch January 20, 2021 10:14
@escoand
Copy link
Contributor Author

escoand commented Jan 20, 2021

Also thanks to you!

jeankhawand pushed a commit to jeankhawand/resticker that referenced this pull request Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants