From 7add6e7d5126601e49cba91b69b4371b85f20ff3 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 25 Aug 2023 20:39:01 +0300 Subject: [PATCH] tools: make repeated runs of `oldv SAME_COMMIT -c "./v file.v"`, not use the network at all --- cmd/tools/modules/vgit/vgit.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/tools/modules/vgit/vgit.v b/cmd/tools/modules/vgit/vgit.v index 81aae98ab9..584b870d82 100644 --- a/cmd/tools/modules/vgit/vgit.v +++ b/cmd/tools/modules/vgit/vgit.v @@ -140,6 +140,11 @@ pub mut: pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() { vgit_context.vexename = if os.user_os() == 'windows' { 'v.exe' } else { 'v' } vgit_context.vexepath = os.real_path(os.join_path_single(vgit_context.path_v, vgit_context.vexename)) + if os.is_dir(vgit_context.path_v) && os.is_executable(vgit_context.vexepath) { + // already compiled, no need to compile that specific v executable again + vgit_context.commit_v__hash = get_current_folder_commit_hash() + return + } mut command_for_building_v_from_c_source := '' mut command_for_selfbuilding := '' if 'windows' == os.user_os() {