xmake-io / xmake-repo

📦 An official xmake package repository
https://xrepo.xmake.io
Apache License 2.0
627 stars 377 forks source link

zlib compile with clang-cl failed #4585

Closed KVM-Explorer closed 3 weeks ago

KVM-Explorer commented 3 weeks ago

Xmake 版本

2.9.2

操作系统版本和架构

Windows10 1809,Windows10 22h2

描述问题

基于clang-cl工具链安装zlib 1.3.1失败,基于日志分析,判断下载并编译成功,但是无法通过zlib package第89行的验证测试导致安装失败

期待的结果

成功按照基于clang-cl编译生成的zlib库

工程配置

xrepo install --toolchain=clang-cl zlib

附加信息和错误日志

E:\ywh\BeaconRenderer>xrepo install -vD --toolchain=clang-cl zlib
C:\Program Files\xmake\xmake.exe f -c --require=n -vD --toolchain=clang-cl
checking for platform ... windows
checking for architecture ... x64
checking for clang-cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin\clang-cl.exe
checking for Microsoft Visual Studio (x64) version ... 2019
checking for LLVM Clang C/C++ Compiler (x64) version ... 12.0.0
checking for cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe
checking for link.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
configure
{
    plat = windows
    toolchain = clang-cl
    kind = static
    host = windows
    mode = release
    arch = x64
    ccache = true
    buildir = build
    clean = true
    vs = 2019
    ndk_stdcxx = true
}
C:\Program Files\xmake\xmake.exe require -v -D -j 34 --extra={system=false} zlib
checkinfo: cannot runv(unzip.exe -v), No such file or directory
checking for unzip ... no
checking for 7z ... C:\Program Files\xmake\winenv\bin\7z
checking for git ... ok
checkinfo: cannot runv(gzip.exe --version), No such file or directory
checking for gzip ... no
git rev-parse HEAD
finding zlib from xmake ..
checking for xmake::zlib ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> zlib v1.3.1 [runtimes:"MT", toolchains:"clang-cl"]
please input: y (y/n/m)
y
checking for ping ... ok
pinging the host(github.com) ... 97 ms
C:\Program Files\xmake\winenv\bin\7z x -y v1.3.1.tar.gz -oC:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_81457EA20F9E4F4089651A6B5D1F39A0.tar

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 1572744 bytes (1536 KiB)

Extracting archive: v1.3.1.tar.gz
--
Path = v1.3.1.tar.gz
Type = gzip
Headers Size = 10

Everything is Ok

Size:       4618240
Compressed: 1572744
C:\Program Files\xmake\winenv\bin\7z x -y C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_81457EA20F9E4F4089651A6B5D1F39A0.tar\v1.3.1.tar -osource.tmp

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 4618240 bytes (4510 KiB)

Extracting archive: C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_81457EA20F9E4F4089651A6B5D1F39A0.tar\v1.3.1.tar
--
Path = C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_81457EA20F9E4F4089651A6B5D1F39A0.tar\v1.3.1.tar
Type = tar
Physical Size = 4618240
Headers Size = 154624
Code Page = UTF-8

Everything is Ok

Folders: 39
Files: 258
Size:       4398673
Compressed: 4618240
checking for Microsoft Visual Studio (x64) version ... 2019
C:\Program Files\xmake\xmake.exe f --diagnosis --verbose -y -c --plat=windows --arch=x64 --mode=release --kind=static --vs=2019 --runtimes=MT --runtimes=MT --toolchain=clang-cl --buildir=build_128ef973
checking for clang-cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin\clang-cl.exe
checking for Microsoft Visual Studio (x64) version ... 2019
checking for LLVM Clang C/C++ Compiler (x64) version ... 12.0.0
checking for clang-cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin\clang-cl.exe
checking for the c compiler (cc) ... clang-cl.exe
> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -DHAVE_SYS_TYPES_H -FoC:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_C1ECFE8521164F108CA40AA8180F7050.o C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_83451946B9C94C818D3008591D49D3D1.c
checking for C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin\clang-cl.exe ... ok
checking for flags (-fcolor-diagnostics) ... ok
> clang-cl.exe "-fcolor-diagnostics" "-m64"
checking for flags (-fansi-escape-codes) ... ok
> clang-cl.exe "-fansi-escape-codes" "-m64"
checking for the c compiler (cc) ... clang-cl.exe
> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -DHAVE_STDINT_H -FoC:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_62494BC8399746508B5A2A6A680BD3C0.o C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_D8DE1803C59C4770864681C4AE1591AF.c
checking for the c compiler (cc) ... clang-cl.exe
> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -DZ_HAVE_UNISTD_H -FoC:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_D5A6D02D6C1F404089B14CBDDF85FF90.o C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_06B26C42C6C94ECCB898078100E7B0D0.c
checking for the c compiler (cc) ... clang-cl.exe
> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -DHAVE_STDDEF_H -FoC:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_D12177DB123549208B870177D6FC0B60.o C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_B3FAE03131E84BCF980C567ED51E281A.c
> checking for c includes(sys/types.h)
checking for HAVE_SYS_TYPES_H ... ok
> checking for c includes(stdint.h)
checking for HAVE_STDINT_H ... ok
> checking for c includes(unistd.h)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:84: @programdir\modules\core\tools\clang_cl.lua:199: C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_06B26C42C6C94ECCB898078100E7B0D0.c(2,10): fatal error: 'unistd.h' file not found
#include <unistd.h>
         ^~~~~~~~~~
1 error generated.
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [@programdir\modules\core\tools\clang_cl.lua:199]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\clang_cl.lua:152]:
    [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]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]:
    [@programdir\core\project\option.lua:205]: in function '_do_check_cxsnippets'
    [@programdir\core\project\option.lua:257]:
    [@programdir\core\project\option.lua:305]: in function '_check'
    [@programdir\core\project\option.lua:362]: in function 'check'
    [...dir\core\sandbox\modules\import\core\project\project.lua:108]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:238]:
    [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:220]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:406]:

checking for Z_HAVE_UNISTD_H ... no
> checking for c includes(stddef.h)
checking for HAVE_STDDEF_H ... ok
configure
{
    runtimes = MT
    clean = true
    buildir = build_128ef973
    plat = windows
    host = windows
    toolchain = clang-cl
    vs = 2019
    ccache = true
    arch = x64
    kind = static
    mode = release
    ndk_stdcxx = true
}
C:\Program Files\xmake\xmake.exe build --diagnosis --verbose --jobs=34
checking for flags (-O2) ... ok
> clang-cl.exe "-O2" "-m64"
checking for flags (-DNDEBUG) ... ok
> clang-cl.exe "-DNDEBUG" "-m64"
checking for clang-cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin\clang-cl.exe
checking for the c++ compiler (cxx) ... clang-cl.exe
[ 88%]: cache compiling.release adler32.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\adler32.c.obj adler32.c
[ 88%]: cache compiling.release compress.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\compress.c.obj compress.c
[ 88%]: cache compiling.release zutil.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\zutil.c.obj zutil.c
[ 88%]: cache compiling.release uncompr.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\uncompr.c.obj uncompr.c
[ 88%]: cache compiling.release trees.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\trees.c.obj trees.c
[ 88%]: cache compiling.release inffast.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\inffast.c.obj inffast.c
[ 88%]: cache compiling.release inftrees.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\inftrees.c.obj inftrees.c
[ 88%]: cache compiling.release infback.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\infback.c.obj infback.c
[ 88%]: cache compiling.release inflate.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\inflate.c.obj inflate.c
[ 88%]: cache compiling.release gzwrite.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\gzwrite.c.obj gzwrite.c
[ 88%]: cache compiling.release gzread.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\gzread.c.obj gzread.c
[ 88%]: cache compiling.release gzlib.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\gzlib.c.obj gzlib.c
[ 88%]: cache compiling.release gzclose.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\gzclose.c.obj gzclose.c
[ 88%]: cache compiling.release deflate.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\deflate.c.obj deflate.c
[ 88%]: cache compiling.release crc32.c
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -O2 -MT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_SYS_TYPES_H -DHAVE_STDINT_H -DHAVE_STDDEF_H -DNDEBUG -Fobuild_128ef973\.objs\zlib\windows\x64\release\crc32.c.obj crc32.c
checking for cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe
checking for link.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\link.exe
checking for the static library archiver (ar) ... link.exe
[ 94%]: archiving.release zlib.lib
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\link.exe" -lib -nologo -machine:x64 /opt:ref /opt:icf -out:build_128ef973\windows\x64\release\zlib.lib build_128ef973\.objs\zlib\windows\x64\release\adler32.c.obj build_128ef973\.objs\zlib\windows\x64\release\compress.c.obj build_128ef973\.objs\zlib\windows\x64\release\crc32.c.obj build_128ef973\.objs\zlib\windows\x64\release\deflate.c.obj build_128ef973\.objs\zlib\windows\x64\release\gzclose.c.obj build_128ef973\.objs\zlib\windows\x64\release\gzlib.c.obj build_128ef973\.objs\zlib\windows\x64\release\gzread.c.obj build_128ef973\.objs\zlib\windows\x64\release\gzwrite.c.obj build_128ef973\.objs\zlib\windows\x64\release\inflate.c.obj build_128ef973\.objs\zlib\windows\x64\release\infback.c.obj build_128ef973\.objs\zlib\windows\x64\release\inftrees.c.obj build_128ef973\.objs\zlib\windows\x64\release\inffast.c.obj build_128ef973\.objs\zlib\windows\x64\release\trees.c.obj build_128ef973\.objs\zlib\windows\x64\release\uncompr.c.obj build_128ef973\.objs\zlib\windows\x64\release\zutil.c.obj

build cache stats:
cache directory: build_128ef973\.build_cache
cache hit rate: 0%
cache hit: 0
cache hit total time: 0.000s
cache miss: 0
cache miss total time: 0.000s
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.000s

[100%]: build ok, spent 1.64s
C:\Program Files\xmake\xmake.exe install -y --nopkgs -o C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16 --diagnosis --verbose
installing zlib ..
installing zlib to C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16 ..
> copy build_128ef973\windows\x64\release\zlib.lib to C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\lib
> copy zlib.h to C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\include\zlib.h
> copy zconf.h to C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\include\zconf.h
install ok!
finding zlib from xmake ..
checking for xmake::zlib ... zlib v1.3.1
{
  static = true,
  license = "zlib",
  libfiles = {
    "C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\lib\zlib.lib"
  },
  version = "v1.3.1",
  linkdirs = {
    "C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\lib"
  },
  links = {
    "zlib"
  },
  sysincludedirs = {
    "C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\include"
  }
}

patching C:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\lib\pkgconfig\zlib.pc ..
checking for the linker (ld) ... link.exe
checking for clang-cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin\clang-cl.exe
checking for the c compiler (cc) ... clang-cl.exe
checking for C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin\clang-cl.exe ... ok
checking for flags (-MT) ... ok
> clang-cl.exe "-MT" "-m64"
checking for flags (cl_external_includedir) ... ok
> clang-cl.exe "-external:W0" "-external:IC:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\include" "-m64"
> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe" -c -m64 -MT -external:W0 -external:IC:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\include -FoC:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_267F348AA1F24A4089BA1054F86EBB50.o C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_DA0C2BE4F695434A847B3B5877F6A479.c
checking for flags (-fcolor-diagnostics) ... ok
> clang-cl.exe "-fcolor-diagnostics" "-m64"
checking for flags (-fansi-escape-codes) ... ok
> clang-cl.exe "-fansi-escape-codes" "-m64"
> checking for c includes(zlib.h)
> checking for c funcs(inflate)
> checking for c links(zlib)
> checking for c snippet(has_cfuncs)
checkinfo: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:84: @programdir\modules\core\tools\clang_cl.lua:199: clang-cl: warning: unknown argument ignored in clang-cl: '-external:W0' [-Wunknown-argument]
clang-cl: warning: unknown argument ignored in clang-cl: '-external:IC:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\include' [-Wunknown-argument]
C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_DA0C2BE4F695434A847B3B5877F6A479.c(2,10): fatal error: 'zlib.h' file not found
#include <zlib.h>
         ^~~~~~~~
1 error generated.
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [@programdir\modules\core\tools\clang_cl.lua:199]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\clang_cl.lua:152]:
    [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]:
    [....xmake\repositories\xmake-repo\packages\z\zlib\xmake.lua:89]: 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:489]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:238]:
    [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:220]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:406]:

error: ....xmake\repositories\xmake-repo\packages\z\zlib\xmake.lua:89: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:84: @programdir\modules\core\tools\clang_cl.lua:199: clang-cl: warning: unknown argument ignored in clang-cl: '-external:W0' [-Wunknown-argument]
clang-cl: warning: unknown argument ignored in clang-cl: '-external:IC:\Users\NBJL#1\AppData\Local\.xmake\packages\z\zlib\v1.3.1\128ef97315cb44f6b5185f5a351cdc16\include' [-Wunknown-argument]
C:\Users\NBJL#1\AppData\Local\Temp\.xmake\240705\_DA0C2BE4F695434A847B3B5877F6A479.c(2,10): fatal error: 'zlib.h' file not found
#include <zlib.h>
         ^~~~~~~~
1 error generated.
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [@programdir\modules\core\tools\clang_cl.lua:199]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [@programdir\modules\core\tools\clang_cl.lua:152]:
    [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]:
    [....xmake\repositories\xmake-repo\packages\z\zlib\xmake.lua:89]: 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:489]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:238]:
    [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:220]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:406]:

  => install zlib v1.3.1 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:322: ...\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:489]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:238]:

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>
error: @programdir\core\main.lua:329: @programdir\core\sandbox\modules\os.lua:378: execv(C:\Program Files\xmake\xmake.exe require -v -D -j 34 --extra={system=false} zlib) failed(-1)
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [@programdir\core\sandbox\modules\os.lua:378]:
    [@programdir\modules\private\xrepo\action\install.lua:300]: in function '_install_packages'
    [@programdir\modules\private\xrepo\action\install.lua:307]:
    [@programdir\modules\private\xrepo\main.lua:196]:
    [@programdir\plugins\lua\main.lua:124]:
    [C]: in function 'xpcall'
    [@programdir\core\base\utils.lua:275]:
    [@programdir\core\base\task.lua:491]: in function 'run'
    [@programdir\core\main.lua:327]: in function 'cotask'
    [@programdir\core\base\scheduler.lua:406]:

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>
waruqi commented 3 weeks ago

clang-cl 版本太低,不支持 -external:I ,这边 2022 可以。

Issues-translate-bot commented 3 weeks ago

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


The clang-cl version is too low and does not support -external:I. It is available in 2022.

KVM-Explorer commented 3 weeks ago

工具链升级到2022问题解决了,感谢 @waruqi

Issues-translate-bot commented 3 weeks ago

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


The problem of upgrading the tool chain to 2022 has been solved, thank you @waruqi