From bf29124d3b7d766aca92767dd63a4eb7b4a3ba81 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 8 Feb 2026 22:18:02 +0200 Subject: [PATCH] all: replace remaining active usages of the long deprecated @VROOT in various tools/tests with @VEXEROOT --- ci/common/runner.v | 3 ++- cmd/tools/install_wabt.vsh | 4 ++-- cmd/tools/vmissdoc.v | 3 ++- vlib/db/sqlite/install_thirdparty_sqlite.vsh | 2 +- vlib/encoding/vorbis/vorbis_test.v | 2 +- vlib/sokol/README.md | 2 +- vlib/toml/tests/toml_lang_test.v | 2 +- vlib/toml/tests/toml_rs_test.v | 2 +- vlib/v/builder/builder.v | 2 +- vlib/v/builder/cc.v | 2 +- vlib/v/gen/native/tests/native_test.v | 2 +- vlib/v/generics/new_generics_regression_test.v | 4 ++-- vlib/v/pref/default.v | 4 ++-- vlib/v/tests/bench/math_big_gcd/bench_euclid.v | 2 +- vlib/v/tests/bench/math_big_gcd/prime/maker.v | 2 +- vlib/v/tests/builtin_arrays/array_access_optimisation_test.v | 2 +- vlib/v/tests/consts/const_init_order_test.v | 2 +- vlib/v/tests/trace_calls_test.v | 4 ++-- vlib/v/vmod/vmod.v | 2 +- vlib/wasm/tests/common.v | 2 +- 20 files changed, 26 insertions(+), 24 deletions(-) diff --git a/ci/common/runner.v b/ci/common/runner.v index 7469f20d4..0a209957e 100644 --- a/ci/common/runner.v +++ b/ci/common/runner.v @@ -38,7 +38,8 @@ pub fn file_size_greater_than(fpath string, min_fsize u64) { } const self_command = 'v ' + - os.real_path(os.executable()).replace_once(os.real_path(@VROOT), '').trim_left('/\\') + '.vsh' + os.real_path(os.executable()).replace_once(os.real_path(@VEXEROOT), '').trim_left('/\\') + + '.vsh' pub const is_github_job = os.getenv('GITHUB_JOB') != '' diff --git a/cmd/tools/install_wabt.vsh b/cmd/tools/install_wabt.vsh index 5b2a97490..9c248da0d 100755 --- a/cmd/tools/install_wabt.vsh +++ b/cmd/tools/install_wabt.vsh @@ -4,8 +4,8 @@ import os import net.http fn main() { - os.chdir(@VROOT)! // make sure that the workfolder is stable - tloc := os.join_path(@VROOT, 'thirdparty') + os.chdir(@VEXEROOT)! // make sure that the workfolder is stable + tloc := os.join_path(@VEXEROOT, 'thirdparty') loc := os.join_path(tloc, 'wabt') if os.exists(loc) { eprintln('thirdparty/wabt exists, will not overwrite') diff --git a/cmd/tools/vmissdoc.v b/cmd/tools/vmissdoc.v index 90315d25d..86f5ff334 100644 --- a/cmd/tools/vmissdoc.v +++ b/cmd/tools/vmissdoc.v @@ -283,7 +283,8 @@ fn main() { for path in opt.additional_args { if path in ['@vlib', '@cmd', '@examples'] { rpath := path[1..] - total += opt.report_undocumented_functions_in_path(os.join_path(@VROOT, rpath)) + total += opt.report_undocumented_functions_in_path(os.join_path(@VEXEROOT, + rpath)) continue } if os.is_file(path) || os.is_dir(path) { diff --git a/vlib/db/sqlite/install_thirdparty_sqlite.vsh b/vlib/db/sqlite/install_thirdparty_sqlite.vsh index 5b6162872..ef1af83e3 100755 --- a/vlib/db/sqlite/install_thirdparty_sqlite.vsh +++ b/vlib/db/sqlite/install_thirdparty_sqlite.vsh @@ -11,7 +11,7 @@ fn should_be_ok(http_status_code int, msg string) { fn main() { unbuffer_stdout() - os.chdir(@VROOT)! + os.chdir(@VEXEROOT)! download_page_url := 'https://sqlite.org/download.html' println('> Getting ${download_page_url} ...') diff --git a/vlib/encoding/vorbis/vorbis_test.v b/vlib/encoding/vorbis/vorbis_test.v index 0dd720754..840be646a 100644 --- a/vlib/encoding/vorbis/vorbis_test.v +++ b/vlib/encoding/vorbis/vorbis_test.v @@ -7,7 +7,7 @@ fn test_compilation() { } fn test_decode_file() { - x := vorbis.decode_file(os.join_path(@VROOT, 'examples/sokol/sounds/pickup.ogg'))! + x := vorbis.decode_file(os.join_path(@VEXEROOT, 'examples/sokol/sounds/pickup.ogg'))! assert x.path.ends_with('pickup.ogg') assert x.channels == 1 assert x.sample_rate == 44100 diff --git a/vlib/sokol/README.md b/vlib/sokol/README.md index a65d42972..84a1bec78 100644 --- a/vlib/sokol/README.md +++ b/vlib/sokol/README.md @@ -9,7 +9,7 @@ Each `.h` file in the sokol source code is well-documented as can be seen here: [sokol_audio.h](https://github.com/floooh/sokol/blob/master/sokol_audio.h) -## Example from `@VROOTDIR/examples/sokol/sounds/simple_sin_tones.v` +## Example from `@VEXEROOT/examples/sokol/sounds/simple_sin_tones.v` ```v cgen import time diff --git a/vlib/toml/tests/toml_lang_test.v b/vlib/toml/tests/toml_lang_test.v index b17a85e57..80c5a4cd1 100644 --- a/vlib/toml/tests/toml_lang_test.v +++ b/vlib/toml/tests/toml_lang_test.v @@ -8,7 +8,7 @@ import toml import toml.ast import x.json2 -const test_root = os.join_path(@VROOT, 'vlib/toml/tests/testdata/toml_lang/tests') +const test_root = os.join_path(@VEXEROOT, 'vlib/toml/tests/testdata/toml_lang/tests') const test_files_file = os.join_path(test_root, 'files-toml-1.0.0') const hide_oks = os.getenv('VTEST_HIDE_OK') == '1' diff --git a/vlib/toml/tests/toml_rs_test.v b/vlib/toml/tests/toml_rs_test.v index 4c1c4dd20..84a0e261e 100644 --- a/vlib/toml/tests/toml_rs_test.v +++ b/vlib/toml/tests/toml_rs_test.v @@ -65,7 +65,7 @@ fn run(args []string) !string { // test_toml_rs_toml_rs run though 'testdata/toml_rs/crates/test-suite/tests/*' if found. fn test_toml_rs_toml_rs() { eprintln('> running ${@LOCATION}') - test_root := '${@VROOT}/vlib/toml/tests/testdata/toml_rs/crates/test-suite/tests' + test_root := '${@VEXEROOT}/vlib/toml/tests/testdata/toml_rs/crates/test-suite/tests' if os.is_dir(test_root) { valid_test_files := os.walk_ext(os.join_path(test_root, 'valid'), '.toml') invalid_test_files := os.walk_ext(os.join_path(test_root, 'invalid'), '.toml') diff --git a/vlib/v/builder/builder.v b/vlib/v/builder/builder.v index f4c9d3b72..83a50d735 100644 --- a/vlib/v/builder/builder.v +++ b/vlib/v/builder/builder.v @@ -420,7 +420,7 @@ pub fn module_path(mod string) string { // TODO: try to merge this & util.module functions to create a // reliable multi use function. see comments in util/module.v pub fn (b &Builder) find_module_path(mod string, fpath string) !string { - // support @VROOT/v.mod relative paths: + // support @VEXEROOT/v.mod relative paths: mut mcache := vmod.get_cache() vmod_file_location := mcache.get_by_file(fpath) mod_path := module_path(mod) diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 2d75e0896..f993857a8 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -80,7 +80,7 @@ fn (mut v Builder) post_process_c_compiler_output(ccompiler string, res os.Resul if ccompiler == 'tcc' && res.output.starts_with('tcc: error: could not run') { println('${highlight_word('Suggestion')}: try using a different C compiler with `-cc gcc` or `-cc clang`.') println('${highlight_word('Suggestion')}: or build TCC for the target architecture yourself.') - println('${highlight_word('Note')}: you should build an 32bit version of `${@VROOT}/thirdparty/tcc/lib/libgc.a` first or use `-gc none`.') + println('${highlight_word('Note')}: you should build an 32bit version of `${@VEXEROOT}/thirdparty/tcc/lib/libgc.a` first or use `-gc none`.') exit(1) } else { println('Try passing `-g` when compiling, to see a .v file:line information, that correlates more with the C error.') diff --git a/vlib/v/gen/native/tests/native_test.v b/vlib/v/gen/native/tests/native_test.v index ffae12b30..3b9fde6c0 100644 --- a/vlib/v/gen/native/tests/native_test.v +++ b/vlib/v/gen/native/tests/native_test.v @@ -168,7 +168,7 @@ fn test_native() { } fn test_prevent_could_not_find_symbols_regression() { - res := os.execute('${os.quoted_path(@VEXE)} -b native ${os.quoted_path(os.join_path(@VROOT, + res := os.execute('${os.quoted_path(@VEXE)} -b native ${os.quoted_path(os.join_path(@VEXEROOT, 'examples/hello_world.v'))}') assert !res.output.contains('CaptureStackBackTrace'), 'Test failed system unable to find symbol: CaptureStackBackTrace' assert !res.output.contains('__debugbreak'), 'Test failed system unable to find symbol: __debugbreak' diff --git a/vlib/v/generics/new_generics_regression_test.v b/vlib/v/generics/new_generics_regression_test.v index 70aa38798..a3a8fc265 100644 --- a/vlib/v/generics/new_generics_regression_test.v +++ b/vlib/v/generics/new_generics_regression_test.v @@ -14,11 +14,11 @@ import log import term const vexe = @VEXE -const vroot = @VROOT +const vroot = @VEXEROOT const vtrace_output = os.getenv('VTRACE_OUTPUT').int() != 0 fn testsuite_begin() { - os.chdir(@VROOT)! + os.chdir(@VEXEROOT)! os.setenv('VJOBS', '1', true) } diff --git a/vlib/v/pref/default.v b/vlib/v/pref/default.v index 306fa1453..136f764aa 100644 --- a/vlib/v/pref/default.v +++ b/vlib/v/pref/default.v @@ -386,10 +386,10 @@ pub fn (p &Preferences) vcross_compiler_name() string { return 'cc' } -// vroot_file reads the given file, given a path relative to @VROOT . +// vroot_file reads the given file, given a path relative to @VEXEROOT . // Its goal is to give all backends a shared infrastructure to read their own static preludes (like C headers etc), // without each having to implement their own way of lookup/embedding/caching them. pub fn (mut p Preferences) vroot_file(path string) string { full_path := os.join_path(p.vroot, path) - return os.read_file(full_path) or { '/* missing vroot content of path: ${full_path} */' } + return os.read_file(full_path) or { '/* missing @VEXEROOT content of path: ${full_path} */' } } diff --git a/vlib/v/tests/bench/math_big_gcd/bench_euclid.v b/vlib/v/tests/bench/math_big_gcd/bench_euclid.v index 2a3465453..16de8ca1b 100644 --- a/vlib/v/tests/bench/math_big_gcd/bench_euclid.v +++ b/vlib/v/tests/bench/math_big_gcd/bench_euclid.v @@ -23,7 +23,7 @@ const empty_set = GCDSet{'1', '1', '1'} const with_dots = false fn main() { - fp := os.join_path(@VROOT, prime.toml_path) + fp := os.join_path(@VEXEROOT, prime.toml_path) if !prime_file_exists(fp) { panic('expected file |${fp}| - not found.') } diff --git a/vlib/v/tests/bench/math_big_gcd/prime/maker.v b/vlib/v/tests/bench/math_big_gcd/prime/maker.v index 58372381a..5f2b51923 100644 --- a/vlib/v/tests/bench/math_big_gcd/prime/maker.v +++ b/vlib/v/tests/bench/math_big_gcd/prime/maker.v @@ -74,7 +74,7 @@ pub fn usage() string { // reads the Map[string] []string from disk // and returns the parsed content fn read_toml_file() map[string][]string { - fp := os.join_path(@VROOT, toml_path) + fp := os.join_path(@VEXEROOT, toml_path) tm_doc := toml.parse_file(fp) or { err_msg := 'expected ${fp}' diff --git a/vlib/v/tests/builtin_arrays/array_access_optimisation_test.v b/vlib/v/tests/builtin_arrays/array_access_optimisation_test.v index 7bdad0463..1087e49fd 100644 --- a/vlib/v/tests/builtin_arrays/array_access_optimisation_test.v +++ b/vlib/v/tests/builtin_arrays/array_access_optimisation_test.v @@ -1,7 +1,7 @@ // vtest retry: 3 import os -const test = @VROOT + '/vlib/v/tests/testdata/test_array_bound.v' +const test = @VEXEROOT + '/vlib/v/tests/testdata/test_array_bound.v' fn direct(line string) { if !line.contains('\tmain__direct(') { diff --git a/vlib/v/tests/consts/const_init_order_test.v b/vlib/v/tests/consts/const_init_order_test.v index 42ab9bbce..f535d10d5 100644 --- a/vlib/v/tests/consts/const_init_order_test.v +++ b/vlib/v/tests/consts/const_init_order_test.v @@ -11,7 +11,7 @@ fn test_rand_is_initialized_before_main() { // const last_constant = fn_that_calls_a_method_on_a_constant() -const a_constant = os.join_path(@VROOT, 'a') +const a_constant = os.join_path(@VEXEROOT, 'a') fn fn_that_calls_a_method_on_a_constant() string { return a_constant.replace('\\', '/') diff --git a/vlib/v/tests/trace_calls_test.v b/vlib/v/tests/trace_calls_test.v index 7587472e3..7c9bbcc8b 100644 --- a/vlib/v/tests/trace_calls_test.v +++ b/vlib/v/tests/trace_calls_test.v @@ -10,7 +10,7 @@ fn separator() { } fn test_trace_fns() { - os.chdir(@VROOT)! + os.chdir(@VEXEROOT)! folder := os.join_path('vlib', 'v', 'tests', 'testdata', 'trace_calls') fpath := os.join_path(folder, 'single_println.vv') should_match_fpath := os.join_path(folder, 'single_println.vv.must_match.simple') @@ -23,7 +23,7 @@ fn test_trace_fns() { } fn test_tracing() { - os.chdir(@VROOT)! + os.chdir(@VEXEROOT)! folder := os.join_path('vlib', 'v', 'tests', 'testdata', 'trace_calls') files := os.walk_ext(folder, '.vv') for fpath in files { diff --git a/vlib/v/vmod/vmod.v b/vlib/v/vmod/vmod.v index d577f9883..5e9e74e78 100644 --- a/vlib/v/vmod/vmod.v +++ b/vlib/v/vmod/vmod.v @@ -4,7 +4,7 @@ import os const mod_file_stop_paths = ['.git', '.hg', '.svn', '.v.mod.stop'] -// used during lookup for v.mod to support @VROOT +// used during lookup for v.mod to support @VEXEROOT const private_file_cacher = new_mod_file_cacher() pub fn get_cache() &ModFileCacher { diff --git a/vlib/wasm/tests/common.v b/vlib/wasm/tests/common.v index b56f8ea15..1278a1daa 100644 --- a/vlib/wasm/tests/common.v +++ b/vlib/wasm/tests/common.v @@ -12,7 +12,7 @@ const wasm_validate_exe = find_wasm_validate() or { fn find_wasm_validate() !string { // Prefer to find our own version first, if it was installed already // through install_wabt.vsh, since it is more likely to be known, recent, and stable: - thirdpart_wasm_validate_folder := os.join_path(@VROOT, 'thirdparty', 'wabt', 'bin') + thirdpart_wasm_validate_folder := os.join_path(@VEXEROOT, 'thirdparty', 'wabt', 'bin') extension := $if windows { '.exe' } $else { '' } wasm_validate_executable := os.join_path(thirdpart_wasm_validate_folder, 'wasm-validate${extension}') if os.exists(wasm_validate_executable) { -- 2.39.5