-
Notifications
You must be signed in to change notification settings - Fork 842
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
Feature Request: Official ARM support #2103
Comments
The main thing we'd need to start to start generating ARM binaries for releases is a Vagrantfile that sets up a build environment similar to the ones found in https://github.com/commercialhaskell/stack/tree/master/etc/vagrant. I guess that Vagrantfile would have to launch a VM on an Arm-supporting VPS provider (or in an emulator, but that might be really slow). From your link, it sounds like we may also want to add support for installing LLVM to |
I initially tried building on QEMU, but had little success with it. The Raspberry Pi with its 1GB of RAM might be problematic for reliable builds. As you suggest, a VPS provider that offers server-grade ARM systems with enough memory seems like the best option. I filed a issue #1742 a while ago to suggest stack should install LLVM as it's often difficult to pick the right version and different GHC versions need different LLVMs. Wasn't there talk of GHC8 bundling the right LLVM anyway? |
@blitzcode Just a few notes, I have set up an ARM machine on Scaleway few months ago for CI purposes, and it's doing great. I would advise to use Arch Linux distribution instead of Debian/Ubuntu, as it has up-to-date binary packages, in particular GHC 7.10.3 (on ARM too) and LLVM, which work together flawlessly. As I remember the setup was relatively straightforward, just install ghc, llvm35, cabal-install from packages, add some swap space (2Gb RAM will not be enough), compile stack from sources, and that's it. Don't do parallel builds, as it will run out of memory. Unfortunately I don't know other good ARM cloud providers, I would love to hear about any providing bigger ARM machines in terms of memory. |
@quyse Yes, I was checking them out, seems really affordable. 2GB really wasn't enough? I got everything to build with the 1GB RPi and 100MB swap, I figure 2GB should be smooth sailing. Maybe only with -j1 / -j2, though. I'm a bit wary of Arch simply because I don't like the idea of being forced to upgrade and I want reproduceability. If 1 year from now the SD card in a RPi I deployed dies, I'd want to be able to set up the exact same system again. If Arch has already moved to GHC8 by then, I might be in trouble with my LTS 5.x code. At least that's my worry without ever having tried Arch. It seems otherwise much easier to get going than Debian Jessie with its dated packages... |
@blitzcode I've checked again what I'm doing there, actually I'm not specifying -j1, so I guess it's actually -j4 by default (because of 4 cores), no wonder it was running out of memory :) With additional swap space it's fine though. -j1 is just too slow. |
I'm trying to build a stack binary on a Scaleway VM running Debian Jessie (to match the GHC bindist), but am having trouble with LLVM. I downloaded an LLVM bindist as recommended in here, but when I try to use it I get:
Any ideas where I can easily get an LLVM that will work? |
@borsboom That's puzzling, last time I checked their servers were armv7 / 32 bit, same as the Raspberry Pi with Raspbian. So it's really strange that the LLVM bindist would not work. Could you maybe do a |
Oddly enough, the
|
@borsboom, you need at least LLVM 3.5.2 or greater. There is a fix related to GHC in it. |
@blitzcode, I'm running GHC 7.10.2 with LLVM 3.5.2 on ARMv7 (32bit) and it is working well. |
@borsboom I'm terribly sorry, I said 3.5.2 in my document and then linked 3.5.1, dammit... |
Note that another thing that will likely need to be resolved is support for byte alignment in |
Related: haskell-crypto/cryptonite#90 |
This temporarily workarounds this problem:
|
Jumping here from #1332 I've finally taken some time to untangle haskell/arm stuff from my personal files, here's the result: Hope it helps somebody. @varosi cryptonite used to be an issue for me at some point but haven't had any problems recently. Something got fixed, I imagine. |
@andreyk0, fix is not yet pushed in Hackage and I still have this problem on my ARM. |
@varosi hmm, could be my environment then. I don't remember everything but (it's in the readme in that repo and my images are on dockerhub) I've installed LLVM from the project's downloads page and hacked 7.10.2 to be a symlink to 7.10.3, so there's no 7.10.2 in my system. |
with cryptonite-0.15 it is working fine on IMX.53 board. So I'm building project successfully with Stack. It'll be great if Stack have official distro for ARM and support stack setup. |
I did some more experimenting with this. I got Debian Jessie for The situation with LLVM bindists is annoying though; they only seem to support fairly specific versions of distros (unlike GHC bindists, which tend to work on a wide range). And since each GHC version needs a specific version of LLVM, we can't leave it up to the Linux distro to install LLVM for us. So we could officially support ARMv7 on Jessie armhf, but not necessarily on any other distributions or versions. |
@borsboom Good to hear, but I'm surprised that the build times are so much worse than on the RPi. I've read several times about good results with QEMU. Hope you build Cabal with In the meantime, Stack v1.1 has been working absolutely without issues for me on ARM after the initial setup pains. Debian Wheezy only seems to have LLVM 3.1 available, Wheezy only goes to 3.5, had to download the LLVM binaries. Where on the LLVM page does it actually say with which distros the binaries have been tested? |
Thanks for the tip about EXTRA_CONFIGURE_OPTS; I didn't know that! I didn't see anywhere on the LLVM page where it mentioned the distros. But when I tried
|
Oh, it's gated by glibc, that makes sense. That's an unfortunate problem... Once you have Cabal be sure to use |
I have tested latest cryptonite-0.17 on ARMv7 and the compilation issue from 0.16 is fixed (haskell-crypto/cryptonite#90) there. So Stack will be building alright now. |
@varosi yeah, I must've hacked flags long time ago and forgot about it, sorry for the noise, you were right. Had the same problem with a clean ghc8.0.1 build, luckily it's fixed now! |
@borsboom " ARMv7 on Jessie armhf" is probably the way to go, too much pain to get this stuff to work anywhere else for now. |
Replying to myself here, regarding #2103 (comment): I've seen some issues in other projects that need ARM CPUs with NEON support and have the same |
For small and slow machines like Raspberry Pi, it would be great if there is a binary distribution. |
@nh2 would your static compilation Nix magic make this more possible? |
On arm64, I'm trying to build Cilium. Cilium depends on Istio and Envoy, and several of those packages use From what I can see, the CI for |
With the first models scheduled to appear before the end of this year, in fact. So hopefully someone is working rapidly toward getting ghc and stack ready for that. |
If Stack developers need someone to test Stack on such a machine - I'll test it. |
Yes please. |
@Fleuv I got the same error message you did using Debian Buster which uses tinfo6. I could circumvent the issue by using an |
Hi Guys, I am trying to bootstrap some later I build my own ghc's(how to build it from git) but you should be able to grab some of the official ones, you might need to install some additional It is not this hard to set it on your own, just the bootstrapping is tedious... Basically for Nvidia Jetson(Xaviers, nano) I am not sure how portable all those binaries are... but it should be safe to run them on some scratch servers. UPDATE: UPDATE2: |
Hi there. I’m struggling to build my project on ARM64 on raspberry pi 4 in 64bit. We were hoping to migrate to ARM64 on AWS too for some of our data processing tasks. Are there plans to add ARM64 support back into Stack at all? |
supposedly - there.s a 2.7.1 build in releases - (the 2.7.3 didn't spit out an arm build.) ➜ ~ wget https://github.com/commercialhaskell/stack/releases/download/v2.7.1/stack-2.7.1-linux-aarch64.bin 100%[============================================================================================================================================>] 70,088,040 46.6MB/s in 1.4s 2021-11-17 23:48:05 (46.6 MB/s) - ‘stack-2.7.1-linux-aarch64.bin’ saved [70088040/70088040] ➜ ~ mv stack-2.7.1-linux-aarch64.bin stack GLIBC - 2.26 is out of the box with AWS - is it possible to make stack work just on that version for ARM64? |
I am going to close this issue because the first release candidate for Stack 2.9.1 does include the Linux AArch64 platform, and the GitHub workflow does build Stack for Linux AArch64. I have opened a separate issue for macOS AArch64. |
Link for bookkeeping: #5854 |
The current process of getting a Stack Haskell application build on ARM is rather... tricky:
https://github.com/blitzcode/hue-dashboard/#raspberry-pi
I'd love for Stack to have an official ARM bindist and be able to install GHC/LLVM with
stack setup
.The text was updated successfully, but these errors were encountered: