-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Enhancement: arm64 #42
Conversation
👋 I'm not forgetting about your PR, just experimenting a bit before merge. I'm going to most likely merge this and add some additional changes after to hopefully enable a multiarch image for easy of use. |
Sure thing no rush really. I've been looking into using ONBUILD and TARGETARCH to unify the docker files. If you want I can throw something together here in the next couple of hours or so that defaults to linux/amd64? EDIT: I have something that looks to be working here now, will push shortly after I do some more testing. FURTHER EDIT: Scratch that, having trouble cross compiling sqlite for arm64, from an amd64 machine. |
Here's a quick wip I had going: main...robherley/arm-support-wip Been busy so haven't really looked into it much further. I ran a docker buildx to get the multiarch amd/arm image (would definitely prefer a multiarch image over a separate tag):
Unfortunately the build is slow on my machine because of QEMU emulating the ARM portions. Also I didn't get a chance to even run the image on arm yet. The build completed but unsure if it even works on ARM 🤷 One thing I would like is to separate out the guesser code to an isolated func in a separate file, that way we can reduce the amount of duplicated code with the |
That's cool I'll fire those changes up shortly. I've also not included the The multiarch approach is something I'm trying too, and while I've gotten images building, they fall over when ran on my rpi because sqlite uses CGO and thus needs a gcc cross compiler to correctly create the go binary. I've messed about with this notion a wee bit but haven't had too much success. I'm using a cross compiler based off this comment, and am now facing what looks to be an overflow issue, documented here. Overall it's getting messy because sqlite3 using cgo. I'll have more of a play with it tomorrow. |
RIGHT SO, I've gotten the multi-arch build working. Pretty happy with the result, so let me know what you think. I've opted to use The multiarch image can be found here if you want to test it out. The last thing to do is update the build github action, I'll get on that tomorrow. |
That makes a lot more sense 👍 Thanks for your dedication to getting arm working! |
Wonder if we should consider |
No harm in that, though I don't think I have any armv7 compatible hardware to test the sqlite cgo compilation on (I've never tried v7 on my rpi), so I won't be able to verify the result. |
Let's roll with just arm64 for now and we can always add v7 later |
Sure thing man, I'll get on the GHA later on. |
Actually sorted it there now. Tested the action with act as well, so I think this is good to go if you're happy 👍 |
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.
Thanks so much for this! 🎉
Curious to see how long the build action will take now that it needs to run partially in QEMU. It only runs after merge on main so shouldn't be too much friction. But definitely worth it given how many folks are using arm nowadays.
A move to solve #39.
Add a
detect_arm64.go
file that doesn't import guesslang, and add build flags to only build this variant on arm64 architecture.Also, add a Dockerfile for building an arm64 variant (note this can only be built on an arm64 machine, such as an rpi. It would be nice if we could build for both archs using the
--platform
arg. Happy to hear thoughts on this.)I have this running on an rpi that's public facing at the moment that you can test on to see how this performs with the guesser disable, just give me a shout and I'll message details.
Let me know if you'd like any workflows updated too.
(p.s. this is awesome software, absolutely loving it.)