Open shnorbluk opened 5 days ago
This is a known limitation of the tcc compiler V uses by default, not in V itself. The only options at this time are to install V in a directory with only ASCII characters in the full path, or force the use of a different (and undoubtedly much slower) C compiler.
Thank you for your quick reply. I understand that this issue come from tcc and that you cannot do anything about that.
Would it be possible to inform the user, in case of a compiler error in make.bat
, about this tcc limitation? My point is that it took me hours to find the root cause of this problem, I downloaded many precompiled versions, I tried with gcc, but all my attempts failed, and I was about to give up developing in V on my PC. And I did not find anything on Internet to workaround this issue.
So, my request, if you agree, would be to add a message in case of tcc error, saying about this non ASCII characters limitation, or a link to a page listing known tcc error causes, including this one.
I have another question: is there a way to tell v and v-analyzer to use a different directory than %USERPROFILE%\.cache
and %USERPROFILE%\.vmodules
for cache and vmodules, other than changing USERPROFILE
variable? Thank you.
Yes, you can set the environment variables VTMP
and VMODULES
to point to folders that are shorter and have only ASCII characters in them, like c:\tmp
for example.
Doing so should allow you to use V even on windows systems, where your profile name has non ASCII characters in it.
Note: VTMP
is used for generating .tmp.c files, which are later compiled with tcc.
Note 2: You can also customize VCACHE
separately, but it is usually not needed, once you change VMODULES
to a folder that has no non ASCII characters in its full path.
Describe the bug
I am a French user, and my name contains an accented character (
Noé
). On my Windows PC, with an account having this name, I cloned the v repository and called themake.bat
script to compile it, as described in installation documentation. The C compilation fails with an error about writing in temp directory.Reproduction Steps
Clone and build the v compiler, following the procedure described here:
Expected Behavior
It should build the V package without error, or at least inform the user about this issue about having special characters in
%TEMP%
directory.Current Behavior
The following output is displayed:
I can confirm that the file
C:\Users\Noé\AppData\Local\Temp\v_0\detect_tcc.01J132XD7VH3R189BH701TP8AE.tmp.c
actually exists.Possible Solution
Consider treating the directory containing intermediate C source files as an Unicode string. A simple workaround for people facing this issue is to redefine the
TEMP
environment variable, for exempleC:\Temp
Additional Information/Context
In my case, the problem was about having temp folder (as pointed by
TEMP
environment variable) containing a non ASCII character. I think you can reproduce it with any directory containing non English characters, on Windows 11 PC, or maybe even on a Linux one.V version
0.4.6 4302f86
Environment details (OS name and version, etc.)
V full version: V 0.4.6 cc14272.4302f86 OS: windows, Microsoft Windows 11 Famille v22631 64-bit Processor: 16 cpus, 64bit, little endian,
getwd: C:\v vexe: C:\v\v.exe vexe mtime: 2024-06-23 18:15:53
vroot: OK, value: C:\v VMODULES: OK, value: C:\Users\Noé.vmodules VTMP: OK, value: C:\Temp\v_0
Git version: git version 2.45.0.windows.1 Git vroot status: weekly.2024.25-6-g4302f869 (7 commit(s) behind V master) .git/config present: true
CC version: Error: 'cc' n’est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes.
thirdparty/tcc status: thirdparty-windows-amd64 b425ac82