新版armclang编译器检测时出现问题
Xmake Version
2.9.5+HEAD.d30de52e9
Operating System Version and Architecture
Windows 10 21H2 19044.5011
Describe Bug
xmake create -l c test-armclang
cd .\test-armclang\
xmake f -v -p cross -a cortex-m0 --toolchain=armclang -c
用xmake创建新项目时,希望使用armclang编译器,使用上面的命令后出现第二张图里的错误。
Expected Behavior
正常编译通过
Project Configuration
add_rules("mode.debug", "mode.release")
target("test-armclang")
set_kind("binary")
add_files("src/*.c")
Additional Information and Error Logs
checking for MDK directory ... C:\Keil_v5\ARM
checking for armclang.exe ... C:\Keil_v5\ARM\armclang\bin\armclang.exe
error: bad argument #1 to 'compare' (string expected, got nil)
Bot detected the issue body's language is not English, translate it automatically.
Title: There is a problem when detecting the new version of armclang compiler
-vD 给下栈
Bot detected the issue body's language is not English, translate it automatically.
-vD push down the stack
输入命令:
xmake f -vD -p cross -a cortex-m3 --toolchain=armclang -c
输出如下:
checking for MDK directory ... C:\Keil_v5\ARM
checking for armclang.exe ... C:\Keil_v5\ARM\armclang\bin\armclang.exe
error: @programdir\core\main.lua:329: @programdir\core\tool\toolchain.lua:285: ...gramdir\core\sandbox\modules\import\core\base\semver.lua:68: bad argument #1 to 'compare' (string expected, got nil)
stack traceback:
[C]: in function 'compare'
[...gramdir\core\sandbox\modules\import\core\base\semver.lua:68]: in function 'compare'
[@programdir\toolchains\armclang\xmake.lua:42]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:241]:
[@programdir\core\tool\toolchain.lua:281]: in function 'check'
[@programdir\core\platform\platform.lua:261]: in function 'check'
[@programdir\actions\config\main.lua:367]:
[C]: in function 'xpcall'
[@programdir\core\base\utils.lua:241]:
[@programdir\core\base\task.lua:491]: in function 'run'
[@programdir\core\main.lua:327]: in function 'cotask'
[@programdir\core\base\scheduler.lua:406]:
stack traceback:
[C]: in function 'error'
@programdir\core\base\os.lua:1004: in function 'os.raiselevel'
(...tail calls...)
@programdir\core\main.lua:329: in upvalue 'cotask'
@programdir\core\base\scheduler.lua:406: in function <@programdir\core\base\scheduler.lua:399>
我只能暂时修复 nil 这个 error
https://github.com/xmake-io/xmake/blob/cd6663abb6da35cb798004f19b1d106f3cc73f50/xmake/toolchains/armclang/xmake.lua#L42
可以更新下试试,xmake update -s dev 应该可以了
至于为什么没探测到 armclang 的 version,这个暂时没空调,也没环境。。有兴趣可以自己调下
https://github.com/xmake-io/xmake/blob/cd6663abb6da35cb798004f19b1d106f3cc73f50/xmake/modules/detect/tools/find_armclang.lua#L57