Stream: beginners

Topic: ✔ basic-cli doesn't capture CLI arguments?


view this post on Zulip Dawid Danieluk (Dec 19 2024 at 16:22):

Hello, I've wanted to try out roc-start and noticed that it is not distributed as flake. I've managed to package it (I didn't see any nix buildRocPackage so I've quickly hacked something together) but when I've tried to test it it seems like basic-cli platform doesn't capture CLI arguments passed in correctly.
I've added some basic output to see what arguments does CLI platform see
https://github.com/nxy7/roc-start/blob/9ccd05d0b84f7ca53b898947331abe902a411cd5/src/main.roc#L39-L51

And it seems like it doesn't see anything (see the top of the screenshot where args list is empty)
image.png

Any ideas what might be the problem here?

view this post on Zulip Brendan Hansknecht (Dec 19 2024 at 17:04):

Should be fixed with the next release. Might also be fixed if you use --linker legacy (or potentially remove it)

view this post on Zulip Brendan Hansknecht (Dec 19 2024 at 17:04):

Its a problem with rust argument capture and musl libc

view this post on Zulip Brendan Hansknecht (Dec 19 2024 at 17:05):

Rust uses special initializer functions to capture the args (instead of getting them from main). Musl libc doesn't support the initializers.

view this post on Zulip Brendan Hansknecht (Dec 19 2024 at 17:05):

In our next release, we directly pipe in args which fixes the issue.

view this post on Zulip Dawid Danieluk (Dec 19 2024 at 17:12):

Oh, so it's known issue. Cool. If that's the case then I'll patiently wait for next release. Thanks :-)

view this post on Zulip Notification Bot (Dec 19 2024 at 17:12):

Dawid Danieluk has marked this topic as resolved.

view this post on Zulip Brendan Hansknecht (Dec 19 2024 at 17:14):

I think we should have a pre-release in the couple of days


Last updated: Jul 06 2025 at 12:14 UTC