xmake-io / xmake

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

Add `--toolchain_host=` argument #5639

Closed xq114 closed 3 days ago

xq114 commented 1 week ago

Xmake 版本

2.9.5

操作系统版本和架构

Ubuntu

描述问题

https://github.com/xmake-io/xmake-repo/pull/5269

这边cross build使用的python指定了 add_deps("libffi", {host = true}) 但安装libffi的时候还是使用了cross toolchain导致安装失败

期待的结果

host = true 应该忽略toolchain指定,使用host toolchain

最好可以在global setting里指定默认toolchain,这样也有办法控制这些host package的安装使用哪个toolchain了

工程配置

/

附加信息和错误日志

/

waruqi commented 1 week ago

这是由于目前全局 platform 没有区分 host/build toolchain,仅仅 package 里面有这个概念。。

所以 package 本身还是 host 编译,但是 on_test 时候,走了 platform toolchain 去测试,被 xmake f --toolchain=muslcc 给影响到了。。

这种要么类似 conna 那样, xmake f --toolchain_host=xmake f --toolchain_build= 区分下。。而 xmake f --toolchain= 为了向下兼容,同时切 build/host toolchain

xq114 commented 1 week ago

对交叉编译才需要额外的toolchain_host吧,toolchain_build这个名字不太必要,就用原来的--toolchain就好,没指定toolchain_host就用默认toolchain

Issues-translate-bot commented 1 week ago

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


An additional toolchain_host is only needed for cross-compilation. The name toolchain_build is not necessary. Just use the original --toolchain. If toolchain_host is not specified, use the default toolchain.

xq114 commented 1 week ago

需要toolchain_host的地方toolchain_host和toolchain_build必定不一样,同时切 build/host toolchain 是不对的

waruqi commented 5 days ago

试下这个 patch ,改动点比较多,尽可能多测下

https://github.com/xmake-io/xmake/pull/5643

libomp 的那个问题,应该可以解决,另外,binary/toolchain 包内部依赖,不再需要手动挨个配置 {host = true} 了。

waruqi commented 3 days ago

应该可以了

Issues-translate-bot commented 3 days ago

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


It should be fine