From 9473e491160500cda2670e5140cfd2bfe2c1adbb Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 22 Sep 2022 23:00:47 +0800 Subject: improve toolchain #2853 --- xmake/core/tool/toolchain.lua | 9 +++++++-- 1 file 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/go@1.17/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 -- cgit v1.3.1