-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coroutines fail to build #20857
Comments
I just want to thank you for the detailed investigation 🙇🏻♂️ . |
Oh so the weird thing is with clang there is only one error regarding 'pthread_getattr_np' which is interesting. all the other symbols are found, I have seen that error before also on my vm. It must just be how I built it, I will get it rebuilt asap, need to setup another VM. |
Hi @Varpie I have updated v -cg -use-coroutines examples/coroutines/simple_coroutines.v if it compiles you will need to run it like this for now (so it knows where to find LD_LIBRARY_PATH=./thirdparty/photon ./examples/coroutines/simple_coroutines btw I also get this error with clang: |
I've tried to run I don't have tcc installed on my system, so it uses the tcc shipped with V, which is the most surprising to me. At this point, I expect the other ones to fail because of a missing static library (maybe my Linux isn't configured with GNU's pthread, so it is lacking the |
tcc ships with V because tcc in most systems out there is more than 2 years out of date, and won't work properly for V. |
FYI... I just tried the compile line, and got this (with latest V):
|
Then I tried deleting the
|
It's odd that V didn't try to download |
Oh, it did, but in an intermediate run... that part worked. |
Alright, I got past the missing And I have the same errors for tcc, gcc and clang: undefined references to the following:
|
A few interesting things to note: If I remove
Those are presumably only from the use of
This seems to be more errors than earlier, so it seems like the newly compiled |
This is odd indeed, something else is going on here. its almost like it's completely missed |
I got the messages about missing |
Ohh in your case if you delete |
Yep, that did it for tcc!
and gcc!
clang, though? Ouch...
|
@JalonSolov I know what the clang thing is :) Ill get it fixed, there so many different versions of these pthread functions :D |
@JalonSolov it seems like the clang message only has one error, that could be fixed by adding |
Hi @Varpie yeah we can either do that, or use the functions from the clang headers (which i think may be the better long term option, since everything else is expecting those) |
Describe the bug
On a fresh installation of V, I am not able to run the
simple_coroutines.v
example.The error shown is as follows (more detailed errors in the following sections):
Reproduction Steps
./v -use-coroutines examples/coroutines/simple_coroutines.v
from the base repo of your newly created V installationExpected Behavior
The coroutines .so should be downloaded, then the file should compile successfully.
Current Behavior
Possible Solution
No response
Additional Information/Context
V is up to date, the photonwrapper.so has been successfully downloaded (the same issue happens if I manually download it to be sure that it is the correct file).
I tried to come up with a more minimal example to reproduce the issue, in order to get to the root cause.
Adding the
-use-coroutines
flag fails with a simple hello world:This is unexpected, as it should see that no
go
instruction is used and compile the hello world like if the-use-coroutines
flag wasn't used.I tried to create a minimal example with
go
, inspired by the doc's concurrency section:It runs correctly without
-use-coroutines
, using native threads as described in the documentation.When I try with
-use-coroutines
, I get the same error as above, but this time with an extra failing function (which corresponds to the addedgo
):I got from #20834 that it may be because it is lacking
import coroutines
(even if it isn't used in the code), so I tried to add it. As there is a folderexamples/coroutines
that would be used by theimport coroutines
, I also had to move the file in a different folder.It gives a different error:
And with the added
import coroutines
, the compilation also fails without using the coroutine flag:The same error happens when using clang (version 16.0.6, thread model posix):
and gcc (version 13.2.1 20230801):
V version
0.4.4 298a2a2
Environment details (OS name and version, etc.)
V full version: V 0.4.4 298a2a2
OS: linux, "Arch Linux"
Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
getwd: ~/[...]/v
vexe: ~/[...]/v/v
vexe mtime: 2024-02-17 10:15:13
vroot: OK, value: ~/[...]/v
VMODULES: OK, value: ~/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.43.1
Git vroot status: 8ae0551
.git/config present: true
CC version: cc (GCC) 13.2.1 20230801
thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5
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.
The text was updated successfully, but these errors were encountered: