xmake-io/xmake-repo

quadsort 构建失败

Closed this issue · 1 comments

Xmake 版本

xmake v2.9.3+dev.1556ddbf9

操作系统版本和架构

Linux 5.16.0-1-amd64 #1 SMP PREEMPT Debian 5.16.7-2 (2022-02-09) x86_64 GNU/Linux

描述问题

  1. quadsort 2023.02.03 版本无法通过包描述中测试脚本, 2024.07.27版本可以通过测试脚本
  2. quadsort 中使用了 VLA 特性, 无法通过 CI

期待的结果

quadsort 可成功导入

工程配置

add_requires('quadsort')

target('quadsort', function()
  set_kind('binary')
  add_files('main.c')

  add_packages('quadsort')

  before_build(function(T)
    io.writefile(
      'main.c',
      [[
#include <quadsort.h>

int main() { return 0; }
]]
    )
  end)
end)

附加信息和错误日志

checking for platform ... linux
checking for architecture ... x86_64
checking for gcc ... /usr/bin/gcc
checking for zig ... /usr/local/bin/zig
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... no
checkinfo: cannot runv(nim --version), No such file or directory
checking for nim ... 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
finding quadsort from xmake ..
checking for xmake::quadsort ... no
checkinfo: cannot runv(pacman --version), No such file or directory
checking for pacman ... no
checkinfo: cannot runv(emerge --version), No such file or directory
checking for emerge ... no
finding quadsort from brew ..
checking for brew ... no
finding quadsort from vcpkg ..
finding quadsort from conan ..
finding quadsort from pkgconfig ..
checking for pkg-config ... /usr/bin/pkg-config
finding quadsort from system ..
checking for gcc ... /usr/bin/gcc
checking for the c compiler (cc) ... gcc
checking for /usr/bin/gcc ... ok
checking for flags (-fPIC) ... ok
> gcc "-fPIC" "-m64"
> /usr/bin/gcc -c -m64 -o /tmp/.xmake1000/240830/_C52D459D61AD47308C321F34D971C960.o /tmp/.xmake1000/240830/_775FB00633BC4F66BF87D39CCDE5CF30.c
checking for flags (-fdiagnostics-color=always) ... ok
> gcc "-fdiagnostics-color=always" "-m64"
checking for g++ ... /usr/bin/g++
checking for the linker (ld) ... g++
checking for /usr/bin/g++ ... ok
checking for flags (-fPIC) ... ok
> g++ "-fPIC" "-m64" "-m64"
> /usr/bin/g++ -o /tmp/.xmake1000/240830/_C52D459D61AD47308C321F34D971C960.b /tmp/.xmake1000/240830/_C52D459D61AD47308C321F34D971C960.o -m64 -lquadsort
/usr/bin/ld: 找不到 -lquadsort: 没有那个文件或目录
collect2: error: ld returned 1 exit status
> checking for c links(quadsort)
> checking for c snippet(find_package/quadsort)
checkinfo: ...gramdir/core/sandbox/modules/import/core/tool/linker.lua:75: @programdir/core/sandbox/modules/os.lua:378: execv(/usr/bin/g++ -o /tmp/.xmake1000/240830/_C52D459D61AD47308C321F34D971C960.b /tmp/.xmake1000/240830/_C52D459D61AD47308C321F34D971C960.o -m64 -lquadsort) failed(1)
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:973]:
    [@programdir/core/sandbox/modules/os.lua:378]: in function 'execv'
    [@programdir/modules/core/tools/gcc.lua:580]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]:
    [@programdir/core/tool/linker.lua:221]: in function 'link'
    [...gramdir/core/sandbox/modules/import/core/tool/linker.lua:73]: in function 'link'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:249]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
    [@programdir/modules/package/manager/system/find_package.lua:103]:
    [@programdir/modules/package/manager/find_package.lua:84]: in function '_find_package_with_builtin_rule'
    [@programdir/modules/package/manager/find_package.lua:130]: in function '_find_package'
    [@programdir/modules/package/manager/find_package.lua:194]:
    [@programdir/modules/lib/detect/find_package.lua:109]:
    [@programdir/core/package/package.lua:1844]: in function '_fetch_library'
    [@programdir/core/package/package.lua:2011]: in function 'fetch'
    [...modules/private/action/require/impl/install_packages.lua:335]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/async/runjobs.lua:223]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

checking for quadsort ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> quadsort 2023.02.03 
please input: y (y/n/m)
y
checking for ping ... /usr/bin/ping
pinging the host(github.com) ... 331 ms
/usr/bin/git -c core.fsmonitor=false clean -d -f -x
/usr/bin/git -c core.fsmonitor=false reset --hard
HEAD 现在位于 7b4e7b1 1.1.5.4
finding quadsort from xmake ..
checking for xmake::quadsort ... quadsort 2023.02.03
{ 
  sysincludedirs = { 
    "/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include" 
  },
  version = "2023.02.03",
  license = "MIT" 
}

patching /home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/lib/pkgconfig/quadsort.pc ..
> /usr/bin/gcc -c -m64 -isystem /home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include -o /tmp/.xmake1000/240830/_7762180B32AA4E10826775AB9C8EEA50.o /tmp/.xmake1000/240830/_C62B170B94D7438DBF0BFD881E4606F9.c
> checking for c includes(quadsort.h)
> checking for c funcs(quadsort)
> checking for c snippet(has_cfuncs)
checkinfo: ...amdir/core/sandbox/modules/import/core/tool/compiler.lua:84: @programdir/modules/core/tools/gcc.lua:916: In file included from /home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.h:102,
                 from /tmp/.xmake1000/240830/_C62B170B94D7438DBF0BFD881E4606F9.c:2:
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c: In function ‘quad_merge_block32’:
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c:532:25: error: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
  532 |                         memcpy(swap, array, block_x_2 * sizeof(VAR));
      |                         ^~~~~~
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
  +++ |+#include <string.h>
    1 | /*
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c: In function ‘trinity_rotation32’:
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c:703:25: error: implicit declaration of function ‘memmove’ [-Wimplicit-function-declaration]
  703 |                         memmove(array, array + left, right * sizeof(VAR));
      |                         ^~~~~~~
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c:703:25: note: include ‘<string.h>’ or provide a declaration of ‘memmove’
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:973]:
    [@programdir/modules/core/tools/gcc.lua:916]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [@programdir/modules/core/tools/gcc.lua:857]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]:
    [@programdir/core/tool/compiler.lua:278]: in function 'compile'
    [...amdir/core/sandbox/modules/import/core/tool/compiler.lua:82]: in function 'compile'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:244]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
    [...ke/repositories/xmake-repo/packages/q/quadsort/xmake.lua:16]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [...dir/modules/private/action/require/impl/actions/test.lua:41]:
    [.../modules/private/action/require/impl/actions/install.lua:444]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:370]:
    [...modules/private/action/require/impl/install_packages.lua:491]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/async/runjobs.lua:223]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

error: ...ke/repositories/xmake-repo/packages/q/quadsort/xmake.lua:16: ...amdir/core/sandbox/modules/import/core/tool/compiler.lua:84: @programdir/modules/core/tools/gcc.lua:916: In file included from /home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.h:102,
                 from /tmp/.xmake1000/240830/_C62B170B94D7438DBF0BFD881E4606F9.c:2:
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c: In function ‘quad_merge_block32’:
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c:532:25: error: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
  532 |                         memcpy(swap, array, block_x_2 * sizeof(VAR));
      |                         ^~~~~~
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
  +++ |+#include <string.h>
    1 | /*
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c: In function ‘trinity_rotation32’:
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c:703:25: error: implicit declaration of function ‘memmove’ [-Wimplicit-function-declaration]
  703 |                         memmove(array, array + left, right * sizeof(VAR));
      |                         ^~~~~~~
/home/iccy/.xmake/packages/q/quadsort/2023.02.03/432fe406bc5f442fbfa0c774916a12ea/include/quadsort.c:703:25: note: include ‘<string.h>’ or provide a declaration of ‘memmove’
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:973]:
    [@programdir/modules/core/tools/gcc.lua:916]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [@programdir/modules/core/tools/gcc.lua:857]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]:
    [@programdir/core/tool/compiler.lua:278]: in function 'compile'
    [...amdir/core/sandbox/modules/import/core/tool/compiler.lua:82]: in function 'compile'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:244]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/lib/detect/check_cxsnippets.lua:236]:
    [...ke/repositories/xmake-repo/packages/q/quadsort/xmake.lua:16]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [...dir/modules/private/action/require/impl/actions/test.lua:41]:
    [.../modules/private/action/require/impl/actions/install.lua:444]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:370]:
    [...modules/private/action/require/impl/install_packages.lua:491]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:275]: in function 'trycall'
    [@programdir/core/sandbox/modules/try.lua:117]: in function 'try'
    [@programdir/modules/async/runjobs.lua:223]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

  => install quadsort 2023.02.03 .. failed
error: @programdir/core/main.lua:329: @programdir/core/sandbox/modules/import/core/base/task.lua:65: @programdir/modules/async/runjobs.lua:325: .../modules/private/action/require/impl/actions/install.lua:506: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:973]:
    [.../modules/private/action/require/impl/actions/install.lua:506]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:370]:
    [...modules/private/action/require/impl/install_packages.lua:491]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:

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

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


Title: quadsort build failed