diff options
| author | ruki <[email protected]> | 2025-11-06 22:45:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-06 22:45:59 +0800 |
| commit | 33f11dae091a2dcb0f5dae61ed74a3a9853237de (patch) | |
| tree | 985adb6a8d225b2c22ab98d0116b1a6c94e15d4b /xmake/core/base/interpreter.lua | |
| parent | 169c7ddce5a07c82b5aa60fbc6fcb37e4593fb7d (diff) | |
fix rootdir #6995
Diffstat (limited to 'xmake/core/base/interpreter.lua')
| -rw-r--r-- | xmake/core/base/interpreter.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index afb5e4412..f325ec3d2 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -770,7 +770,8 @@ function interpreter:load(file, opt) self:_clear() -- translate to absolute file path for scriptdir/rootdir - file = path.absolute(file) + -- we need to normalize path for rootdir, @see https://github.com/xmake-io/xmake/issues/6995 + file = path.normalize(path.absolute(file)) -- init the current file self._PRIVATE._CURFILE = file @@ -1865,11 +1866,8 @@ function interpreter:api_builtin_includes(...) -- clear the current scope, force to enter root scope scopes._CURRENT = nil - -- save the current directory - local oldir = os.curdir() - -- enter the script directory - os.cd(path.directory(file)) + local oldir = os.cd(path.directory(file)) -- done interpreter local ok, errors = xpcall(script, interpreter._traceback) |
