From 1e1a0223ac7dd035337b66519957bbf9deda3213 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 15 Apr 2026 01:10:18 +0300 Subject: [PATCH] checker: fix vdoc failing to compile on macOS Sequoia (fixes #26698) --- vlib/v/checker/checker.v | 6 ++++++ vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index d80b719b5..58c23c1c6 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -4321,6 +4321,12 @@ fn (mut c Checker) resolve_pseudo_variables(oflag string, pos token.Pos) ?string // expand `@VEXEROOT` to its absolute path flag = flag.replace('@VEXEROOT', c.pref.vroot) } + if flag.contains('@VROOT') { + flag = util.resolve_vmodroot(flag.replace('@VROOT', '@VMODROOT'), c.file.path) or { + c.error(err.msg(), pos) + return none + } + } if flag.contains('@VMODROOT') { flag = util.resolve_vmodroot(flag, c.file.path) or { c.error(err.msg(), pos) diff --git a/vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v b/vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v index 2413818e9..04191b073 100644 --- a/vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v +++ b/vlib/v/tests/cflags/vmodroot_and_vroot_test.c.v @@ -1,13 +1,12 @@ -// Tests that VMODROOT finds the nearest v.mod file, which in -// this case is in the current folder, so in effect, @VMODROOT -// is the same as the absolute path of `.` . -// ==> @VMODROOT/includes === ./includes -#flag -I@VMODROOT/includes +// Tests that the deprecated @VROOT alias still resolves to the nearest v.mod file, +// which in this case is in the current folder. +// ==> @VROOT/includes === ./includes +#flag -I@VROOT/includes #include "myinclude.h" fn C.add(i32, i32) i32 -// Tests that VROOT works no matter the current folder +// Tests that VEXEROOT works no matter the current folder. #flag -I @VEXEROOT/thirdparty/stb_image #include "stb_image.h" -- 2.39.5