Stream: beginners

Topic: Roc on Alpine Linux


view this post on Zulip removewingman (Aug 02 2026 at 00:08):

I am trying to use roc on Alpine Linux.
So far it is not going so great, with either binary using the https://github.com/roc-lang/nightlies/releases/tag/nightly-2026-August-01-1c1cecc (roc_nightly-linux_x86_64-2026-08-01-1c1cecc.tar.gz) or building from source https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/106329 I get this error:
copyimagetmp.avif

Could not build it on my own Laptop, because it needs to much memory. (I have 4 GB and 4 GB SWAP)

view this post on Zulip Luke Boswell (Aug 02 2026 at 00:25):

Are you on an arm or intel architecture? I'm thinking about how we might repro this, maybe Docker could help.
nvm I see in your build

view this post on Zulip Luke Boswell (Aug 02 2026 at 00:35):

My immediate suspicion is that we now target the x86-64-v3 CPU level for SIMD ... maybe that is related?

view this post on Zulip Luke Boswell (Aug 02 2026 at 00:45):

I was able to reproduce the Illegal instruction failure with the help of Codex.

Roc targets the x86-64-v3 CPU level, which requires features including AVX2 and BMI2. On a CPU that does not provide that instruction set, the operating system terminates Roc with SIGILL, which the shell displays as Illegal instruction.

We verified the CPU boundary using QEMU emulation:

Emulated CPU Result
Nehalem Illegal instruction (exit 132)
Sandy Bridge Illegal instruction (exit 132)
Ivy Bridge Illegal instruction (exit 132)
Haswell Roc starts successfully

Could you please share your CPU model and flags? On Alpine/Linux, this command should provide the relevant information:

grep -m1 -E 'model name|flags' /proc/cpuinfo

The source build running out of memory on a machine with 4 GB RAM and 4 GB swap is unrelated.

view this post on Zulip Luke Boswell (Aug 02 2026 at 00:52):

At the very least we should probably have all this documented somewhere...

I'm not sure if the cli itself needs this. I know Richard landed https://github.com/roc-lang/roc/pull/10302 recently which added the requirement for generated code.

I would assume it is possible to patch the compiler and should be possible to use the interpreter on these cpu's.

view this post on Zulip removewingman (Aug 02 2026 at 01:09):

The source build running out of memory on a machine with 4 GB RAM and 4 GB swap is unrelated. (I know, but I would like to have that documented as well, how much approximately is needed to build roc)

CPU (pretty old, 2 cores) : model name : Intel(R) Celeron(R) N4020 CPU @ 1.10GHz

Idk if this helps, but zig works, and they also have llvm backend

view this post on Zulip Luke Boswell (Aug 02 2026 at 01:20):

Thank you for the feedback, I made an issue so we can track this and roll it into our docs https://github.com/roc-lang/roc/issues/10538

view this post on Zulip removewingman (Aug 02 2026 at 11:48):

The documentation is a nice to have, but this actually does not solve my problem. Will I be able to use roc? Or will there be specific system requirements like windows has

view this post on Zulip Richard Feldman (Aug 02 2026 at 13:51):

@removewingman just to clarify, is the issue that you can't run roc at all, or that you can't run the roc programs that it builds, or both?

view this post on Zulip Richard Feldman (Aug 02 2026 at 13:52):

I assume it's the Celeron processor not having the instructions we're expecting, and there are different potential solutions depending on which is the issue

view this post on Zulip removewingman (Aug 02 2026 at 14:52):

@Richard Feldman The first thing, if I try to compile a .roc file, I get the error, so I don't even get to the second step. I tried to get a hello world up and running.
![show](https://roc.zulipchat.com/user_uploads/22008/MIMcu2ElsZ5Q0ASjCDXYjOJA/copyimagetmp.avif)

view this post on Zulip Richard Feldman (Aug 03 2026 at 01:47):

@removewingman can you try it out on current main? This PR should hopefully have fixed it!

view this post on Zulip removewingman (Aug 03 2026 at 07:45):

@Richard Feldman Nice, it actually fixed the problem with the Celeron processor, thanks.

Now there is a problem with linking, probably Alpine Linux and musl libc related:
copyimagetmp.avif

(if the commit is in the next nightly build, gonna try with this one again, maybe it will work did not work)

view this post on Zulip removewingman (Aug 03 2026 at 08:06):

@Anton Feedback for: https://github.com/roc-lang/nightlies/releases/

For building nightly one needs the source code from the current nightly build, this can be obtained by: https://github.com/roc-lang/roc/archive/$_commit.tar.gz

This would make it simpler and one does not have to rely on the github archive feature of commits.

I hope it is ok to ping and give feedback/make suggestions :upside_down:

view this post on Zulip Richard Feldman (Aug 03 2026 at 21:22):

removewingman said:

Now there is a problem with linking, probably Alpine Linux and musl libc related:
copyimagetmp.avif

@removewingman can you try on https://github.com/roc-lang/roc/pull/10582 and see if it works on that branch?

view this post on Zulip removewingman (Aug 03 2026 at 22:35):

@Richard Feldman It worked, lets go, much appreciated.
copyimagetmp.avif

I will wait until the changes in roc-lang/nightlies are landed and finish the aport.

view this post on Zulip Notification Bot (Aug 03 2026 at 23:38):

removewingman has marked this topic as resolved.

view this post on Zulip Notification Bot (Aug 04 2026 at 00:05):

removewingman has marked this topic as unresolved.

view this post on Zulip removewingman (Aug 04 2026 at 00:06):

@Richard Feldman Sorry, have to unresolve, while trying to run hello world

Got the following error (main.roc works tho):
copyimagetmp.avif

view this post on Zulip Luke Boswell (Aug 04 2026 at 01:06):

It would be good to know if thats on the platform or roc side... not sure how to figure that out

view this post on Zulip Richard Feldman (Aug 04 2026 at 01:09):

I'm on it

view this post on Zulip Richard Feldman (Aug 04 2026 at 01:19):

it turned out to be kinda both: selecting which host to use for the platform: https://github.com/roc-lang/roc/pull/10593

view this post on Zulip removewingman (Aug 04 2026 at 02:26):

This is currently the branch default-platform-no-libc, got this:
copyimagetmp.avif
it this the expected behavior? I am confused, would be best if https://github.com/roc-lang/roc/pull/10582 is merged, to eliminate that this is the mistake

view this post on Zulip Richard Feldman (Aug 04 2026 at 02:30):

it's definitely not the expected behavior! and I'll merge that PR as soon as it passes CI :smile:

view this post on Zulip Anton (Aug 04 2026 at 12:47):

@removewingman, this will be published starting tomorrow

view this post on Zulip removewingman (Aug 04 2026 at 22:17):

Also with https://github.com/roc-lang/roc/pull/10593 landed and the others, I still get the following error, maybe it is the platform now? Idk.

copyimagetmp.avif

view this post on Zulip Richard Feldman (Aug 05 2026 at 01:17):

yep, that's a platform issue! I'll open a PR to the platform

view this post on Zulip Richard Feldman (Aug 05 2026 at 03:16):

https://github.com/lukewilliamboswell/roc-platform-template-zig/pull/37

view this post on Zulip Luke Boswell (Aug 05 2026 at 03:18):

I'm just hardening up the test infra while I'm looking at this platform again, lessons I've learnt elsewhere

view this post on Zulip Luke Boswell (Aug 05 2026 at 03:18):

Almost done

view this post on Zulip Luke Boswell (Aug 05 2026 at 03:27):

https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/tag/1.1.0

view this post on Zulip removewingman (Aug 05 2026 at 08:59):

Lets go, the second time :)
Works:
copyimagetmp.avif

Thanks for the work, much appreciated.
If one wants to have actual BSD support or other targets, one needs Compiler and Plattform support, imo these should be tracked together.

view this post on Zulip Notification Bot (Aug 05 2026 at 08:59):

removewingman has marked this topic as resolved.

view this post on Zulip Notification Bot (Aug 05 2026 at 12:05):

removewingman has marked this topic as unresolved.

view this post on Zulip removewingman (Aug 05 2026 at 12:09):

Would it be also possible after the zig roc platform template has now support for x64v1musl and arm64v1musl with: https://github.com/lukewilliamboswell/roc-platform-template-zig/pull/37

To add these here aswell:


Last updated: Aug 12 2026 at 12:35 UTC