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

V builder cache system do not compile updated file on Windows #23388

Closed
kbkpbot opened this issue Jan 6, 2025 · 4 comments
Closed

V builder cache system do not compile updated file on Windows #23388

kbkpbot opened this issue Jan 6, 2025 · 4 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@kbkpbot
Copy link
Contributor

kbkpbot commented Jan 6, 2025

Describe the bug

It seems that v builder cache system has some bug on Windows.
It just not recompile the updated vlib file.

Reproduction Steps

  1. create a hello.v
module main
fn main() {
    println('hello')
}
  1. update some vlib file, for example, vlib/os/os_windows.c.v line 354:
	command_line := [32768]u16{}
	dump(pcmd)
	C.ExpandEnvironmentStringsW(pcmd.to_wide(), voidptr(&command_line), 32768)
  1. compile hello.v.

  2. Again, update vlib/os/os_windows.c.v line 354:

	command_line := [32768]u16{}
	dump(pcmd)
        println('==============>')
	C.ExpandEnvironmentStringsW(pcmd.to_wide(), voidptr(&command_line), 32768)
  1. compile hello.v again.

Expected Behavior

see a updated compile result:

D:\v\bug>v hello.v
[D:\\v\\v\\v\\vlib\\os\\os_windows.c.v:355] pcmd: cmd /c ""D:\v\v\v\thirdparty\tcc\tcc.exe" -v 2>&1"
==============>
[D:\\v\\v\\v\\vlib\\os\\os_windows.c.v:355] pcmd: cmd /c ""D:\v\v\v\thirdparty\tcc\tcc.exe" "@C:\Users\DDT\AppData\Local\Temp\v_0\hello.01JGWJSKACZN4AMYB6M7MYPF3W.tmp.c.rsp" 2>&1"
==============>

Current Behavior

old compile result:

D:\v\bug>v hello.v
[D:\\v\\v\\v\\vlib\\os\\os_windows.c.v:355] pcmd: cmd /c ""D:\v\v\v\thirdparty\tcc\tcc.exe" -v 2>&1"
[D:\\v\\v\\v\\vlib\\os\\os_windows.c.v:355] pcmd: cmd /c ""D:\v\v\v\thirdparty\tcc\tcc.exe" "@C:\Users\DDT\AppData\Local\Temp\v_0\hello.01JGWJYYQ6CTSAP13NABHXEWAC.tmp.c.rsp" 2>&1"

Possible Solution

Sometime update hello.v can work, sometime not.
Or run v doctor , this will update cache? and compile with newly updated os_windows.c.v

Additional Information/Context

No response

V version

V 0.4.9 7040514.738f847

Environment details (OS name and version, etc.)

V full version V 0.4.9 7040514.738f847
OS windows, Microsoft Windows 10 企业版 LTSC 19044 64 位
Processor 16 cpus, 64bit, little endian, AMD Ryzen 7 7840H with Radeon 780M Graphics
Memory 19.83GB/27.69GB
V executable D:\v\v\v\v.exe
V last modified time 2025-01-06 00:54:47
V home dir OK, value: D:\v\v\v
VMODULES OK, value: C:\Users\DDT.vmodules
VTMP OK, value: C:\Users\DDT\AppData\Local\Temp\v_0
Current working dir OK, value: D:\v\bug
Git version git version 2.43.0.windows.1
V git status weekly.2024.53-37-g738f847f-dirty
.git/config present true
cc version N/A
gcc version N/A
clang version N/A
msvc version 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.39.33523 版
tcc version tcc version 0.9.28rc 2024-12-30_mob@68000c01* (x86_64 Windows)
tcc git status N/A
emcc version N/A
glibc version N/A

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.

@kbkpbot kbkpbot added the Bug This tag is applied to issues which reports bugs. label Jan 6, 2025
@JalonSolov
Copy link
Contributor

Are you certain that file is involved when compiling hello_world.v? I wouldn't expected it to be recompiled if it wasn't used.

@kbkpbot
Copy link
Contributor Author

kbkpbot commented Jan 6, 2025

Are you certain that file is involved when compiling hello_world.v? I wouldn't expected it to be recompiled if it wasn't used.

OK, I find out that I should run v self compile the compiler first, that will use the newly updated vlib files.

@kbkpbot kbkpbot closed this as completed Jan 6, 2025
@spytheman
Copy link
Member

The compiler itself is a V program, and if you want to debug it, you have to recompile it.

@spytheman
Copy link
Member

I usually prefer: v -o vnew self, then to use vnew file.v - that way I can keep the old V executable, while having access to the instrumented/debugged/updated version too.

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.
Projects
None yet
Development

No branches or pull requests

3 participants