From 0d28d5a2edb89ffd7005079f501b0c4999d7bddc Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 13 Feb 2026 15:19:22 +0200 Subject: [PATCH] v.util: fix module lookup related failures for `cd vlib/x; v test ttf` --- vlib/v/util/module.v | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/vlib/v/util/module.v b/vlib/v/util/module.v index 34f3ea9ee44b96..1fec1cd218ac0a 100644 --- a/vlib/v/util/module.v +++ b/vlib/v/util/module.v @@ -62,17 +62,6 @@ pub fn qualify_module(pref_ &pref.Preferences, mod string, file_path string) str return mod } clean_file_path := file_path.all_before_last(os.path_separator) - // relative module (relative to working directory) - // TODO: find most stable solution & test with -usecache - // - // TODO: 2022-01-30: Using os.getwd() here does not seem right *at all* imho. - // TODO: 2022-01-30: That makes lookup dependent on fragile environment factors. - // TODO: 2022-01-30: The lookup should be relative to the folder, in which the current file is, - // TODO: 2022-01-30: *NOT* to the working folder of the compiler, which can change easily. - if clean_file_path.replace(os.getwd() + os.path_separator, '') == mod { - trace_qualify(@FN, mod, file_path, 'module_res 2', mod, 'clean_file_path - getwd == mod, clean_file_path: ${clean_file_path}') - return mod - } if m1 := mod_path_to_full_name(pref_, mod, clean_file_path) { trace_qualify(@FN, mod, file_path, 'module_res 3', m1, 'm1 == f(${clean_file_path})') // > qualify_module: net | file_path: /v/cleanv/vlib/net/util.v | => module_res 3: net ; m1 == f(/v/cleanv/vlib/net)