Open markfirmware opened 1 week ago
That worked for me π€, there were no cgen errors:
#0 07:23:34 ^ opt_fixes /v/oo>mkdir -p mmm
#0 07:23:39 ^ opt_fixes /v/oo>cd mmm/
#0 07:23:40 ^ opt_fixes /v/oo/mmm>mkdir -p src/
#0 07:24:30 ^ opt_fixes /v/oo/mmm>cat src/main.v
cat: src/main.v: No such file or directory
#1 07:24:35 ^ opt_fixes /v/oo/mmm>cat > src/main.v
module main
import line
fn main() {
println('Hello World!')
}
#0 07:24:40 ^ opt_fixes /v/oo/mmm>mkdir -p src/line/
#0 07:24:48 ^ opt_fixes /v/oo/mmm>cat > src/line/line.v
module line
#0 07:25:03 ^ opt_fixes /v/oo/mmm>v src/main.v
src/main.v:2:8: warning: module 'line' is imported but never used
1 | module main
2 | import line
| ~~~~
3 |
4 | fn main() {
#0 07:25:08 ^ opt_fixes /v/oo/mmm>cat src/line/line.v
module line
#0 07:25:26 ^ opt_fixes /v/oo/mmm>
#0 07:25:26 ^ opt_fixes /v/oo/mmm>cat src/main.v
module main
import line
fn main() {
println('Hello World!')
}
#0 07:25:31 ^ opt_fixes /v/oo/mmm>tree
.
βββ src
βββ line
βΒ Β βββ line.v
βββ main
βββ main.v
2 directories, 3 files
#0 07:25:36 ^ opt_fixes /v/oo/mmm>
I am on a branch that is a few commits after current master though.
It works on latest master too:
#0 07:27:50 ^ opt_fixes /v/oo>git co master
Switched to branch 'master'
#0 07:28:18 ^ master /v/oo>git pull
Already up to date.
#0 07:28:23 ^ master /v/oo>./v self
V self compiling ...
V built successfully as executable "v".
#0 07:28:27 ^ master /v/oo>./v version
V 0.4.8 4e9b21f
#0 07:28:29 ^ master /v/oo>cd mmm/
#0 07:28:31 ^ master /v/oo/mmm>v run src/main.v
src/main.v:2:8: warning: module 'line' is imported but never used
1 | module main
2 | import line
| ~~~~
3 |
4 | fn main() {
Hello World!
#0 07:28:45 ^ master /v/oo/mmm>
I think there may be another factor involved π€ .
Can you please check, if there are sibling folders, named line
or src
in one of the parent folders of your project?
Another thing to try is v -print-v-files src/main.v
.
(v -print-v-files .
can work too, but will need a local v.mod
file)
A fresh entry with m in top worked, then I mv m src and it crashed c.
I ran v . from top, not from src
Moving m from src back to top and it works again (running v . when in top folder.)
So what I have is
module main import m
fn main() { println('Hello World!') }
module m
V doctor:
What did you do?
./v -g -o vdbg cmd/v && ./vdbg src/main.v
What did you expect to see?
What did you see instead?
Huly®: V_0.6-21159