diff options
| -rw-r--r-- | xmake/core/tool/toolchain.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua index 848668d8a..94a9309e9 100644 --- a/xmake/core/tool/toolchain.lua +++ b/xmake/core/tool/toolchain.lua @@ -428,8 +428,13 @@ function _instance:_checktool(toolkind, toolpath) if toolpath then local pos = toolpath:find('@', 1, true) if pos then - toolname = toolpath:sub(1, pos - 1) - program = toolpath:sub(pos + 1) + -- we need ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go + -- https://github.com/xmake-io/xmake/issues/2853 + local prefix = toolpath:sub(1, pos - 1) + if prefix and not prefix:find("[/\\]") then + toolname = prefix + program = toolpath:sub(pos + 1) + end end end |
