xmake-io / xmake

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

improve host toolchain #5639 #5643

Closed waruqi closed 1 month ago

waruqi commented 1 month ago

https://github.com/xmake-io/xmake/issues/5639 https://github.com/xmake-io/xmake/issues/4934

waruqi commented 1 month ago

一些改动:

  1. 添加 xmake f --toolchain_host=xrepo install --toolchain_host= 参数可以单独指定包的 host 工具链
  2. 默认情况下,host 包不再使用 xmake f --toolchain= 指定的工具链
  3. binary/toolchain 包内部的所有 add_deps 配置的依赖,默认继承为 host 包,不再需要手动配置 add_deps("xx", {host = true})
  4. 相同配置的 private 包,不再重复安装,共享一个安装包。
waruqi commented 1 month ago

Some changes:

Adding parameters such as xmake f --toolchain_host= and xrepo install --toolchain_host= allows specifying the host toolchain of a package separately. By default, host packages no longer use the toolchain specified by xmake f --toolchain=. For all dependencies configured by add_deps inside binary/toolchain packages, they are inherited as host packages by default and there is no longer a need to manually configure add_deps("xx", {host = true}). For private packages with the same configuration, they are no longer installed repeatedly and share a single installation package.

waruqi commented 1 month ago

This patch may introduce some unknown issues and requires some more detailed testing.

SirLynix commented 1 month ago

I tried to test it but my CI fails, I don't know how to debug it: https://github.com/NazaraEngine/NazaraEngine/actions/runs/11001885174/job/30547585365

waruqi commented 1 month ago

I tried to test it but my CI fails, I don't know how to debug it: https://github.com/NazaraEngine/NazaraEngine/actions/runs/11001885174/job/30547585365

old issue, you need add sleep after xmake update

    - name: Configure xmake and install dependencies
      run: |
        xmake update -s toolchain
        sleep 5 <----------------------------------------
        xmake repo --update
        xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --static=${{ matrix.kind == 'static' && 'yes' || 'no' }} --ccache=n --ffmpeg=y --shadernodes=y --tests=y --unitybuild=y --yes
waruqi commented 1 month ago

win, wasm, linux work now, but there are some other errors on macos, https://github.com/waruqi/NazaraEngine/actions

But I am not sure if it is a problem with xmake.

SirLynix commented 1 month ago

🤔 I don't see any error on macOS

waruqi commented 1 month ago

🤔 I don't see any error on macOS

I rerun it, it works on ci. If no problem, I am going to merge it.