Installed the nightly on MacOs. (I'm a first time downloader).
roc version and roc repl run fine. Then ran:
roc run helloWorld.roc
:hammer: Rebuilding platform...
thread '<unnamed>' panicked at 'I could not find the cargo command.
Visit https://rustup.rs/ to install cargo.', crates/utils/src/lib.rs:179:9
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
thread 'main' panicked at 'Failed to (re)build platform.: Any { .. }', crates/cli/src/build.rs:344:46
Are the installation instructions missing a step? Referring to https://github.com/roc-lang/roc/blob/main/getting_started/macos_apple_silicon.md
Those instructions do include rustup, which should install cargo. Did that step give you any errors?
oh we need to change hello world to use a URL for its package
@Brian Carroll I purposely stopped after step 6, as the instructions state that this should be sufficient. I'm still confused: should the installation instructions be changed to include cargo as a mandatory step? Or will a change to helloWorld fix the problem?
also tried main.roc from https://www.roc-lang.org/tutorial#building-an-application
roc run main.roc
thread 'main' panicked at 'not yet implemented: unhandled parse error PackageEntry(IndentPackage(@30), @27)', crates/reporting/src/error/parse.rs:4015:14
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
It sounds like the hello world example requires you to actually compile the Rust code. But we have a way to download it pre-compiled from a URL. Then you wouldn't need cargo and it would be consistent with the tutorial. That's what Richard is referring to.
So yes a change to the example seems to be what's needed. Given that a lot of people are on holidays it might take a few days for someone to get time for it.
also tried main.roc from https://www.roc-lang.org/tutorial#building-an-application
roc run main.roc
thread 'main' panicked at 'not yet implemented: unhandled parse error PackageEntry(IndentPackage(@30), @27)', crates/reporting/src/error/parse.rs:4015:14
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Is this on macos x86_64?
This is on an M1 (ARM) running Ventura
I've noticed some weird issue when I copy the example from building-an-application on macOS (safari) extra newlines are introduced. Can you confirm your code looks exactly like this @Michael?
app "hello"
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br" }
imports [pf.Stdout]
provides [main] to pf
main =
Stdout.line "I'm a Roc application!"
And run with roc dev main.roc
I tried this on an m1 mac with macos 12.
Well caught @Anton ! This was indeed the problem. The code above produces the expected result. For reference, this is the code that did not run:
app "hello"
packages { pf:
"https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br"
}
imports [pf.Stdout]
provides [main] to pf
main =
Stdout.line "I'm a Roc application!"
Maybe we should make the parser a bit more robust to these newlines! Seems like we should be able to tolerate them.
Huh I'm actually kinda surprised that didn't just work. I thought I fixed that a while ago :thinking:
So copy/pasting code from the tutorial does not give the expected result. This got me curious and I looked up the source of this snippet in tutorial.md:
<pre><samp><span class="kw">app</span> <span class="str">"hello"</span>
<span class="kw">packages</span> <span class="brace">{</span> pf: <span class="str">"https://github.com/roc-lang/basic-cli/releases/download/0.1.3/5SXwdW7rH8QAOnD71IkHcFxCmBEPtFSLAIkclPEgjHQ.tar.br"</span> <span class="brace">}</span>
<span class="kw">imports</span> <span class="brace">[</span>pf.Stdout<span class="brace">]</span>
<span class="kw">provides</span> <span class="brace">[</span>main<span class="brace">]</span> <span class="kw">to</span> pf
main <span class="kw">=</span>
Stdout.line <span class="str">"I'm a Roc application!"</span>
</samp></pre>
This does not look nice at all to me, having all this HTML markup in the documentation source. May I make the suggestion to convert to Asciidoc for documentation? I'd be willing to contribute here. Asciidoc sources render nicely in github, and it's much more powerful than Markdown. An additional benefit: this would also enable the path to Antora in due course.
Joshua Warner said:
Huh I'm actually kinda surprised that didn't just work. I thought I fixed that a while ago :thinking:
I believe it is actually fixed @Joshua Warner, but I think Michael is not on the most recent nightly.
This does not look nice at all to me
I agree :)
I looked into this a bit before and we can use regular markdown code blocks where the syntax highlighting is done cleanly behind the scenes as described here. We currently use pulldown_cmark
in examples/static-site-gen/platform.
Setting up regular markdown code blocks seems like the fastest and easiest solution.
Lots of people are familiar with github flavored markdown. I also don't believe we need the more powerful features of Asciidoc. Less features often result in more simplicity. Feel free to oppose my arguments though :)
I was using roc_nightly-macos_apple_silicon-2022-12-24-25aeab9.tar.gz . Just now I downloaded roc_nightly-macos_apple_silicon-2022-12-29-db86b87.tar.gz and the issue still exists, i.e.:
thread 'main' panicked at 'not yet implemented: unhandled parse error PackageEntry(IndentPackage(@30), @27)', crates/reporting/src/error/parse.rs:4015:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
My pr that should have fixed this landed a couple months ago I think
Re the syntax highlighting, that was the best I was able to manage converting to markdown. It's definitely a short term solution and a bit handraulic. I think ideally if we can get the roc parser to support syntax highlighting then we can add that into the static-site platform to render all of the Roc code blocks nicely. :grinning_face_with_smiling_eyes:
The indentation pickiness should be improved here: https://github.com/roc-lang/roc/pull/4844
Last updated: Jul 06 2025 at 12:14 UTC