V version: 68b7ae2 fix tests
OS: Microsoft Windows [Version 10.0.17763.557]
What did you do?
clone repo, get _https://github.com/vlang/v/releases/download/v0.1.12/v.zip_, unpack _v_windows.exe_ from it.
What did you expect to see?
bootstrapped V
What did you see instead?
_V repo not found. Go to https://vlang.io to download V.zip
or install V from source._
D:\tmp\v>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=e:/devel/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=win32 --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-win32-seh-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib-static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: win32
gcc version 8.1.0 (x86_64-win32-seh-rev0, Built by MinGW-W64 project)
D:\tmp\v>v_windows.exe -o v.exe compiler
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
D:\tmp\v\>cd compiler && ..\v_windows.exe -o ..\v.exe compiler
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
D:\tmp\v>cd .. && v_windows.exe examples\hello_world.v
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
D:\tmp\v>cd examples && ..\v_windows.exe hello_world.v
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
@hhrhhr have you cloned the github repo in the v directory? oops i just read you did, weird i cant replicate your issue.
@hhrhhr try moving it to your main disk (e: or c:)
@medvednikov, drive D: no different from the other partitions.
I try again:
d:\tmp\v>git pull && git describe --tags
Already up to date.
v0.1.12-32-gf630d3f
d:\tmp\v>make.bat
d:\tmp\v>curl -O https://raw.githubusercontent.com/vlang/vc/master/v.c
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 327k 100 327k 0 0 327k 0 0:00:01 --:--:-- 0:00:01 598k
d:\tmp\v>gcc -std=gnu11 -w -o v.exe v.c
d:\tmp\v>del v.c
d:\tmp\v>v.exe
V 0.1.12
Use Ctrl-D or `exit` to exit
For now you have to use println() to print values, this will be fixed soon
>>> println('hello world')
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
d:\tmp\v>v.exe -o v1.exe compiler
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
d:\tmp\v>dir vlib\builtin
---cut---
06.07.2019 10:06 <DIR> .
06.07.2019 10:06 <DIR> ..
06.07.2019 10:06 4Β 693 array.v
06.07.2019 10:06 2Β 296 array_test.v
06.07.2019 10:06 1Β 679 builtin.v
06.07.2019 10:06 3Β 047 int.v
06.07.2019 10:06 3Β 163 map.v
06.07.2019 10:06 578 map_test.v
06.07.2019 10:06 586 option.v
06.07.2019 10:06 14Β 677 string.v
06.07.2019 10:06 5Β 512 string_test.v
06.07.2019 10:06 2Β 984 utf8.v
Now I am trying to use the compiler from https://github.com/vlang/v/releases/download/v0.1.12/v.zip and unpack it on drive E:
e:\v>v_windows.exe
V 0.1.12
Use Ctrl-D or `exit` to exit
For now you have to use println() to print values, this will be fixed soon
>>> println('hello world')
Looks like you are running V for the first time.
Setting VROOT to "e:\v".
"C:\Users\user//.vlang//vrepl" Π½Π΅ ΡΠ²Π»ΡΠ΅ΡΡΡ Π²Π½ΡΡΡΠ΅Π½Π½Π΅ΠΉ ΠΈΠ»ΠΈ Π²Π½Π΅ΡΠ½Π΅ΠΉ
ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ, ΠΈΡΠΏΠΎΠ»Π½ΡΠ΅ΠΌΠΎΠΉ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΎΠΉ ΠΈΠ»ΠΈ ΠΏΠ°ΠΊΠ΅ΡΠ½ΡΠΌ ΡΠ°ΠΉΠ»ΠΎΠΌ.
>>> ^C
e:\v>v_windows.exe examples\hello_world.v
Looks like you are running V for the first time.
Setting VROOT to "e:\v".
failed to create C:\Users\user//.vlang//examples\hello_world.c
Apparently, the damned HOMEPATH again.
@medvednikov suggestion: why don't let the compiler create the intermediate files in the same directory as the executable being produced? Provide a compiler flag to override this behavior and specify where to put them. That is, .c intermediate files are for the V compiler like object files (.o) of C compilers, which provide the -o command line option.
P.S.: I did this small experiment:
v.c to v.exev.exe I compiled the compilers sources: v.exe -o v2.exe compilerv2.exe I compiled the compilers sources: v2.exe -o v3.exe compilerfc /A /B v2.exe v3.exe and it found just a small difference:00000088: 46 5D
000000D8: 7D 96
000000D9: 2D 2E
000487CC: 32 33
0005FF06: 32 33
0007088B: 32 33
strip v2.exe v3.exe and compared the two files again: no difference found.On Windows it has still problems in compiling examples but I consider this version a success anyway. Of course, when the compiler will produce native binaries directly the result of this test will be much more meaningful.
Maybe this is related to having spaces in the user name. See PR #1026
@aguspiza probably. The interesting thing is that I have v.exe in a path with spaces now and I don't have any problem (but HOMEPATH is without spaces). I tried to compile an example .v file in a directory with spaces and, again, it works. So it was just the temporary files management in HOMEPATH\.vlang that was problematic, it seems.
Issue still persist on 0.1.13
Issue still persist on 0.1.14
In v.c in method os__dir_exists there is return attr == os__FILE_ATTRIBUTE_DIRECTORY
I think it should be return (attr & os__FILE_ATTRIBUTE_DIRECTORY) == os__FILE_ATTRIBUTE_DIRECTORY;
On my machine GetFileAttributes returns 2064 which is os__FILE_ATTRIBUTE_DIRECTORY and something about compressed files.
Also I had to manually create examples directory in %homepath%/.vlang
No more errors on my machine.
edit:
Sorry, i thought examples is hardcoded dir for generated c code, but i had this problem because of the way I tried to run hello world example.
When i go one dir up and try to run example like this there is error again:
v v\examples\hello_world.v
failed to create C:\Users\tomi//.vlang//v\examples\hello_world.c
gcc: error: C:\Users\tomi//.vlang//v\examples\hello_world.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
V panic: clang error
btw. why is v.c stored separately?
According to the above advice, I applied a patch:
diff --git a/vlib/os/os.v b/vlib/os/os.v
index 973822e..462e873 100644
--- a/vlib/os/os.v
+++ b/vlib/os/os.v
@@ -317,7 +317,7 @@ pub fn file_exists(path string) bool {
pub fn dir_exists(path string) bool {
$if windows {
attr := int(C.GetFileAttributes(path.cstr()))
- return attr == FILE_ATTRIBUTE_DIRECTORY
+ return (attr & FILE_ATTRIBUTE_DIRECTORY) > 0
}
$else {
dir := C.opendir(path.cstr())
and rebuilt V:
> curl -O https://raw.githubusercontent.com/vlang/vc/master/v.c
> gcc -std=gnu11 -w -o v.exe v.c
> vc.exe -prod -o v.exe compiler
Πfter that, all temporary files are created without creating subdirectories:
> v.exe -o life.exe examples\game_of_life\life.v
> d:\tmp\v>dir /b %USERPROFILE%\.vlang
life.exe.c
VROOT
Does it work for you now @hhrhhr ?
Yes, almost everything is fine now.
> git pull && git describe --tags
Already up to date.
0.1.15-28-g53ac6d3`
> gcc -v
-- cut --
Target: x86_64-w64-mingw32
Thread model: win32
gcc version 8.1.0 (x86_64-win32-seh-rev0, Built by MinGW-W64 project)
> curl -sO https://raw.githubusercontent.com/vlang/vc/master/v.c
> gcc -std=gnu11 -w -o vc.exe v.c
> vc.exe -o v1.exe compiler
> v1.exe -o v2.exe compiler
> strip *.exe | |
> fc v1.exe v2.exe
Π‘ΡΠ°Π²Π½Π΅Π½ΠΈΠ΅ ΡΠ°ΠΉΠ»ΠΎΠ² v1.exe ΠΈ V2.EXE
FC: ΡΠ°Π·Π»ΠΈΡΠΈΡ Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½Ρ
> v2.exe
V 0.1.15
Use Ctrl-C or `exit` to exit
>>> println('hello')
hello
>>> exit
But there are problems with relative paths:
> v2.exe examples\game_of_life
check()
next token = `time`
panic: life.v:1
expected `module` but got `import`
> v2.exe examples\game_of_life\life.v
failed to create .examples\game_of_life\life.c
gcc: error: .examples\game_of_life\life.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
V panic: clang error
Only work like this:
> v2.exe -o life.exe examples\game_of_life\life.v
> cd examples\game_of_life && ..\..\v2.exe life.v && cd ..\..
life.v is a single file program since it doesn't have module main, so it has to be built with v life.v.
v2.exe examples\game_of_life\life.v
This will be fixed today, it's a quick fix.