Stream: beginners

Topic: ✔ Basic-cli 18 downloads, but then says not found


view this post on Zulip Ian McLerran (Dec 30 2024 at 17:38):

I am trying to experiment with the PI release of basic-cli v0.18.0, but getting a strange error message:

After experimenting a bit to get something which would parse without errors, I was able to put together a main! function which passed the parsing step, and roc downloaded the tarball for v18. However, after downloading, the program failed to compile with the following error:

── NO PLATFORM in main.roc ──────────────

I could not find a platform based on your input file.

Does the module header have an entry that looks like this?

    app [main] { pf: platform "…path or URL to platform…" }

Tip: The following part of the tutorial has an example of specifying a
platform:  <https://www.roc-lang.org/tutorial#building-an-application>%

Here is my code:

app [main!] { cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.18.0/0APbwVN1_p1mJ96tXjaoiUCr8NBGamr8G8Ac_DrXR-o.tar.br" }

import cli.Stdout

main! = \_args ->
    List.forEachTry! [1, 2, 3] \i ->
        Stdout.line! "Hello, $(i |> Num.toStr)!"

I am on roc version:

roc nightly pre-release, built from commit 2e2be455080 on Sat Dec 28 10:01:37 UTC 2024

view this post on Zulip Anton (Dec 30 2024 at 17:44):

Yeah, I planned to make a nice upgrade guide for the official release of 0.18.0, I'll take a look.

view this post on Zulip Anton (Dec 30 2024 at 17:49):

Your code works for me, would you just like a better error message for your original code?

view this post on Zulip Anton (Dec 30 2024 at 17:53):

I'm also going to try to adapt roc claude agent so it can make the upgrade but no promises on that :)

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:15):

Well, its not clear to me why this code doesn't work, based on the error message. If I had to guess, I'd think maybe I need to be building roc from source on the correct branch, rather than using the nightly.

If that's not it, I'm really at a loss for why my code doesn't work. The error message asks if I have a module header, which I do, so it does seem like a better error message would be helpful.

view this post on Zulip Anton (Dec 30 2024 at 18:19):

Just for clarity; Does the code snippet that you posted work when you run it?

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:22):

Nope, it doesn't. I produces the "NO PLATFORM in main.roc" error message

view this post on Zulip Anton (Dec 30 2024 at 18:22):

I was trying with latest main, let me check with nightly

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:24):

Guess I need to be on main! :+1:

view this post on Zulip Anton (Dec 30 2024 at 18:25):

It works with that nightly on linux, are you on macos?

view this post on Zulip Anton (Dec 30 2024 at 18:26):

This might be some macos naming resolution difference

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:28):

Yep, I am indeed... :rolling_eyes:

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:32):

Yeah, can confirm I also have the same issue on both the nightly and main latest.

view this post on Zulip Anton (Dec 30 2024 at 18:33):

I'll investigate and add some more macos testing with the final release archive so we catch this earlier.
You should be able to use basic-cli from source, you can build basic-cli with:

./jump-start.sh
roc build.roc --linker=legacy

view this post on Zulip Ayaz Hafiz (Dec 30 2024 at 18:33):

are you on an apple silicon mac? Weirdly the program works for me (M1 pro)

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:34):

Yep, I'm on an M1 air...

view this post on Zulip Ayaz Hafiz (Dec 30 2024 at 18:34):

if you nuke $HOME/.cache/roc/packages/ does that resolve it? I wonder if there's some weird state

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:35):

Lemme check

view this post on Zulip Ayaz Hafiz (Dec 30 2024 at 18:35):

actually i guess before that - can you share what $HOME/.cache/roc/packages/github.com/roc-lang/basic-cli/releases/download/0.18.0/0APbwVN1_p1mJ96tXjaoiUCr8NBGamr8G8Ac_DrXR-o/ looks like?

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:36):

Screenshot 2024-12-30 at 12.35.58.png

view this post on Zulip Ayaz Hafiz (Dec 30 2024 at 18:36):

odd

view this post on Zulip Brendan Hansknecht (Dec 30 2024 at 18:36):

Looks normal. Would be good to double check file permissions and that main.roc actually is a complete file

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:38):

Screenshot 2024-12-30 at 12.39.14.png
Screenshot 2024-12-30 at 12.38.21.png

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:40):

Okay, I've got the answer

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:44):

Don't kill me please!

I was running roc from the parent dir! :rolling_eyes::sweat_smile:

view this post on Zulip Sam Mohr (Dec 30 2024 at 18:44):

"Straight to jail"

view this post on Zulip Anton (Dec 30 2024 at 18:45):

banned :p

view this post on Zulip Anton (Dec 30 2024 at 18:45):

No worries :100:

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:45):

:man_facepalming:

view this post on Zulip Sam Mohr (Dec 30 2024 at 18:46):

Ooh, ooh, we have an emoji now: :grug:

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:47):

This is what I get for letting my coffee cup run out...

view this post on Zulip Anton (Dec 30 2024 at 18:48):

I was running roc from the parent dir

I still don't understand how that can output that error though, can you describe the parent dir situation in more detail

view this post on Zulip Anton (Dec 30 2024 at 18:49):

Did you have an empty main.roc file in the parent dir?

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:51):

I had a package [] { ... } main.roc in the parent

view this post on Zulip Anton (Dec 30 2024 at 18:52):

We should probably improve the error message to print like the first 10 lines of your main.roc file at the end

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:53):

Its my playground dir, which is kinda a hot mess of old, half complete roc code lol

view this post on Zulip Ian McLerran (Dec 30 2024 at 18:54):

Anton said:

We should probably improve the error message to print like the first 10 lines of your main.roc file at the end

Yes, that would be very helpful for troubleshooting PEBCAK bugs!

view this post on Zulip Anton (Dec 30 2024 at 19:03):

#7438

view this post on Zulip Notification Bot (Dec 30 2024 at 20:24):

Ian McLerran has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC