So, I tried out guix. It uses its custom programming language (and I can't find documentation for it), and even the hash format of a file is special (its "base32" isn't compatible with base32 from GNU coreutils, despite bith made by GNU)! This is madness.
I guess Vagrant is still the best solution right now.
So, the editor requires https://crates.io/alsa-sys
It certainly doesn't need it
Full build:
________________________________________________________
Executed in 86.72 secs fish external
usr time 75.74 secs 1.95 millis 75.74 secs
sys time 11.47 secs 2.48 millis 11.47 secs
fish: Job 1, 'time mold -run cargo run --targ…' terminated by signal SIGILL (Illegal instruction)
Incremental build: (change one string in cli/src/main.rs
> time mold -run cargo run --target-dir ~/.cache/roc -- ../examples/hello-world/Hello.roc
Compiling roc_gen_llvm v0.1.0 (/home/vagrant/roc/compiler/gen_llvm)
Compiling roc_build v0.1.0 (/home/vagrant/roc/compiler/build)
Compiling roc_linker v0.1.0 (/home/vagrant/roc/linker)
Compiling roc_cli v0.1.0 (/home/vagrant/roc/cli)
Finished dev [unoptimized + debuginfo] target(s) in 15.64s
Running `/home/vagrant/.cache/roc/debug/roc ../examples/hello-world/Hello.roc`
________________________________________________________
Executed in 16.16 secs fish external
usr time 3.78 secs 0.81 millis 3.78 secs
sys time 1.59 secs 1.03 millis 1.58 secs
fish: Job 1, 'time mold -run cargo run --targ…' terminated by signal SIGILL (Illegal instruction)
One more try:
> time cargo run --target-dir ~/.cache/roc -- ../examples/hello-world/Hello.roc
Compiling roc_gen_llvm v0.1.0 (/home/vagrant/roc/compiler/gen_llvm)
Compiling roc_build v0.1.0 (/home/vagrant/roc/compiler/build)
Compiling roc_linker v0.1.0 (/home/vagrant/roc/linker)
Compiling roc_cli v0.1.0 (/home/vagrant/roc/cli)
Finished dev [unoptimized + debuginfo] target(s) in 14.02s
Running `/home/vagrant/.cache/roc/debug/roc ../examples/hello-world/Hello.roc`
________________________________________________________
Executed in 14.44 secs fish external
usr time 3.38 secs 556.00 micros 3.38 secs
sys time 1.54 secs 749.00 micros 1.54 secs
fish: Job 1, 'time cargo run --target-dir ~/.…' terminated by signal SIGILL (Illegal instruction)
Note the SIGILL
To reproduce the error, switch to vagrant git branch and run:
vagrant up
vagrant ssh
# now in ssh
cd /home/vagrant/roc/cli
cargo run --target-dir ~/.cache/roc -- ../examples/hello-world/Hello.roc # --target-dir because hard link
We need a reproducible build environment!
I tried vagrant and...
vagrant box with libvirt backend:
vagrant@archlinux ~> df
Filesystem 1K-blocks Used Available Use% Mounted on
dev 221556 0 221556 0% /dev
run 239816 524 239292 1% /run
/dev/vda2 20969452 2298996 18524812 12% /
tmpfs 239816 0 239816 0% /dev/shm
tmpfs 239816 238224 1592 100% /tmp
note that /tmp is full
pain
Probably docker is the only sane choice now
I think Nix is the best option.
Docker uses too many system resources in non-Linux environments
nix really is the best option here. Vagrant was essentially replaced by docker and docker has gotten weird lately with their business model. Also docker runs on Rosetta on M1 Macs :’(
earthly does use docker on the hood tho, so we kinda already has docker working for testing stuff but via earthly
yeah Earthly has the downside of only running on Linux images though, which means we can only use it for Linux CI at most, so we need to find something else for Mac and (someday) Windows CI regardless :big_smile:
yea true, I noticed the other day when I had some trouble running the earthly tests
Docker is a greedy consumer of my laptop battery...
Nevertheless, I prefer it to nix for now mainly because I cannot parse nix's config syntax yet.
Docker is easy to use but hard for machine.
I am wondring which tools I should select in nix ecosystem, such as niv or flake etc.
Nix definitely takes a bit of getting used to, but it generally is quite nice once learned. I say generally because edge cases can be really painful and annoying, but they are becoming less and less common.
As for niv vs flakes, I know that we use niv. Maybe the person who chose it can comment and give a reason why.
I think that was @Anton
I think it was me, actually! Basically: we use Niv because it makes updating hashes for stuff a lot easier while not requiring experimental Nix features. Flakes are definitely where everything is going over time but they're not released in a stable form yet.
Richard Feldman said:
I think Nix is the best option.
Nix behaves well, but is hard to learn
I'd agree with that, which I think makes it the best fit for this use case
Nix doesn't have virtualization
most people won't need to learn it!
:thinking: why would virtualization be desirable for building the compiler?
But it doesn't work last time I checked it
It's not desirable. Reproducible build environment is.
There's like firejail for isolation
agreed
we don't have a working Nix build yet, but that's a separate question from what's the best goal to work toward
among the options, Nix seems like the best goal to aim for
So when will the problem be fixed?
https://roc.zulipchat.com/#narrow/stream/231634-beginners/topic/.E2.9C.94.20Nix
I can't build Roc because of random Nix package regression and have no idea how it fix it
can you build using the manual installation instructions in BUILDING_FROM_SOURCE.md?
I've installed a lot of weird stuff on my system, like mold and zig 0.9
I don't think having mold installed should affect a normal checkout, since nothing in the roc code base references it as far as I know
as for Zig, I think as long as you have the right version on your PATH it should be fine if there's another version installed somewhere else on the system
How do you set crate-local linker?
I don't know, but I don't think that should be necessary to build roc
Richard Feldman said:
we don't have a working Nix build yet, but that's a separate question from what's the best goal to work toward
We don't have an 100% working nix build, but we definitely have a working nix build. I having been using it on both my linux and M1 mac machine. On my linux machine, cargo build and cargo test run just fine even inside of a pure shell. There definitely can be some issues with the editor, but I would say that our nix build is mostly working.
Thank you, folks. I will retry nix with niv. I hope that I will like docker as well as nix.
Last updated: Jun 16 2026 at 16:19 UTC