mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.util: add a retry loop for tool compilation in launch_tool() (#14760)
This commit is contained in:
parent
7f38b92ca8
commit
5135952c9c
@ -176,10 +176,19 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) {
|
|||||||
if is_verbose {
|
if is_verbose {
|
||||||
println('Compiling $tool_name with: "$compilation_command"')
|
println('Compiling $tool_name with: "$compilation_command"')
|
||||||
}
|
}
|
||||||
tool_compilation := os.execute_or_exit(compilation_command)
|
|
||||||
if tool_compilation.exit_code != 0 {
|
retry_max_count := 3
|
||||||
eprintln('cannot compile `$tool_source`: \n$tool_compilation.output')
|
for i in 0 .. retry_max_count {
|
||||||
exit(1)
|
tool_compilation := os.execute(compilation_command)
|
||||||
|
if tool_compilation.exit_code == 0 {
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
if i == retry_max_count - 1 {
|
||||||
|
eprintln('cannot compile `$tool_source`: \n$tool_compilation.output')
|
||||||
|
exit(1)
|
||||||
|
}
|
||||||
|
time.sleep(20 * time.millisecond)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$if windows {
|
$if windows {
|
||||||
|
Loading…
Reference in New Issue
Block a user