Skip to content

Rename buildir to builddir#6361

Merged
waruqi merged 8 commits intodevfrom
builddir
Apr 24, 2025
Merged

Rename buildir to builddir#6361
waruqi merged 8 commits intodevfrom
builddir

Conversation

@waruqi
Copy link
Member

@waruqi waruqi commented Apr 24, 2025

@waruqi waruqi added this to the v3.0.0 milestone Apr 24, 2025
@waruqi waruqi mentioned this pull request Apr 24, 2025
11 tasks
@waruqi waruqi merged commit 175b91c into dev Apr 24, 2025
44 checks passed
@waruqi waruqi deleted the builddir branch April 24, 2025 05:57
@dzylikecode
Copy link

dzylikecode commented May 16, 2025

在Windows上测试$(builddir)没有问题,但是在Ubuntu aarch64上测试会出问题(2025/05/16 安装的xmake)

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

add_requires("serial") -- GitHub: wjwwood/serial
add_requires("fmt") -- GitHub: fmtlib/fmt

target("serial_port")
    set_kind("shared")
    set_languages("c++17")
    add_includedirs("include", {public = true})
    add_files("src/*.cpp")
    add_packages("serial")
    add_defines("BUILDING_DLL")

    after_build(function (target)
        -- os.rm("$(builddir)/output")
        -- os.mkdir("$(builddir)/output/include")
        -- os.mkdir("$(builddir)/output/lib/$(plat)/$(arch)")
        -- os.cp("include/*", "$(builddir)/output/include")
        -- os.cp(target:targetfile(), "$(builddir)/output/lib/$(plat)/$(arch)")
        os.rm("$(builddir)/native")
        os.mkdir("$(builddir)/native")
        os.cp("include/*", "$(builddir)/native")
        os.cp(target:targetfile(), "$(builddir)/native")
    end)

function add_example(name)
    target(name)
        set_kind("binary")
        set_languages("c++17")
        add_includedirs("include", {public = true})
        add_files("examples/" .. name .. ".cpp")
        add_deps("serial_port")
        add_packages("fmt")
end

add_example("list_ports")

运行结果

error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:325: @programdir/core/sandbox/modules/os.lua:223: cannot create directory: /native, Not access because it is busy
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [@programdir/core/sandbox/modules/os.lua:223]: in function 'mkdir'
    [./xmake.lua:21]: in function 'after_build'
    [@programdir/actions/build/build.lua:127]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir/core/base/os.lua:1075: in function 'base/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>

显示是$builddir 被解释为了空,而改回 $buildir 则没有这个问题

@waruqi
Copy link
Member Author

waruqi commented May 16, 2025

给个完整可复现的工程

@Issues-translate-bot
Copy link

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


Give a complete and reproducible project

@dzylikecode
Copy link

我新建了一个仓库来表示这个问题:https://github.com/dzylikecode/bug-xmake-issue-6361

@Issues-translate-bot
Copy link

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


I created a new repository to indicate this problem: https://github.com/dzylikecode/bug-xmake-issue-6361

@waruqi
Copy link
Member Author

waruqi commented May 18, 2025

我新建了一个仓库来表示这个问题:https://github.com/dzylikecode/bug-xmake-issue-6361

提个 issues 过来

@Issues-translate-bot
Copy link

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


I created a new repository to indicate this problem: https://github.com/dzylikecode/bug-xmake-issue-6361

Let me ask you issues here

@dzylikecode
Copy link

已经提出issue #6466

@Issues-translate-bot
Copy link

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


Issue #6466 has been proposed

@da-liii
Copy link
Member

da-liii commented Jun 29, 2025

这个不考虑兼容性么?我们这边有一些新开发者已经遇到使用最新版 xmake 不兼容的情况了

@Issues-translate-bot
Copy link

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


Doesn't this consider compatibility? Some new developers here have encountered incompatible situations using the latest version of xmake

@waruqi
Copy link
Member Author

waruqi commented Jun 30, 2025

内部做了兼容处理,buildir 同样可用,只是会有 deprecated warning 来提示迁移,理论上不会存在兼容问题。

如果有问题,可以提 issues

@Issues-translate-bot
Copy link

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


Compatibility is done internally, and buildir is also available, but there will be deprecated warning to prompt for migration. In theory, there will be no compatibility problems.

If you have any questions, you can mention issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants