xmake-io / xmake

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

xmake require downloads and installs wrong git branch without notice #1197

Closed Mai-Lapyst closed 3 years ago

Mai-Lapyst commented 3 years ago

Describe the bug

When installing a package (for example xmake require "lua 5.1.5") and a git url is used, then it checkouts the wrong branch/revision/tag without notifying the user.

Expected behavior

Either that the correct branch/tag is used; a error is printed, or the user is asked to use a more recent version.

Error output

If it is a xmake related compilation problem, please add the -v -D parameter and give the detailed compilation output information.

xmake require -vD "lua 5.1.5" configure { mode = debug ccache = true plat = linux ndk_stdcxx = true host = linux network = public proxy_pac = pac.lua vcpkg = /root/vcpkg theme = default buildir = build arch = x86_64 kind = static } checking for unzip ... /usr/bin/unzip checking for git ... /usr/bin/git checking for gzip ... /bin/gzip checking for tar ... /bin/tar checking for ping ... /bin/ping pinging for the host(github.com) ... 20 ms pinging for the host(gitee.com) ... 210 ms checking for nmap ... no pinging for the host(gitlab.com) ... 65535 ms finding lua from xmake .. checking for xmake::lua ... no checking for pacman ... no finding lua from brew .. checking for brew ... no finding lua from vcpkg .. checkinfo: cannot runv(vcpkg version), No such file or directory checking for vcpkg ... no finding lua from conan .. finding lua from pkg_config .. checking for pkg-config ... /usr/bin/pkg-config finding lua from system .. checking for lua ... no note: try installing these packages (pass -y to skip confirm)? in xmake-repo: -> lua 5.1.5 please input: y (y/n) y pinging for the host(www.lua.org) ... 65535 ms checking for curl ... /usr/bin/curl /usr/bin/curl -SL -A "Xmake/2.3.9+202011250029 (Linux;4.4.0-19041-Microsoft) curl/7.64.0" https://www.lua.org/ftp/lua-5.1.5.tar.gz -o lua-5.1.5.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above. error: @programdir/core/sandbox/modules/os.lua:387: execv(/usr/bin/curl -SL -A "Xmake/2.3.9+202011250029 (Linux;4.4.0-19041-Microsoft) curl/7.64.0" https://www.lua.org/ftp/lua-5.1.5.tar.gz -o lua-5.1.5.tar.gz) failed(60) stack traceback: [C]: in function 'error' [@programdir/core/base/os.lua:789]: in function 'raise' [@programdir/core/sandbox/modules/os.lua:387]: in function 'runv' [@programdir/core/sandbox/modules/os.lua:284]: in function 'vrunv' [@programdir/modules/net/http/download.lua:97]: in function 'download' [@programdir/actions/require/impl/actions/download.lua:123]: in function '_download' [@programdir/actions/require/impl/actions/download.lua:216]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/actions/require/impl/actions/download.lua:208]: in function 'action_download' [@programdir/actions/require/impl/package.lua:637]: in function 'jobfunc' [@programdir/modules/private/async/runjobs.lua:188]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/modules/private/async/runjobs.lua:182]: in function 'cotask' [@programdir/core/base/scheduler.lua:317]: => download https://www.lua.org/ftp/lua-5.1.5.tar.gz .. failed /usr/bin/git clone https://github.com/lua/lua.git --recursive source.tmp/lua Cloning into 'source.tmp/lua'... remote: Enumerating objects: 24509, done. remote: Total 24509 (delta 0), reused 0 (delta 0), pack-reused 24509 Receiving objects: 100% (24509/24509), 9.92 MiB | 7.94 MiB/s, done. Resolving deltas: 100% (18376/18376), done. /usr/bin/git checkout Your branch is up to date with 'origin/master'. => clone https://github.com/lua/lua.git 5.1.5 .. ok xmake f -y -c --diagnosis --verbose --plat=linux --arch=x86_64 --mode=release --cflags= --cxflags= --cxxflags= --asflags= --ldflags= checking for gcc ... /usr/bin/gcc checking for dmd ... no checking for ldc2 ... no checking for gdc ... no checking for ar ... /usr/bin/ar checking for the static library archiver (ar) ... ar configure { host = linux arch = x86_64 buildir = build mode = release proxy_pac = pac.lua plat = linux network = public cxxflags = cxflags = asflags = clean = true ccache = true cflags = ldflags = kind = static ndk_stdcxx = true theme = default } xmake --diagnosis --verbose checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for the c compiler (cc) ... gcc checking for ccache ... no [ 7%]: compiling.release lua.c /usr/bin/gcc -c -m64 -o build/.objs/lua/linux/x86_64/release/lua.c.o lua.c [ 20%]: compiling.release lcorolib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lcorolib.c.o lcorolib.c [ 12%]: compiling.release lauxlib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lauxlib.c.o lauxlib.c [ 30%]: compiling.release ldo.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/ldo.c.o ldo.c [ 57%]: compiling.release lopcodes.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lopcodes.c.o lopcodes.c [ 47%]: compiling.release lmathlib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lmathlib.c.o lmathlib.c [ 55%]: compiling.release lobject.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lobject.c.o lobject.c [ 60%]: compiling.release loslib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/loslib.c.o loslib.c [ 45%]: compiling.release llex.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/llex.c.o llex.c [ 42%]: compiling.release liolib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/liolib.c.o liolib.c [ 15%]: compiling.release lbaselib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lbaselib.c.o lbaselib.c [ 62%]: compiling.release lparser.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lparser.c.o lparser.c [ 50%]: compiling.release lmem.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lmem.c.o lmem.c [ 52%]: compiling.release loadlib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/loadlib.c.o loadlib.c [ 22%]: compiling.release lctype.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lctype.c.o lctype.c [ 17%]: compiling.release lcode.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lcode.c.o lcode.c [ 10%]: compiling.release lapi.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lapi.c.o lapi.c [ 25%]: compiling.release ldblib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/ldblib.c.o ldblib.c [ 40%]: compiling.release linit.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/linit.c.o linit.c [ 27%]: compiling.release ldebug.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/ldebug.c.o ldebug.c [ 32%]: compiling.release ldump.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/ldump.c.o ldump.c [ 37%]: compiling.release lgc.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lgc.c.o lgc.c [ 35%]: compiling.release lfunc.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lfunc.c.o lfunc.c [ 65%]: compiling.release lstate.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lstate.c.o lstate.c checking for /usr/bin/gcc ... ok checking for flags (-MMD -MF) ... ok > gcc "-MMD" "-MF" "/dev/null" "-m64" checking for flags (-fcolor-diagnostics) ... no > gcc "-fcolor-diagnostics" "-m64" checkinfo: @programdir/core/sandbox/modules/os.lua:258: gcc: error: unrecognized command line option ‘-fcolor-diagnostics’ stack traceback: [C]: in function 'error' [@programdir/core/base/os.lua:789]: in function 'raise' [@programdir/core/sandbox/modules/os.lua:258]: in function 'runv' [@programdir/modules/detect/tools/gcc/has_flags.lua:42]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/modules/detect/tools/gcc/has_flags.lua:42]: in function 'hasflags' [@programdir/modules/lib/detect/has_flags.lua:114]: in function 'has_flags' [@programdir/modules/core/tools/gcc.lua:367]: in function '_has_color_diagnostics' [@programdir/modules/core/tools/gcc.lua:444]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/modules/core/tools/gcc.lua:429]: [C]: in function 'compile' [@programdir/modules/private/action/build/object.lua:78]: in function 'script' [@programdir/modules/private/action/build/object.lua:91]: in function '_build_object' [@programdir/modules/private/action/build/object.lua:116]: in function 'jobfunc' [@programdir/modules/private/async/runjobs.lua:188]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/modules/private/async/runjobs.lua:182]: in function 'cotask' [@programdir/core/base/scheduler.lua:317]: checking for flags (-fdiagnostics-color=always) ... ok > gcc "-fdiagnostics-color=always" "-m64" [ 67%]: compiling.release lstring.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lstring.c.o lstring.c [ 70%]: compiling.release lstrlib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lstrlib.c.o lstrlib.c [ 72%]: compiling.release ltable.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/ltable.c.o ltable.c [ 75%]: compiling.release ltablib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/ltablib.c.o ltablib.c [ 77%]: compiling.release ltests.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/ltests.c.o ltests.c [ 80%]: compiling.release ltm.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/ltm.c.o ltm.c [ 82%]: compiling.release lundump.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lundump.c.o lundump.c [ 85%]: compiling.release lutf8lib.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lutf8lib.c.o lutf8lib.c [ 87%]: compiling.release lvm.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lvm.c.o lvm.c [ 90%]: compiling.release lzio.c /usr/bin/gcc -c -m64 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 -DLUA_USE_LINUX -DLUA_DL_DLOPEN -o build/.objs/lualib/linux/x86_64/release/lzio.c.o lzio.c [ 92%]: archiving.release liblua.a /usr/bin/ar -cr build/linux/x86_64/release/liblua.a build/.objs/lualib/linux/x86_64/release/lapi.c.o build/.objs/lualib/linux/x86_64/release/lauxlib.c.o build/.objs/lualib/linux/x86_64/release/lbaselib.c.o build/.objs/lualib/linux/x86_64/release/lcode.c.o build/.objs/lualib/linux/x86_64/release/lcorolib.c.o build/.objs/lualib/linux/x86_64/release/lctype.c.o build/.objs/lualib/linux/x86_64/release/ldblib.c.o build/.objs/lualib/linux/x86_64/release/ldebug.c.o build/.objs/lualib/linux/x86_64/release/ldo.c.o build/.objs/lualib/linux/x86_64/release/ldump.c.o build/.objs/lualib/linux/x86_64/release/lfunc.c.o build/.objs/lualib/linux/x86_64/release/lgc.c.o build/.objs/lualib/linux/x86_64/release/linit.c.o build/.objs/lualib/linux/x86_64/release/liolib.c.o build/.objs/lualib/linux/x86_64/release/llex.c.o build/.objs/lualib/linux/x86_64/release/lmathlib.c.o build/.objs/lualib/linux/x86_64/release/lmem.c.o build/.objs/lualib/linux/x86_64/release/loadlib.c.o build/.objs/lualib/linux/x86_64/release/lobject.c.o build/.objs/lualib/linux/x86_64/release/lopcodes.c.o build/.objs/lualib/linux/x86_64/release/loslib.c.o build/.objs/lualib/linux/x86_64/release/lparser.c.o build/.objs/lualib/linux/x86_64/release/lstate.c.o build/.objs/lualib/linux/x86_64/release/lstring.c.o build/.objs/lualib/linux/x86_64/release/lstrlib.c.o build/.objs/lualib/linux/x86_64/release/ltable.c.o build/.objs/lualib/linux/x86_64/release/ltablib.c.o build/.objs/lualib/linux/x86_64/release/ltests.c.o build/.objs/lualib/linux/x86_64/release/ltm.c.o build/.objs/lualib/linux/x86_64/release/lundump.c.o build/.objs/lualib/linux/x86_64/release/lutf8lib.c.o build/.objs/lualib/linux/x86_64/release/lvm.c.o build/.objs/lualib/linux/x86_64/release/lzio.c.o checking for g++ ... /usr/bin/g++ checking for the linker (ld) ... g++ [ 97%]: linking.release lua /usr/bin/g++ -o build/linux/x86_64/release/lua build/.objs/lua/linux/x86_64/release/lua.c.o -m64 -Lbuild/linux/x86_64/release -llua -ldl [100%]: build ok! xmake install -y -o /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d --diagnosis --verbose installing lualib .. installing to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d .. > copy build/linux/x86_64/release/liblua.a to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/lib > copy lapi.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lapi.h > copy lauxlib.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lauxlib.h > copy lcode.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lcode.h > copy lctype.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lctype.h > copy ldebug.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/ldebug.h > copy ldo.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/ldo.h > copy lfunc.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lfunc.h > copy lgc.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lgc.h > copy ljumptab.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/ljumptab.h > copy llex.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/llex.h > copy llimits.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/llimits.h > copy lmem.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lmem.h > copy lobject.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lobject.h > copy lopcodes.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lopcodes.h > copy lopnames.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lopnames.h > copy lparser.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lparser.h > copy lprefix.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lprefix.h > copy lstate.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lstate.h > copy lstring.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lstring.h > copy ltable.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/ltable.h > copy ltests.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/ltests.h > copy ltm.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/ltm.h > copy lua.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lua.h > copy luaconf.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/luaconf.h > copy lualib.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lualib.h > copy lundump.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lundump.h > copy lvm.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lvm.h > copy lzio.h to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua/lzio.h installing lua .. installing to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d .. > copy build/linux/x86_64/release/lua to /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/bin install ok! finding lua from xmake .. checking for xmake::lua ... lua 5.1.5 { static = true, sysincludedirs = { "/root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua" }, syslinks = { "dl", "m" }, links = { "lua" }, libfiles = { "/root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/lib/liblua.a" }, linkdirs = { "/root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/lib" }, version = "5.1.5" } patching /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/lib/pkgconfig/lua.pc .. lua -e "print('hello xmake!')" hello xmake! checking for ccache ... no > /usr/bin/gcc -c -m64 -isystem /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua -o /dev/shm/.xmake0/210113/_4C0FF7D700FD4D108C6D461C8FF01340.o /dev/shm/.xmake0/210113/_A77928144BBC4A2088ECE4BFB04DC560.c checking for /usr/bin/gcc ... ok checking for flags (-fcolor-diagnostics) ... no > gcc "-fcolor-diagnostics" "-m64" checkinfo: @programdir/core/sandbox/modules/os.lua:258: gcc: error: unrecognized command line option ‘-fcolor-diagnostics’ stack traceback: [C]: in function 'error' [@programdir/core/base/os.lua:789]: in function 'raise' [@programdir/core/sandbox/modules/os.lua:258]: in function 'runv' [@programdir/modules/detect/tools/gcc/has_flags.lua:42]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/modules/detect/tools/gcc/has_flags.lua:42]: in function 'hasflags' [@programdir/modules/lib/detect/has_flags.lua:114]: in function 'has_flags' [@programdir/modules/core/tools/gcc.lua:367]: in function '_has_color_diagnostics' [@programdir/modules/core/tools/gcc.lua:444]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/modules/core/tools/gcc.lua:429]: [C]: in function 'compile' [...amdir/core/sandbox/modules/import/core/tool/compiler.lua:82]: in function 'compile' [@programdir/modules/lib/detect/check_cxsnippets.lua:197]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/modules/lib/detect/check_cxsnippets.lua:192]: in function 'has_cfuncs' [.../.xmake/repositories/xmake-repo/packages/l/lua/xmake.lua:71]: in function 'script' [...gramdir/actions/require/impl/actions/../utils/filter.lua:120]: in function 'call' [@programdir/actions/require/impl/actions/test.lua:50]: in function 'test' [@programdir/actions/require/impl/actions/install.lua:203]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/actions/require/impl/actions/install.lua:127]: in function 'action_install' [@programdir/actions/require/impl/package.lua:644]: in function 'jobfunc' [@programdir/modules/private/async/runjobs.lua:188]: [C]: in function 'trycall' [@programdir/core/sandbox/modules/try.lua:121]: in function 'try' [@programdir/modules/private/async/runjobs.lua:182]: in function 'cotask' [@programdir/core/base/scheduler.lua:317]: checking for flags (-fdiagnostics-color=always) ... ok > gcc "-fdiagnostics-color=always" "-m64" > /usr/bin/g++ -o /dev/shm/.xmake0/210113/_80E563BE4C4341008CD03ADEB7FA5900.b /dev/shm/.xmake0/210113/_4C0FF7D700FD4D108C6D461C8FF01340.o -m64 -L/root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/lib -llua -ldl -lm > checking for c includes(lua.h) > checking for c funcs(lua_getinfo) > checking for c links(lua, dl, m) > checking for c snippet(has_cfuncs) => install lua 5.1.5 .. ok
$  xmake require -vD --info "lua 5.1.5"
configure
{
    vcpkg = /root/vcpkg
    ndk_stdcxx = true
    arch = x86_64
    buildir = build
    host = linux
    proxy_pac = pac.lua
    plat = linux
    theme = default
    network = public
    kind = static
    ccache = true
    mode = debug
}
The package info of project:
    require(lua 5.1.5):
      -> description: A powerful, efficient, lightweight, embeddable scripting language.
      -> version: 5.1.5
      -> urls:
         -> https://www.lua.org/ftp/lua-5.1.5.tar.gz
            -> 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
         -> https://github.com/lua/lua.git
            -> 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
      -> repo: xmake-repo https://github.com/xmake-io/xmake-repo.git master
      -> cachedir: /root/.xmake/cache/packages/2101/l/lua/5.1.5
      -> installdir: /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d
      -> searchdirs:
      -> searchnames: lua.git, lua-5.1.5.tar.gz
      -> fetchinfo: 5.1.5
          -> sysincludedirs: /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/include/lua
          -> links: lua
          -> static: true
          -> linkdirs: /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/lib
          -> syslinks: dl m
          -> libfiles: /root/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/lib/liblua.a
          -> version: 5.1.5
      -> platforms: android, macosx, windows, linux, bsd
      -> requires:
         -> plat: linux
         -> arch: x86_64
         -> configs:
            -> debug: false
            -> vs_runtime: MT
            -> shared: false
      -> configs:
      -> configs (builtin):
         -> debug: Enable debug symbols. (default: false)
         -> shared: Enable shared library. (default: false)
         -> cflags: Set the C compiler flags.
         -> cxflags: Set the C/C++ compiler flags.
         -> cxxflags: Set the C++ compiler flags.
         -> asflags: Set the assembler flags.
         -> vs_runtime: Set vs compiler runtime. (default: MT)
            -> values: {"MT","MD"}
$ ~/.xmake/packages/l/lua/5.1.5/531f88cff3a64da0aa3fb05ee281ab7d/bin/lua -v
Lua 5.4.2  Copyright (C) 1994-2020 Lua.org, PUC-Rio

Related Environment

Additional Information

Tryed to search in the sources to find the bug, it seems that the line https://github.com/xmake-io/xmake/blob/3e71f67b9c4be2e3bd0531338d8177ce4734eaa3/xmake/actions/require/impl/actions/download.lua#L75

is getting nil as first argument, which leads to no checkout and keeping the default branch (master).

waruqi commented 3 years ago

I have improved xmake on dev branch and xmake-repo/lua package to support it.

You can update to xmake/dev to try it again.

In addition, I found that lua git does not have a 5.1.5 tag, so I modified the last tag of lua 5.1 to 5.1.1

$ xmake update dev
$ xmake repo -u
$ xmake require -vD "lua 5.1.1"

related patch: https://github.com/xmake-io/xmake-repo/commit/ee7110d8cbcb0b0044d0e291efa5292da64fb855

BTW, you can also use xrepo command to install package.

$ xrepo update-repo
$ xrepo install -vD "lua 5.1.1"
$ xrepo info "lua 5.1.1"
waruqi commented 3 years ago

Does it work?

waruqi commented 3 years ago

It should work.