vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.63k stars 2.15k forks source link

Windows: coroutines should display a message that they don't work on Windows, instead of complaining about photonwrapper.so not found #21840

Open archyboy opened 1 month ago

archyboy commented 1 month ago

Describe the bug

\v/thirdparty/photon/photonwrapper.so' not found

Reproduction Steps

module worker

import os
import net
import time
import coroutines

pub struct Worker{
pub mut:
    id   int
    hash string
    name string
}

pub fn (m Worker) start() {
    print('Starting working process from ${m.name}')

    for i in 0 .. 10+1 {
        println('${m.name} is running ${i} times')
        coroutines.sleep(2 * time.second)
    }
}

Expected Behavior

looping trough []workers Worker array executing type method run() as coroutines

Current Behavior

tcc: error: file 'C:\Users\Archy\Devel\v/thirdparty/photon/photonwrapper.so' not found
...
==================
(Use `v -cg` to print the entire error message)

builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.6

Environment details (OS name and version, etc.)

Windows 11

[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.

JalonSolov commented 1 month ago

Coroutines are in very early WIP status. They don't work on Windows at all (the photon lib doesn't have a Windows version, though they are supposedly working on it).

Even on Linux/Mac, they are... touchy.

So this isn't actually a bug, just an unimplemented feature for Windows.

That said, the example should probably tell you that if you try to compile it on Windows.