-
Notifications
You must be signed in to change notification settings - Fork 1.1k
making compiling work on raspberry pi's #1474
Conversation
Thanks a lot for the PR! 🥇 The relevant lines in the The required change is to rewrite this so that an additional The current for loop structure makes this kind of hard to do, but instead you could do something like for platform in linux/amd64 linux/arm darwin/amd64 windows/amd64; do \
split=($${platform//\// }); os=$${split[0]}; arch=$${split[1]}; \
CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch go build -o "build/fluxctl_"$$os"_$$arch" $(LDFLAGS) -ldflags "-X main.version=$(shell ./docker/image-tag)" ./cmd/fluxctl/; \
done |
That stanza in the Makefile is for building @MansM Have you got to the point of building an image and running it? Or is it sufficient for you to be able to compile the fluxd binary? I'm happy to accept this code change, if a binary is all you need, so long as we make sure it compiles somewhere in the CI script, so it doesn't rot. |
That said, we could do a similar thing for fluxd, if a binary is the desired artefact. |
Fluxd runs perfectly fine in my pi kube cluster. |
🤦♂️ I need to stop reviewing stuff before lunch. That being said I think we can do two things: we can either compile both versions for the Flux daemon (which I think would be great) or we can make the |
To be honest, I highly doubt anyone would use an rpi a jumphost, so I think at least creating the fluxd image and/or binary would be plenty. I think it builds though, but I only kept the docker images |
During some rainy cycling I thought of the following. |
Good question! This hacks suggests it might be possible: https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/ If you just need the binaries, and you're happy doing the rest yourself for now, let's just make sure they are compiled somewhere in the CI script. I'm OK with having a Makefile target specifically for checking that cross-compilation works. |
I only need the images, I would be fine with merging this now and keep doing the search and replace for now on the Makefile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK let's get this merged, to unblock our raspberry pi friends -- thanks @MansM 🍒 (sorry, that was the closest emoji)
Making code compile on my raspberries, will not have any effect on arm64
makefile can be changed as well, but I am not that big of an Makefile expert ( sed -i "s/amd64/arm/g" Makefile did work for me)
fixes: #1411