hey, I'm trying to run the basic-cli examples with the latest roc
binary and not getting a lot of success. Looks like there are some missing symbols during linking:
$ roc build hello-world.roc
🔨 Rebuilding platform...
ld: Undefined symbols:
_main, referenced from:
<initial-undefines>
_roc_dealloc, referenced from:
_decrement_refcounted_ptr_8 in roc_appkXIKOc.o
_roc_fx_stdoutLine, referenced from:
_roc_fx_stdoutLine_fastcc_wrapper in roc_appkXIKOc.o
hello-world: No such file or directory
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code Some(1)', crates/compiler/build/src/program.rs:1044:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Any ideas what could be going on here?
macos?
Any other system details?
whoops, yes. Latest macOS.
roc nightly pre-release, built from commit b1f7316fce0 on Wed Jan 3 10:32:05 UTC 2024
on basic-cli 202794db7a2cc3ba3dd3c590aa68806fd82c15c7 (current main
)
on apple silicon
hmm, can't repro on main, maybe an issue specfic to nightlies?
seems weird though cause it is failing in ld
that is interesting. Is there anything special that needs to be done to build from source now? I'm getting a bunch of missing symbols there too :thinking:
specifically it's telling me "Undefined symbols for architecture x86_64" when I try to cargo build
. Not sure why it's not ARM
(I can past the whole error if you like but it's large)
Interesting. I wonder if your system is for some reason emulating x86 with Rosetta for part of the build.
Then the symbols are missing for aarch64 despite existing for x86 or the reverse
I've had some weird stuff on this system from the get-go. Something about how I had to set up the main repo at this job means I have to pass arch -arm64
before all Homebrew commands, for instance.
but building Roc like that doesn't work:
$ arch -arm64 cargo build
arch: posix_spawnp: cargo: Bad CPU type in executable
and the arch -arm64
doesn't change the issue in the platform :thinking:
I would guess that arch -arm64
isn't recursive, so subcommands are still running via x86
I've had a lot of weird arch issues on this computer, and it looks like this might merely be the latest. I'm going to wipe it and try again.
I think this might be resolved. It turns out I had told Nix that this M2 mac was actually an Intel Mac, so it was set up all sideways to begin with. Unfortunately, I found that out by spending all day reimaging it. Sigh. (It wasn't just for this, though. I was having all sorts of weird problems that I think can be linked to this!)
YESSSSSS
$ cargo run -- run ../basic-cli/examples/hello-world.roc
Finished dev [unoptimized + debuginfo] target(s) in 0.28s
Running `target/debug/roc run ../basic-cli/examples/hello-world.roc`
🔨 Rebuilding platform...
Hello, World!
Brian Hicks has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC