From fd2845e955e5a81e21d91054b6c6aa87d1a71436 Mon Sep 17 00:00:00 2001 From: Joe Conigliaro Date: Wed, 10 Mar 2021 16:28:06 +1100 Subject: [PATCH] v.util: change naming behaviour for modules relative to working dir. closes #9138 --- vlib/v/util/module.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vlib/v/util/module.v b/vlib/v/util/module.v index 3f50bfe079..37ab820266 100644 --- a/vlib/v/util/module.v +++ b/vlib/v/util/module.v @@ -36,6 +36,11 @@ pub fn qualify_module(mod string, file_path string) string { return mod } clean_file_path := file_path.all_before_last('/') + // relative module (relative to working directory) + // TODO: find most stable solution & test with -usecache + if clean_file_path.replace(os.getwd() + os.path_separator, '') == mod { + return mod + } if m1 := mod_path_to_full_name(mod, clean_file_path) { $if trace_mod_path_to_full_name ? { trace_mod_path_to_full_name(@LINE, mod, clean_file_path, m1)