xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.08k stars 784 forks source link

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

Closed Dozingfiretruck closed 7 months ago

Dozingfiretruck commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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

Issues-translate-bot commented 7 months ago

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 commented 7 months ago

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

已修改

Issues-translate-bot commented 7 months ago

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 commented 7 months ago

无法复现

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 commented 7 months ago

给个完整可复现的最小 example

Issues-translate-bot commented 7 months ago

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


Give a complete and reproducible minimal example

Dozingfiretruck commented 7 months ago

给个完整可复现的最小 example

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

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

Issues-translate-bot commented 7 months ago

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 commented 7 months ago

再试试,xmake update -s dev

Issues-translate-bot commented 7 months ago

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


Try again, xmake update -s dev

Dozingfiretruck commented 7 months ago

给个完整可复现的最小 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 commented 7 months ago

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