v.util: add support for setting VUTIL_RETRY_MAX_COUNT=1 to ease the workflow for developing backends

This commit is contained in:
Delyan Angelov 2025-07-29 19:41:10 +03:00
parent 6915a5a1b5
commit efd6eccadc
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -154,7 +154,9 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) {
mut l := filelock.new(lockfile)
if l.try_acquire() {
tlog('lockfile acquired')
tool_recompile_retry_max_count := 7
tool_recompile_retry_max_count := int_max(1, os.getenv_opt('VUTIL_RETRY_MAX_COUNT') or {
'7'
}.int())
for i in 0 .. tool_recompile_retry_max_count {
tlog('looping i: ${i} / ${tool_recompile_retry_max_count}')
// ensure a stable and known working folder, when compiling V's tools, to avoid module lookup problems: