xmake-io / xmake

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

自定义交叉编译链环境,repo 包级层依赖情况下,由于 installdir hash 计算问题导致不必要的重复编译 #1732

Closed OuYangPaste closed 3 years ago

OuYangPaste commented 3 years ago

描述问题

在自定义交叉编译链环境下,repo b 包 依赖于 a 包,当 b 包进行版本迭代后,由于 a 包 installdir hash 计算的问题,导致 a 包被重新编译,尝试切换成 clang 没有问题(这个问题会导致很多不必要的重新编译) 几番捕抓之下, 在 ~/.local/share/xmake/core/package/package.lua: _instance:buildhash 下追加以下打印: image

在 ~/.local/share/xmake/modules/private/action/require/impl/package.lua: _init_requireinfo 下追加以下打印: image

具体见 以下 log:

xmake f -a jzt21 -cv
checking for platform ... linux
checking for gcc ... /usr/bin/gcc
checking for dmd ... no
checking for ldc2 ... no
checking for gdc ... no
checking for zig ... no
checking for zig ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/usr/bin/git rev-parse HEAD
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,shared=false}
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,pic=true,shared=false}
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,pic=true,shared=false}_0865832af8b9dcca9ed191689be3ab6f5c7173f24805f99a15f348c7874d84dc
================================================
~/.local/share/xmake/modules/private/action/require/impl/package.lua:
type(requireinfo.configs.toolchains): nil
project.get("target.toolchains")    : jzt21@cross_toolchain
type(get_config("toolchain"))       : nil
================================================
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}_release-1.0.10
================================================
~/.local/share/xmake/modules/private/action/require/impl/package.lua:
type(requireinfo.configs.toolchains): nil
project.get("target.toolchains")    : jzt21@cross_toolchain
type(get_config("toolchain"))       : nil
================================================
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}_release-1.0.25
================================================
~/.local/share/xmake/modules/private/action/require/impl/package.lua:
type(requireinfo.configs.toolchains): string
project.get("target.toolchains")    : jzt21@cross_toolchain
type(get_config("toolchain"))       : nil
================================================
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}
================================================
~/.local/share/xmake/modules/private/action/require/impl/package.lua:
type(requireinfo.configs.toolchains): string
project.get("target.toolchains")    : jzt21@cross_toolchain
type(get_config("toolchain"))       : nil
================================================
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}_r53
================================================
~/.local/share/xmake/modules/private/action/require/impl/package.lua:
type(requireinfo.configs.toolchains): string
project.get("target.toolchains")    : jzt21@cross_toolchain
type(get_config("toolchain"))       : nil
================================================
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}_release-1.0.4
================================================
~/.local/share/xmake/modules/private/action/require/impl/package.lua:
type(requireinfo.configs.toolchains): string
project.get("target.toolchains")    : jzt21@cross_toolchain
type(get_config("toolchain"))       : nil
================================================
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,shared=false,toolchains=jzt21@cross_toolchain}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=jzt21@cross_toolchain}
checking for cross_toolchain ... no
checking for xmake::gv_core ... no
checking for xmake::platform_api ... platform_api 1.0.25
checking for xmake::wav ... wav master
checking for xmake::inih ... inih 0.53
checking for xmake::gvkstream ... gvkstream 1.0.4
checking for xmake::media_server ... media_server master
note: install or modify (m) these packages (pass -y to skip confirm)?
in gv-repo:
  -> gv_core 1.0.10 [toolchains:jzt21@cross_toolchain]
please input: y (y/n/m)
y
checking for ping ... /usr/bin/ping
pinging for the host(git@code.jdvision.com:222) ... 65535 ms
/usr/bin/git clone ssh://git@code.jdvision.com:222/Development_Department/gv_core.git source.tmp/gv_core
Cloning into 'source.tmp/gv_core'...
remote: Enumerating objects: 495, done.
remote: Counting objects: 100% (495/495), done.
remote: Compressing objects: 100% (491/491), done.
remote: Total 495 (delta 283), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (495/495), 116.84 KiB | 2.12 MiB/s, done.
Resolving deltas: 100% (283/283), done.
/usr/bin/git checkout release-1.0.10
Note: checking out 'release-1.0.10'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 7317682 针对 version.h 删除对应改动
  => clone ssh://git@code.jdvision.com:222/Development_Department/gv_core.git 1.0.10 .. ok
xmake f -y -c --verbose --plat=linux --arch=jzt21 --mode=release --kind=static --cxflags=-fPIC
checking for gcc ... /usr/bin/gcc
checking for dmd ... no
checking for ldc2 ... no
checking for gdc ... no
checking for zig ... no
checking for zig ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/usr/bin/git rev-parse HEAD
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,shared=false}
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,pic=true,shared=false}
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,pic=true,shared=false}_0865832af8b9dcca9ed191689be3ab6f5c7173f24805f99a15f348c7874d84dc
================================================
~/.local/share/xmake/modules/private/action/require/impl/package.lua:
type(requireinfo.configs.toolchains): nil
project.get("target.toolchains")    : { 
  "jzt21@cross_toolchain",
  "jzt21@cross_toolchain" 
}

type(get_config("toolchain"))       : nil
================================================
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,shared=false,toolchains=table: 0x7f09315cf420}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=table: 0x7f09315cf420}
~/.local/share/xmake/core/package/package.lua:  linuxjzt21{debug=false,pic=true,shared=false,toolchains=table: 0x7f09315cf420}
checking for cross_toolchain ... no
checking for xmake::cjson ... no
checking for ping ... /usr/bin/ping
pinging for the host(git@code.jdvision.com:222) ... 65535 ms
/usr/bin/git clean -d -f -x
Removing .xmake/
Removing build/
Removing xmake.lua
/usr/bin/git reset --hard
HEAD is now at f50dafc fix: potential memory leak in merge_patch() (#611)
xmake f -y -c --verbose --yes --plat=linux --arch=jzt21 --mode=release --kind=static "--cxflags=-fPIC -fPIC"
checking for gcc ... /usr/bin/gcc
checking for dmd ... no
checking for ldc2 ... no
checking for gdc ... no
checking for zig ... no
checking for zig ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/usr/bin/git rev-parse HEAD
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,shared=false}
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,pic=true,shared=false}
~/.local/share/xmake/core/package/package.lua:  linuxx86_64{debug=false,pic=true,shared=false}_0865832af8b9dcca9ed191689be3ab6f5c7173f24805f99a15f348c7874d84dc
checking for cross_toolchain ... no
checking for mips-linux-uclibc-gnu-ar ... /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-ar
checking for the static library archiver (ar) ... mips-linux-uclibc-gnu-ar
configure
{
    host = linux
    theme = default
    ccache = true
    cxflags = -fPIC -fPIC
    clean = true
    kind = static
    network = private
    proxy_pac = pac.lua
    target_os = linux
    arch = jzt21
    buildir = build
    pkg_searchdirs = gv_core
    mode = release
    ndk_stdcxx = true
    plat = linux
}
xmake --verbose --yes
checking for mips-linux-uclibc-gnu-gcc ... /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc ... ok
checking for flags (-O2) ... ok
checking for ccache ... /usr/bin/ccache
[ 25%]: ccache compiling.release cJSON.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"master\" -D __GV_GIT_TAG__=\"none\" -D __GV_GIT_COMMIT__=\"f50dafc7d0bfd4f45449ab5665bfea831a82f2eb\" -D __GV_GIT_DATE__=\"20210826141342\" -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/cJSON/linux/jzt21/release/cJSON.c.o cJSON.c
checking for flags (-MMD -MF) ... ok
checking for flags (-fdiagnostics-color=always) ... no
checking for flags (-fcolor-diagnostics) ... no
[ 50%]: archiving.release libcJSON.a
/home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-ar -cr build/linux/jzt21/release/libcJSON.a build/.objs/cJSON/linux/jzt21/release/cJSON.c.o
[100%]: build ok!
xmake install -y -o /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c --verbose --yes
installing cJSON ..
installing cJSON to /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c ..
> copy build/linux/jzt21/release/libcJSON.a to /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/lib
> copy cJSON.h to /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include/cJSON.h
install ok!
checking for xmake::cjson ... cjson master
{ 
  sysincludedirs = { 
    "/home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include" 
  },
  static = true,
  linkdirs = { 
    "/home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/lib" 
  },
  libfiles = { 
    "/home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/lib/libcJSON.a" 
  },
  links = { 
    "cJSON" 
  } 
}

patching /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/lib/pkgconfig/cjson.pc ..
  => install cjson master .. ok
checking for mips-linux-uclibc-gnu-ar ... /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-ar
checking for the static library archiver (ar) ... mips-linux-uclibc-gnu-ar
configure
{
    clean = true
    kind = static
    proxy_pac = pac.lua
    cxflags = -fPIC
    mode = release
    plat = linux
    ccache = true
    theme = default
    target_os = linux
    host = linux
    ndk_stdcxx = true
    network = private
    pkg_searchdirs = gv_core
    buildir = build
    arch = jzt21
}
xmake --verbose
[  5%]: inserting.release ../../../../../../../../packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/lib/libcJSON.a
checking for mips-linux-uclibc-gnu-ar ... /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-ar
checking for the static library extractor (ex) ... mips-linux-uclibc-gnu-ar
checking for mips-linux-uclibc-gnu-gcc ... /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for the c compiler (cc) ... mips-linux-uclibc-gnu-gcc
checking for /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc ... ok
checking for flags (-O2) ... ok
checking for ccache ... /usr/bin/ccache
[  5%]: ccache compiling.release gv_tool/src/gv_getopt.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_getopt.c.o gv_tool/src/gv_getopt.c
[  5%]: ccache compiling.release gv_osal/src/gv_dfs.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_dfs.c.o gv_osal/src/gv_dfs.c
[  5%]: ccache compiling.release gv_tool/src/gv_json.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_json.c.o gv_tool/src/gv_json.c
[  5%]: ccache compiling.release gv_tool/src/gv_interpolation.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_interpolation.c.o gv_tool/src/gv_interpolation.c
[  5%]: ccache compiling.release gv_tool/src/gv_g711.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_g711.c.o gv_tool/src/gv_g711.c
[  5%]: ccache compiling.release gv_osal/src/gv_memory.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_memory.c.o gv_osal/src/gv_memory.c
[  5%]: ccache compiling.release gv_tool/src/gv_log.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_log.c.o gv_tool/src/gv_log.c
[  5%]: ccache compiling.release gv_tool/src/gv_iter.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_iter.c.o gv_tool/src/gv_iter.c
[  5%]: ccache compiling.release gv_osal/src/gv_time.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_time.c.o gv_osal/src/gv_time.c
[  5%]: ccache compiling.release gv_tool/src/gv_softwdg.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_softwdg.c.o gv_tool/src/gv_softwdg.c
[  5%]: ccache compiling.release gv_tool/src/gv_ring.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_ring.c.o gv_tool/src/gv_ring.c
[  5%]: ccache compiling.release gv_osal/src/gv_misc.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_misc.c.o gv_osal/src/gv_misc.c
[  5%]: ccache compiling.release gv_osal/src/gv_thread.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_thread.c.o gv_osal/src/gv_thread.c
[  5%]: ccache compiling.release gv_core_ver.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_core_ver.c.o gv_core_ver.c
[  5%]: ccache compiling.release gv_tool/src/gv_mdq.c
/usr/bin/ccache /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-gcc -c -fvisibility=hidden -Wall -Werror -O2 -std=gnu99 -I. -I/home/paste/.config/.xmake/plugins/include -Igv_osal/include -Igv_tool/include -D__GV_ARCH__=\"jzt21\" -D__GV_PLAT__=\"linux\" -D__GV_MODE__=\"release\" -D__GV_ARCH_JZT21__=1 -D__GV_PLAT_LINUX__=1 -D__GV_MODE_RELEASE__=1 -D __GV_GIT_BRANCH__=\"HEAD\" -D __GV_GIT_TAG__=\"release-1.0.10\" -D __GV_GIT_COMMIT__=\"7317682a7a6f445df6294d64a208660c38457a0c\" -D __GV_GIT_DATE__=\"20210909145846\" -isystem /home/paste/.config/.xmake/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/include -ffunction-sections -fdata-sections -fstack-protector-all -fPIC -DNDEBUG -o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_mdq.c.o gv_tool/src/gv_mdq.c
checking for flags (-MMD -MF) ... ok
checking for flags (-fdiagnostics-color=always) ... no
checking for flags (-fcolor-diagnostics) ... no
[ 89%]: archiving.release libgv_core.a
/home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-ar -cr build/linux/jzt21/release/libgv_core.a build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_ring.c.o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_getopt.c.o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_log.c.o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_interpolation.c.o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_softwdg.c.o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_g711.c.o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_mdq.c.o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_json.c.o build/.objs/gv_core/linux/jzt21/release/gv_tool/src/gv_iter.c.o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_dfs.c.o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_memory.c.o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_time.c.o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_thread.c.o build/.objs/gv_core/linux/jzt21/release/gv_osal/src/gv_misc.c.o build/.objs/gv_core/linux/jzt21/release/gv_core_ver.c.o build/.objs/gv_core/linux/jzt21/release/__/__/__/__/__/__/__/__/packages/c/cjson/master/c93259b2a2994e6494d9634e0997ce5c/lib/libcJSON.a.o.dir/cJSON.c.o
[100%]: build ok!
xmake install -y -o /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e --verbose
installing gv_core ..
installing gv_core to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e ..
> copy build/linux/jzt21/release/libgv_core.a to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/lib
> copy gv_tool/include/gv_softwdg.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_softwdg.h
> copy gv_tool/include/gv_mdq.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_mdq.h
> copy gv_tool/include/gv_json.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_json.h
> copy gv_tool/include/gv_security.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_security.h
> copy gv_tool/include/gv_g711.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_g711.h
> copy gv_tool/include/gv_log.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_log.h
> copy gv_tool/include/gv_iter.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_iter.h
> copy gv_tool/include/gv_ring.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_ring.h
> copy gv_tool/include/gv_interpolation.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_interpolation.h
> copy gv_tool/include/gv_getopt.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_getopt.h
> copy gv_osal/include/gv_thread.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_thread.h
> copy gv_osal/include/gv_misc.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_misc.h
> copy gv_osal/include/gv_net.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_net.h
> copy gv_osal/include/gv_memory.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_memory.h
> copy gv_osal/include/gv_time.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_time.h
> copy gv_osal/include/gv_dfs.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_dfs.h
> copy gv_core.h to /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include/gv_core.h
install ok!
checking for xmake::gv_core ... gv_core 1.0.10
{ 
  sysincludedirs = { 
    "/home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/include" 
  },
  static = true,
  syslinks = { 
    "pthread",
    "rt",
    "m",
    "dl" 
  },
  libfiles = { 
    "/home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/lib/libgv_core.a" 
  },
  links = { 
    "gv_core" 
  },
  linkdirs = { 
    "/home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/lib" 
  } 
}

patching /home/paste/.config/.xmake/packages/g/gv_core/1.0.10/6bf41e3503674a4c8dea69b5f10b978e/lib/pkgconfig/gv_core.pc ..
  => install gv_core 1.0.10 .. ok
checking for mips-linux-uclibc-gnu-ar ... /home/paste/.config/.xmake/packages/c/cross_toolchain/4.7.2/c645026c727b48af9839a050149c6f59/bin/mips-linux-uclibc-gnu-ar
checking for the static library archiver (ar) ... mips-linux-uclibc-gnu-ar
configure
{
    arch = jzt21
    pkg_searchdirs = gv_core
    mode = release
    ccache = true
    clean = true
    proxy_pac = pac.lua
    plat = linux
    theme = default
    kind = static
    ndk_stdcxx = true
    host = linux
    buildir = build
    network = private
    target_os = linux
}

发现在第一层打印 toolchains 为正常字符串 jzt21@cross_toolchain 在下一级依赖包(包内部自行 add_requires)打印 toolchains 却为 toolchains=table: 0x7f09315cf420 判断应该是因为 toolchains 在某种情况下表现为 table, 而 table 地址序列化为字符串是个不定值,导致的重复编译 而前面 ~/.local/share/xmake/modules/private/action/require/impl/package.lua : _init_requireinfo 打印的 project.get("target.toolchains") 前后类型也不一致

相关环境

waruqi commented 3 years ago

project.get("target.toolchains") : { "jzt21@cross_toolchain", "jzt21@cross_toolchain" }

你这 xmake.lua 里面 set_toolchains 怎么配置的,给我看下呢

waruqi commented 3 years ago

目前看是在装 gv_core 时候,这个包内部也是用了 xmake.lua 。。然后里面取到 toolchains 变成 table 。。需要看下 外层 xmake.lua 配置,和 gv_core 里面的配置才能确定 为啥会重复添加。。

透传到内部 xmake.lua 维护的包,会自动 add_toolchains 透传 toolchains ,但应该也只有一次,还是 string 才对

OuYangPaste commented 3 years ago

set_toolchains 是用远程拉取的交叉编译链:

toolchain("jzt21")
set_kind("cross") set_cross("mips-linux-uclibc-gnu-") toolchain_end() add_requires("cross_toolchain") set_toolchains("jzt21@cross_toolchain")

目前来说每一级的包都会 引用类似上面的配置(实际上是放在 ~/.config/.xmake/xmakerc.lua 的全局配置),也就是说 gv_core 和 其内部所引用的所有子包,只要是用 xmake 管的,都会生效

waruqi commented 3 years ago

这个project也是这么搞的 我也没法复现么 一切正常,装里面的zlib/xmake.lua port时候

https://github.com/xmake-io/xmake/blob/master/tests/projects/package/toolchain_muslcc/xmake.lua

OuYangPaste commented 3 years ago

我等下开个 github 测试仓弄个通用环境测试一下,看方不方便重现

OuYangPaste commented 3 years ago

问题定位到了,原因是因为 set_toolchains 我实际使用是带上内置变量的: set_toolchains("$(arch)@cross_toolchain") 如果改为 使用 get_config 则没有问题 比较奇特的是我另外开的通用测试程序中还是没能重现这个操作,暂时不能提供重现用例

waruqi commented 3 years ago

那就怪了,这个 内置变量 似乎也没啥必然关系。。我这也没法复现

OuYangPaste commented 3 years ago

内置变量这个我是基于原项目的环境,替换使用为 muslcc 一行行注释,改动,最后定位到的,但是同样的操作用测试代码+内置 repo,目前还没有重现,不排除有别的干扰导致的这种现象,我再一一比对差异

waruqi commented 3 years ago

理论上 重复设置 set_toolchains 我内部有去重的,不应该会出现两个 相同的值。。你可以全文搜下其他地方还有没有 set_toolschains 或者 add_toolchains 包括一些依赖包的xmake.lua 里面,看看是不是某个 set_toolchains 传递个 table 进去啥的

OuYangPaste commented 3 years ago

话说,xmaker.lua 本质上不是跟本地 xmake.lua 进行文件拼接 么... 现在能重现出来了,好像还跟 xmaker.lua 有关,我再对比一下等下把测试样例发上来

OuYangPaste commented 3 years ago

main.zip

OuYangPaste commented 3 years ago

xmakerc.zip 补上 xmakerc.lua

OuYangPaste commented 3 years ago

其中main 所依赖的 mul 包:https://github.com/OuYangPaste/test_mul 在前面手动集成 xmakerc.lua 的内容而不直接使用 xmakerc.lua 就会没有问题

waruqi commented 3 years ago

嗯 我明天再看下

waruqi commented 3 years ago

我这还是复现不了

macosxarm{debug=false,shared=false,toolchains=arm@muslcc} macosxarm{debug=false,pic=true,shared=false,toolchains=arm@muslcc} macosxarm{debug=false,pic=true,shared=false,toolchains=arm@muslcc}_main

waruqi commented 3 years ago

哦 你是放到了全局 xmakerc.lua 哈,终于复现了

OuYangPaste commented 3 years ago

整理完打算重新捋一遍复现步骤重新发,才看到你说复现了 Q_Q

waruqi commented 3 years ago

我修复了,你再试试,是因为 $(arch) 导致 set_toolchains 里面出现了 $(arch)@xxxarm@xxx 。。。因为现在去重是在 内置变量转义前做的,所以转义后 还会有部分重复数据。。我改了下解释器 应该可以了

waruqi commented 3 years ago

再试试,刚忘记提交了

OuYangPaste commented 3 years ago

测试过可以了,有个好奇的地方,为什么只有放 全局 xmakerc.lua 才会出现这个问题,而把 xmakerc.lua 的内容平铺到 各自 xmake.lua 前面却不会出现呢

waruqi commented 3 years ago

测试过可以了,有个好奇的地方,为什么只有放 全局 xmakerc.lua 才会出现这个问题,而把 xmakerc.lua 的内容平铺到 各自 xmake.lua 前面却不会出现呢

你平铺进去,仅仅对当前项目 xmake.lua 生效,取出来转义后的 arm@xxx 传入包里面的 xmake.lua 的 toolchains

所以子包和顶层包都是一个 arm@xxx,而你放入全局 xmakerc.lua,顶层项目透传转义后的 arm@xxx 进去,而子包自身又去全局加载了还没转义的 $(arch)@xxx 。。就出现两个值了。。

OuYangPaste commented 3 years ago

原来如此