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

xmake 执行时报错 #4892

Closed
KarryCharon opened this issue Mar 28, 2024 · 10 comments
Closed

xmake 执行时报错 #4892

KarryCharon opened this issue Mar 28, 2024 · 10 comments
Labels
Milestone

Comments

@KarryCharon
Copy link

Xmake Version

2.8.9

Operating System Version and Architecture

macOS 14.3.1 (23D60)

Describe Bug

执行xmake时报错:
error: @programdir/core/main.lua:329: attempt to compare string with table
stack traceback:
[C]: in function 'sort'
[@programdir/rules/plugin/compile_commands/xmake.lua:61]: in function 'buildscript'
[@programdir/actions/build/main.lua:97]: in function '_do_project_rules'
[@programdir/actions/build/main.lua:144]: in function 'catch'
[@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
[@programdir/actions/build/main.lua:118]: in function 'build_targets'
[@programdir/actions/build/main.lua:201]:
[C]: in function 'xpcall'
[@programdir/core/base/utils.lua:275]:
[@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:957: 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>

Expected Behavior

Project Configuration

Additional Information and Error Logs

@Issues-translate-bot
Copy link

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


Title: xmake reports an error when executing

@star-hengxing
Copy link
Contributor

估计是某次修改引入,先试试 xmake update -s dev,如果还不行参考这个
Ajatt-Tools/gd-tools@94f46eb

@Issues-translate-bot
Copy link

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


It is probably introduced by a certain modification. Try xmake update -s dev first. If it still doesn’t work, refer to this.
Ajatt-Tools/gd-tools@94f46eb

@waruqi
Copy link
Member

waruqi commented Mar 28, 2024

贴完整 -vD logs 和 xmake.lua

@Issues-translate-bot
Copy link

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


Post the complete -vD logs and xmake.lua

@KarryCharon
Copy link
Author

贴完整 -vD logs 和 xmake.lua

大概知道了 是由 add_headerfiles("src/*.h", {prefixdir = "xxx"}) 导致的, 只要 不传prefixdir 就行,
内部处理的时候有一个 table.sort 这时候 table里理应全是字符串, 但混入了 {prefixdir = "xxx"} 因此导致了 attempt to compare string with table 异常.

@waruqi
Copy link
Member

waruqi commented Mar 29, 2024

compile_commands 这个 sort 我记得 dev 上已经修了才对。。可以更新到 dev 后试下。。

xmake update -s dev

@KarryCharon
Copy link
Author

compile_commands 这个 sort 我记得 dev 上已经修了才对。。可以更新到 dev 后试下。。

xmake update -s dev

确实没问题了 谢谢

@Issues-translate-bot
Copy link

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


I remember that compile_commands sort has been fixed on dev. . You can try it after updating to dev. .

xmake update -s dev

@Issues-translate-bot
Copy link

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


compile_commands I remember that this sort has been fixed on dev. . You can try it after updating to dev. .

xmake update -s dev

It's really no problem. Thank you.

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

4 participants