Stream: beginners

Topic: roc dev not working


view this post on Zulip bernardino (Aug 14 2024 at 09:06):

noob who just installed roc (hopefully) and is trying to follow the tutorial. When i roc dev I get the following error:

roc dev
libc++abi: terminating due to uncaught exception of type std::runtime_error: file is already signed. pass -f to sign regardless.
thread 'main' panicked at crates/compiler/build/src/program.rs:1031:17:
not yet implemented: gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code None
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I have no clue what to do. I am on MacOs silicon m1 MacBook Air. Thanks for any suggestions

view this post on Zulip Anton (Aug 14 2024 at 09:11):

Hi @bernardino,
Can you share your macos version?

view this post on Zulip bernardino (Aug 14 2024 at 09:13):

Screenshot-2024-08-14-alle-11.12.40.png
HI @Anton sure!

view this post on Zulip Anton (Aug 14 2024 at 09:14):

Thanks, I'll try to reproduce and resolve your issue today

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:17):

Are you able to provide any more information to help me reproduce?

Screenshot-2024-08-14-at-19.17.49.png

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:18):

Are you using one of the nightlies downloaded from the website or through nix?

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:26):

(deleted)

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:29):

Compiled from source

$ file /Users/luke/Documents/GitHub/roc/target/release/roc
/Users/luke/Documents/GitHub/roc/target/release/roc: Mach-O 64-bit executable arm64

view this post on Zulip bernardino (Aug 14 2024 at 09:30):

Yes, I am - just basically following the installation instructions
Screenshot-2024-08-14-alle-11.29.47.png
I am pretty sure I am missing something obvious here :=

view this post on Zulip bernardino (Aug 14 2024 at 09:31):

I exported to PATH and I am not running roc dev from the installation folder .... I don't see how that could be it though

view this post on Zulip bernardino (Aug 14 2024 at 09:32):

I downloaded with curl -OL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_apple_silicon-latest.tar.gz

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:33):

Oh yeah, I goofed up. I hadn't realised the terminal I was in was ssh'd into my linux machine.

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:34):

19:33:26 ~/roc_nightly-macos_apple_silicon-2024-07-13-070d14a5d60 $ ls
LEGAL_DETAILS       crates          lib         main.roc        roc_language_server
LICENSE         examples        main            roc
19:33:54 ~/roc_nightly-macos_apple_silicon-2024-07-13-070d14a5d60 $ file ./roc
./roc: Mach-O 64-bit executable arm64
19:33:58 ~/roc_nightly-macos_apple_silicon-2024-07-13-070d14a5d60 $ ./roc main.roc
I'm a Roc application!

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:34):

Works ok for me

view this post on Zulip bernardino (Aug 14 2024 at 09:36):

Screenshot-2024-08-14-alle-11.35.45.png
I get the same problem even within the install dir

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:36):

@bernardino have you created the main.roc file as in the tutorial?

view this post on Zulip Luke Boswell (Aug 14 2024 at 09:37):

FWIW I don't think you are doing anything wrong. It all looks ok -- there must be a bug here I think.

view this post on Zulip bernardino (Aug 14 2024 at 09:37):

I literally copy-pasted
main.roc

view this post on Zulip Luke Boswell (Aug 14 2024 at 10:01):

I must have installed a library or something at some point using homebrew. Maybe it was an xcode thing.

view this post on Zulip Anton (Aug 14 2024 at 10:26):

I can't reproduce this either with same OS version and m2 cpu but there are some things we can try.

@bernardino can you try running xcode-select --install in the terminal and try roc dev main.roc again?

If that does not work, this may be a temporary workaround:

roc dev main.roc --linker=legacy

view this post on Zulip bernardino (Aug 14 2024 at 10:34):

Screenshot-2024-08-14-alle-12.34.03.png

view this post on Zulip bernardino (Aug 14 2024 at 10:35):

Still not successful ;(
I tried uninstalling and reinstalling from scratch by the way

view this post on Zulip Anton (Aug 14 2024 at 11:32):

I have an idea for a possible fix, I'll make a release for you to try...

view this post on Zulip bernardino (Aug 14 2024 at 12:05):

Thanks @Anton

view this post on Zulip Anton (Aug 14 2024 at 13:31):

Can you try this?

view this post on Zulip bernardino (Aug 14 2024 at 13:49):

Screenshot-2024-08-14-alle-15.49.06.png nope sorry @Anton

view this post on Zulip Anton (Aug 14 2024 at 14:38):

Can you share the output of which codesign? I think you've got something similar going on as here.

view this post on Zulip bernardino (Aug 14 2024 at 14:49):

Screenshot-2024-08-14-alle-16.49.00.png

view this post on Zulip Anton (Aug 14 2024 at 14:49):

bingo

view this post on Zulip Anton (Aug 14 2024 at 14:51):

Hang on, I'm going to find you a proper fix because your codesign setup will cause problems for other programs as well

view this post on Zulip bernardino (Aug 14 2024 at 14:51):

So this codesign library should be in a different path? I'm not sure I know what it is .... :face_with_diagonal_mouth:

view this post on Zulip Anton (Aug 14 2024 at 14:54):

Can you do cat ~/.zshrc | grep anaconda and share the output?

view this post on Zulip bernardino (Aug 14 2024 at 14:59):

Screenshot-2024-08-14-alle-16.59.40.png

view this post on Zulip Anton (Aug 14 2024 at 15:04):

Yes, as expected, can you edit ~/.zshrc and replace export PATH="/Users/bernardino/opt/anaconda3/bin:$PATH" with export PATH="$PATH:/Users/bernardino/opt/anaconda3/bin"?

view this post on Zulip Anton (Aug 14 2024 at 15:08):

After you have edited and saved that file, open a new terminal and roc dev main.roc should work

view this post on Zulip bernardino (Aug 14 2024 at 15:12):

Screenshot-2024-08-14-alle-17.11.49.png
This is what I see in my zsrch you mean edit the line inside the conditional? Won't that bork potentially other stuff? Forgive me, I have very little idea about all this

view this post on Zulip Anton (Aug 14 2024 at 15:23):

Won't that bork potentially other stuff?

If you already had python or pip installed before anaconda, it may use those instead of the anaconda ones. A completely safe alternative would be to execute export PATH="/usr/bin:$PATH" once in the terminal before you use roc.

I have a fix ready that will fix this in future Roc releases, but it will take a while before a new nightly comes out.

view this post on Zulip bernardino (Aug 14 2024 at 15:25):

Screenshot-2024-08-14-alle-17.24.59.png
Hey! That worked!!!! Thanks so much for your patience and assistance. (I have no idea what just went on but cool)

view this post on Zulip Anton (Aug 14 2024 at 15:26):

If you ever have any codesign problems with other programs, running export PATH="/usr/bin:$PATH" should always fix it

view this post on Zulip Anton (Aug 14 2024 at 15:27):

I'll make an issue with the folks from anaconda to see if this can be prevented

view this post on Zulip Anton (Aug 17 2024 at 08:14):

@bernardino, can you reply on the anaconda issue here?

view this post on Zulip bernardino (Aug 17 2024 at 08:30):

Hey @Anton I happily would but I am not sure what I used...


Last updated: Jul 06 2025 at 12:14 UTC