Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新版armclang编译器检测时出现问题 #5719

Open
Jupiter-12 opened this issue Oct 15, 2024 · 5 comments
Open

新版armclang编译器检测时出现问题 #5719

Jupiter-12 opened this issue Oct 15, 2024 · 5 comments
Labels

Comments

@Jupiter-12
Copy link

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)
@Jupiter-12 Jupiter-12 added the bug label Oct 15, 2024
@Issues-translate-bot
Copy link

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

@waruqi
Copy link
Member

waruqi commented Oct 15, 2024

-vD 给下栈

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


-vD push down the stack

@Jupiter-12
Copy link
Author

Jupiter-12 commented Oct 16, 2024

输入命令:

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>

waruqi added a commit that referenced this issue Oct 16, 2024
@waruqi
Copy link
Member

waruqi commented Oct 16, 2024

我只能暂时修复 nil 这个 error

if armclang and armclang.version and semver.compare(armclang.version, "6.13") > 0 then

可以更新下试试,xmake update -s dev 应该可以了

至于为什么没探测到 armclang 的 version,这个暂时没空调,也没环境。。有兴趣可以自己调下

version = find_programver(program, opt)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants