When compiling a basic-webserver app using Dir.create!
or Dir.create_all!
, on Aarch64 MacOS, I get the following error message:
Undefined symbols for architecture arm64:
"_roc_fx_dir_create", referenced from:
_roc_fx_dir_create_fastcc_wrapper in roc_appRopdbV.o
ld: symbol(s) not found for architecture arm64
main: is already signed
thread 'main' panicked at crates/compiler/build/src/program.rs:1037:17:
not yet implemented: linker failed with exit code Some(1)
stack backtrace:
0: rust_begin_unwind
at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
1: core::panicking::panic_fmt
at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
2: roc_build::program::build_loaded_file
3: roc_build::program::build_file
4: roc_cli::build
5: roc::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Min repro:
app [Model, init!, respond!] {
web: platform "https://github.com/roc-lang/basic-webserver/releases/download/0.12.0/Q4h_In-sz1BqAvlpmCsBHhEJnn_YvfRRMiNACB_fBbk.tar.br",
}
import web.Dir
Model : {}
init! : {} => Result Model []
init! = |{}| Ok({})
respond! = |_req, _model|
Dir.create!("test_dir")?
Ok({ status: 200, headers: [], body: "Hello, world!" |> Str.to_utf8 })
It's probably missing in the platform list of functions we don't want rust to garbage collect
Oh actually, it looks like it is just completely missing
https://github.com/roc-lang/basic-webserver/blob/main/crates/roc_host/src/roc.rs
Probably was copied from basic-cli, but somehow the rust code was missed
Uhu, Dir.create!
is untested as well which is why we did not notice it before.
I've created a high priority issue: https://github.com/roc-lang/basic-webserver/issues/118
Details, details... :sweat_smile: Thanks, guys!
Last updated: Jul 06 2025 at 12:14 UTC