Stream: beginners

Topic: rebuilding platform forever


view this post on Zulip Georges Boris (Sep 26 2022 at 21:26):

hey folks - I've tried testing the cli platform once more and it successfully builds the binary but I have to force quit the process either way. any one else? this is the code:

app "hangman"
    packages { pf: "../roc/examples/interactive/cli-platform/main.roc" }
    imports [
        pf.Program.{ Program, ExitCode },
        pf.Stdout,
        pf.Stdin,
        pf.Task.{ Task },
    ]
    provides [main] to pf

main : Program
main =
    Program.noArgs mainTask

mainTask : Task ExitCode [] [Read [Stdin], Write [Stdout]]
mainTask =
    line <- Stdin.line |> Task.await
    Stdout.line "Got: \(line)"
    |> Program.exit 0

view this post on Zulip Richard Feldman (Sep 26 2022 at 21:35):

so it waits on stdin forever and never prints "Got: "?

view this post on Zulip Georges Boris (Sep 26 2022 at 21:47):

@Richard Feldman if I run the program it works normally - the problem happens when I compile the binary. It gets stuck on "Rebuilding platform..." forever. But if I kill the process it actually succeeded and the binary is already then. (I'm running the current main built from source on a non-M1 Mac)

view this post on Zulip Folkert de Vries (Sep 26 2022 at 21:49):

if the platform is really there, you can pass the --prebuilt-platform=true flag

view this post on Zulip Folkert de Vries (Sep 26 2022 at 21:50):

though maybe not on an M1 machine

view this post on Zulip Richard Feldman (Sep 26 2022 at 22:03):

yeah that flag doesn't do anything on M1 yet

view this post on Zulip Richard Feldman (Sep 26 2022 at 22:04):

@Georges Boris is there a branch pushed somewhere I could try? I have an M1

view this post on Zulip Georges Boris (Sep 26 2022 at 22:05):

Sorry folks - my bad. I was taking roc as roc build and I got confused since it both built and ran the program. The "getting stuck" was just the program waiting for the line (as part of the program running). I just remembered about roc dev and roc build and things made sense again! Thank you.

view this post on Zulip Brendan Hansknecht (Sep 26 2022 at 22:48):

yeah that flag doesn't do anything on M1 yet

It still works. It just assumes the platform was already compiled and skips rebuilding it.


Last updated: Jul 06 2025 at 12:14 UTC