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
Yeah, I planned to make a nice upgrade guide for the official release of 0.18.0, I'll take a look.
Your code works for me, would you just like a better error message for your original code?
I'm also going to try to adapt roc claude agent so it can make the upgrade but no promises on that :)
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.
Just for clarity; Does the code snippet that you posted work when you run it?
Nope, it doesn't. I produces the "NO PLATFORM in main.roc" error message
I was trying with latest main, let me check with nightly
Guess I need to be on main! :+1:
It works with that nightly on linux, are you on macos?
This might be some macos naming resolution difference
Yep, I am indeed... :rolling_eyes:
Yeah, can confirm I also have the same issue on both the nightly and main latest.
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
are you on an apple silicon mac? Weirdly the program works for me (M1 pro)
Yep, I'm on an M1 air...
if you nuke $HOME/.cache/roc/packages/
does that resolve it? I wonder if there's some weird state
Lemme check
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?
Screenshot 2024-12-30 at 12.35.58.png
odd
Looks normal. Would be good to double check file permissions and that main.roc actually is a complete file
Screenshot 2024-12-30 at 12.39.14.png
Screenshot 2024-12-30 at 12.38.21.png
Okay, I've got the answer
Don't kill me please!
I was running roc from the parent dir! :rolling_eyes::sweat_smile:
"Straight to jail"
banned :p
No worries :100:
:man_facepalming:
Ooh, ooh, we have an emoji now:
This is what I get for letting my coffee cup run out...
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
Did you have an empty main.roc file in the parent dir?
I had a package [] { ... }
main.roc in the parent
We should probably improve the error message to print like the first 10 lines of your main.roc file at the end
Its my playground dir, which is kinda a hot mess of old, half complete roc code lol
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!
Ian McLerran has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC