Skip to content
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

Got C error found. It should never happen, when compiling pure V code. while running a simple vsh script contains a Hello print #23520

Open
Mahmoud-Emad opened this issue Jan 19, 2025 · 4 comments

Comments

@Mahmoud-Emad
Copy link

Mahmoud-Emad commented Jan 19, 2025

V version: V 0.4.9 a93d94a, press to see full `v doctor` output
V full version V 0.4.9 462f186.a93d94a
OS linux, Ubuntu 24.04.1 LTS
Processor 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory 0.94GB/15.38GB
V executable /home/thunder/v/v
V last modified time 2025-01-19 10:23:06
V home dir OK, value: /home/thunder/v
VMODULES OK, value: /home/thunder/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /home/thunder/code/github/freeflowuniverse/herolib/lib/clients/runpod
Git version git version 2.43.0
V git status weekly.2025.1-80-ga93d94aa
.git/config present true
cc version cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
gcc version gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
clang version Ubuntu clang version 18.1.3 (1ubuntu1)
tcc version N/A
tcc git status thirdparty-linux-amd64 0134e9b9-dirty
emcc version N/A
glibc version ldd (Ubuntu GLIBC 2.39-0ubuntu8.3) 2.39

What did you do?
./v -g -o vdbg cmd/v && ./vdbg /home/thunder/code/github/freeflowuniverse/herolib/examples/develop/runpod/runpod_example.vsh && /home/thunder/code/github/freeflowuniverse/herolib/examples/develop/runpod/runpod_example

#!/usr/bin/env -S v -n -w -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run

import freeflowuniverse.herolib.core.base
import freeflowuniverse.herolib.lib.clients.runpod

println('Hello!')
// // Example 1: Create client with direct API key
// mut rp := runpod.get_or_create(
// 	name:    'example1'
// 	api_key: 'your-api-key-here'
// )!

// // Create an endpoint
// mut endpoint := runpod.Endpoint{
// 	name:         'test-endpoint'
// 	runtime:      'nvidia/cuda:11.6.2-base-ubuntu20.04'
// 	min_workers:  1
// 	max_workers:  3
// 	idle_timeout: 300
// 	gpu_ids:      ['NVIDIA GeForce RTX 3080']
// }
// endpoint_id := rp2.create_endpoint(endpoint)!
// println('Created endpoint with ID: ${endpoint_id}')

What did you see?

================== C compilation error (from cc): ==============
cc: /tmp/v_1000/runpod_example.01JHZ1TYKH1H0RZ7822K78EE8F.tmp.c:639:17: error: unknown type name ‘None__’
cc:   639 |                 None__* _None__;
cc:       |                 ^~~~~~
cc: /tmp/v_1000/runpod_example.01JHZ1TYKH1H0RZ7822K78EE8F.tmp.c:641:17: error: unknown type name ‘Error’
cc:   641 |                 Error* _Error;
cc:       |                 ^~~~~
cc: /tmp/v_1000/runpod_example.01JHZ1TYKH1H0RZ7822K78EE8F.tmp.c:642:17: error: unknown type name ‘MessageError’
cc:   642 |                 MessageError* _MessageError;
cc:       |                 ^~~~~~~~~~~~
cc: /tmp/v_1000/runpod_example.01JHZ1TYKH1H0RZ7822K78EE8F.tmp.c:643:17: error: unknown type name ‘os__Eof’
cc:   643 |                 os__Eof* _os__Eof;
cc:       |                 ^~~~~~~
... (the original output was 5142 lines long, and was truncated to 12 lines)
================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
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 .

What did you expect to see?

print Hello!

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.

Copy link

Connected to Huly®: V_0.6-21949

@felipensp
Copy link
Member

@Mahmoud-Emad why closing it?

@JalonSolov
Copy link
Contributor

Looks like the problem is in whatever herolib is, but even so, V should be catching it and giving a nicer error (if it can).

@JalonSolov JalonSolov reopened this Jan 19, 2025
@Mahmoud-Emad
Copy link
Author

@felipensp @JalonSolov
I have a directory inside the herolib called lib, I used this lib in the import line, and the error is solved after removing it, but if so, the V compailer should handle this and give the developer a readable error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants