ratfactor/ziglings

error: async has not been implemented in the self-hosted compiler yet

jecepeda opened this issue ยท 9 comments

Hi, I've been doing the ziglings in the last few days, and when I got to the async part I have this error:

Compiling 084_async.zig...
/home/jcepeda/repos/ziglings/exercises/084_async.zig:51:18: error: async has not been implemented in the self-hosted compiler yet
    _ = async foo();
        ~~~~~~~~~^~
/home/jcepeda/repos/ziglings/exercises/084_async.zig:51:18: note: to use async enable the stage1 compiler with either '-fstage1' or by setting '.use_stage1 = true` in your 'build.zig' script
/home/jcepeda/repos/ziglings/exercises/084_async.zig:56:5: error: async has not been implemented in the self-hosted compiler yet
    suspend {}
    ^~~~~~~~~~
/home/jcepeda/repos/ziglings/exercises/084_async.zig:56:5: note: to use async enable the stage1 compiler with either '-fstage1' or by setting '.use_stage1 = true` in your 'build.zig' script
084_async.zig: The following command exited with error code 1:
/home/jcepeda/.zig/zig build-exe /home/jcepeda/repos/ziglings/exercises/084_async.zig --cache-dir /home/jcepeda/repos/ziglings/zig-cache --enable-cache 

HINT: Read the facts. Use the facts.
Edit exercises/084_async.zig and run this again.
To continue from this zigling, use this command:
    zig build 84

I've tried to run zig build -fstage1 83_start but it didn't work either.

Zig version: 0.10.0-dev.3685+dae7aeb33

You can use a pre build binary from here: https://ziglang.org/download/
I tested with zig version 0.10.0-dev.3685+dae7aeb33 and it works.

Hi @chrboesch I'm using the exact same version that you said.

What command do you run?

Using 0.10.0-dev.3758+ee1226438 and facing the same problem.

@jecepeda

What command do you run?

zig build 84

With the attached PR it works for me.

Sorry, I made a mistake. I used the self compiled version. ๐Ÿ˜‡

Sorry for the mess, I have 5 different zig versions, but now I found the right one.
When I use zig version 0.10.0-dev.3566+a9c4dc84f I get:

$ zig build 84
Compiling 084_async.zig...
Checking 084_async.zig...
PASSED:
foo() A
foo() C
bar

The self hosted compiler is turned on since a couple of days per default ziglang/zig@507aae4

Thanks to @bracki for enabling selective use of Stage 1 for the async exercises in the build script! We're finally back in action with the new updates! ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰