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

Unused import #21606

Open
ialbertocamilo opened this issue May 30, 2024 · 3 comments
Open

Unused import #21606

ialbertocamilo opened this issue May 30, 2024 · 3 comments
Labels
Bug This tag is applied to issues which reports bugs. Coroutines Problems related to V's coroutine implementation OS: Linux Bugs/feature requests, that are specific to Linux-based OS. Photon wrapper Photon coroutine library wrapper

Comments

@ialbertocamilo
Copy link

ialbertocamilo commented May 30, 2024

V doctor:

V full version: V 0.4.6 6b2d527
OS: linux, Ubuntu 20.04.2 LTS (WSL 2)
Processor: 4 cpus, 64bit, little endian, 11th Gen Intel(R) Core(TM) i5-11400F @ 2.60GHz

getwd: /home/svg/projects/reporting_service
vexe: /home/svg/v/v
vexe mtime: 2024-05-27 08:39:03

vroot: OK, value: /home/svg/v
VMODULES: OK, value: /home/svg/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.25.1
Git vroot status: Error: fatal: not a git repository (or any of the parent directories): .git
.git/config present: false

CC version: cc (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
thirdparty/tcc: N/A

What did you do?
v -g -o vdbg cmd/v && vdbg run.v

import os
import coroutines
import time
fn routine(){
	coroutines.sleep(1)
	ol("GAAAAAAAAAAAAAAAAAA")
	defer {
		ol("Exit on defer")
	}
}

fn ol(str string){
	println(str)
}

fn main(){
{
	ol("holaaa")

	go routine()}
}

What did you expect to see?

unused import

What did you see instead?

run.v:1:8: warning: module 'os' is imported but never used
    1 | import os
      |        ~~
    2 | import coroutines
    3 | import time
run.v:3:8: warning: module 'time' is imported but never used
    1 | import os
    2 | import coroutines
    3 | import time
      |        ~~~~
    4 | fn routine(){
    5 |     coroutines.sleep(1)
==================
tcc: error: file '/home/svg/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 .

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.

@felipensp
Copy link
Member

Unused imports warnings are correct. Right? Are you reporting the photonwrapper failing?

@ialbertocamilo
Copy link
Author

ialbertocamilo commented May 31, 2024 via email

@StunxFS
Copy link
Contributor

StunxFS commented May 31, 2024

@ialbertocamilo photonwrapper is necessary, because it is used for coroutines.

Warnings ok, build fails due to no compiled version of photonwrapper

@spytheman spytheman added OS: Linux Bugs/feature requests, that are specific to Linux-based OS. Bug This tag is applied to issues which reports bugs. Coroutines Problems related to V's coroutine implementation Photon wrapper Photon coroutine library wrapper labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Coroutines Problems related to V's coroutine implementation OS: Linux Bugs/feature requests, that are specific to Linux-based OS. Photon wrapper Photon coroutine library wrapper
Projects
None yet
Development

No branches or pull requests

4 participants