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 f -c -P . 清除配置报错 #4857

Closed
Dozingfiretruck opened this issue Mar 21, 2024 · 14 comments
Closed

xmake f -c -P . 清除配置报错 #4857

Dozingfiretruck opened this issue Mar 21, 2024 · 14 comments
Labels
Milestone

Comments

@Dozingfiretruck
Copy link

Dozingfiretruck commented Mar 21, 2024

Xmake 版本

2.8.8

操作系统版本和架构

win10

描述问题

工程能正常编译,但是xmake f -c -P . 清除配置报错

期待的结果

正常清除

工程配置

xmake.lua :

project_dir = os.scriptdir()
csdk_root = "../../"
includes(csdk_root)

csdk_root下xmake.lua:

-- 各种通用配置
includes("bootloader")
includes("project")

bootloader下 xmake.lua

target("driver",function()
    set_kind("static")
    set_targetdir(project_dir.."/build/bootloader_libdriver")
    --  各种通用配置
end)

其中 ‘set_targetdir(project_dir.."/build/bootloader_libdriver")’ 中的 project_dir就会报错,全局变量描述域应该正常使用的,而且编译是正常的,只有 xmake f -c -P . 报错

附加信息和错误日志

image

@Issues-translate-bot
Copy link

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


Title: xmake f -c -P . Clear configuration error

Xmake version

2.8.8

Operating system version and architecture

win10

Describe the problem

The project can be compiled normally, but xmake f -c -P . clears the configuration and reports an error

Expected results

Clear normally

Project configuration

xmake.lua:
project_dir = os.scriptdir()
csdk_root = "../../"
includes(csdk_root)

xmake.lua under csdk_root:
-- Various common configurations
includes("bootloader")
includes("project")
includes("bootloader")

xmake.lua under bootloader

target("driver",function()
set_kind("static")
set_targetdir(project_dir.."/build/bootloader_libdriver")

-- Various common configurations

end)

Among them, the project_dir in set_targetdir(project_dir.."/build/bootloader_libdriver") will report an error. The global variable description field should be used normally, and the compilation is normal. Only xmake f -c -P . error is reported.

Additional information and error logs

image

@waruqi
Copy link
Member

waruqi commented Mar 21, 2024

给下完整工程,好歹 code 贴贴好么,这么乱 怎么看

@Issues-translate-bot
Copy link

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


Could you please post the complete project? Can you please post the code? It’s so messy. What do you think?

@Dozingfiretruck
Copy link
Author

给下完整工程,好歹 code 贴贴好么,这么乱 怎么看

已修改

@Issues-translate-bot
Copy link

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


Can you please post the complete project and post the code? It’s so messy. What do you think?

already edited

@waruqi
Copy link
Member

waruqi commented Mar 21, 2024

无法复现

add_rules("mode.debug", "mode.release")

foo=os.scriptdir()
target("foo")
    set_kind("static")
    add_files("src/foo.cpp")

includes("src")

src/xmake.lua

includes("bar")

src/bar/xmake.lua

target("test8", function ()
    set_kind("binary")
    add_deps("foo")
    add_files("src/main.cpp")
    print(foo)
end)
ruki-2:test8 ruki$ xmake
/private/tmp/test8
/private/tmp/test8

@waruqi
Copy link
Member

waruqi commented Mar 21, 2024

给个完整可复现的最小 example

@Issues-translate-bot
Copy link

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


Give a complete and reproducible minimal example

@Dozingfiretruck
Copy link
Author

给个完整可复现的最小 example

仓库: https://gitee.com/openLuat/luatos-soc-2024

在 luatos-soc-2024\project\test 目录下执行 xmake -P . 可正常编译
执行 xmake f -c -P . 清除会报错

@Issues-translate-bot
Copy link

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


Give a complete and reproducible minimal example

Warehouse: https://gitee.com/openLuat/luatos-soc-2024

Execute xmake -P in the luatos-soc-2024\project\test directory. It can be compiled normally.
Execute xmake f -c -P. Clearing will report an error

waruqi added a commit that referenced this issue Mar 21, 2024
@waruqi waruqi added this to the v2.8.9 milestone Mar 21, 2024
@waruqi
Copy link
Member

waruqi commented Mar 21, 2024

再试试,xmake update -s dev

@Issues-translate-bot
Copy link

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


Try again, xmake update -s dev

@Dozingfiretruck
Copy link
Author

给个完整可复现的最小 example

仓库: https://gitee.com/openLuat/luatos-soc-2024

在 luatos-soc-2024\project\test 目录下执行 xmake -P . 可正常编译 执行 xmake f -c -P . 清除会报错

xmake update -s dev

可以了

@Issues-translate-bot
Copy link

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


Give a complete and reproducible minimal example

Warehouse: https://gitee.com/openLuat/luatos-soc-2024

Execute xmake -P in the luatos-soc-2024\project\test directory. It can be compiled normally. Execute xmake f -c -P. An error will be reported after clearing

xmake update -s dev

That's it

@waruqi waruqi closed this as completed Mar 21, 2024
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