rust-lang / libz-sys

Rust crate package to link to a system libz (zlib)
Apache License 2.0
119 stars 77 forks source link

1.1.20 failed in cmake stage on windows 10 #229

Open shenjackyuanjie opened 1 day ago

shenjackyuanjie commented 1 day ago
``` Compiling sysinfo v0.31.4 error: failed to run custom build command for `libz-ng-sys v1.1.20` Caused by: process didn't exit successfully: `C:\Users\SHENJA~1.SHE\AppData\Local\Temp\cargo-installxHs1ll\release\build\libz-ng-sys-ac4e4ef559aefff4\build-script-cmake` (exit code: 101) --- stdout CMAKE_TOOLCHAIN_FILE_x86_64-pc-windows-msvc = None CMAKE_TOOLCHAIN_FILE_x86_64_pc_windows_msvc = None HOST_CMAKE_TOOLCHAIN_FILE = None CMAKE_TOOLCHAIN_FILE = None CMAKE_GENERATOR_x86_64-pc-windows-msvc = None CMAKE_GENERATOR_x86_64_pc_windows_msvc = None HOST_CMAKE_GENERATOR = None CMAKE_GENERATOR = None CMAKE_PREFIX_PATH_x86_64-pc-windows-msvc = None CMAKE_PREFIX_PATH_x86_64_pc_windows_msvc = None HOST_CMAKE_PREFIX_PATH = None CMAKE_PREFIX_PATH = None CMAKE_x86_64-pc-windows-msvc = None CMAKE_x86_64_pc_windows_msvc = None HOST_CMAKE = None CMAKE = None running: "cmake" "D:\\APPS\\rust\\cargo\\registry\\src\\rsproxy.cn-0dccff568467c15b\\libz-ng-sys-1.1.20\\src/zlib-ng" "-G" "Visual Studio 17 2022" "-Thost=x64" "-Ax64" "-DBUILD_SHARED_LIBS=OFF" "-DZLIB_COMPAT=OFF" "-DZLIB_ENABLE_TESTS=OFF" "-DWITH_GZFILEOP=ON" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\SHENJA~1.SHE\\AppData\\Local\\Temp\\cargo-installxHs1ll\\release\\build\\libz-ng-sys-20cfbbbe2e3f522b\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Release" -- Using CMake version 3.30.4 -- ZLIB_HEADER_VERSION: 1.3.1 -- ZLIBNG_HEADER_VERSION: 2.2.2 -- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19045. -- The C compiler identification is MSVC 19.41.34123.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: D:/APPS/Microsoft/VisualStudio/2022-community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Arch detected: 'x86_64' -- Basearch of 'x86_64' has been detected as: 'x86' -- Looking for arm_acle.h -- Looking for arm_acle.h - not found -- Looking for sys/auxv.h -- Looking for sys/auxv.h - not found -- Looking for sys/sdt.h -- Looking for sys/sdt.h - not found -- Looking for unistd.h -- Looking for unistd.h - not found -- Looking for linux/auxvec.h -- Looking for linux/auxvec.h - not found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of off64_t -- Check size of off64_t - failed -- Check size of _off64_t -- Check size of _off64_t - failed -- Check size of __off64_t -- Check size of __off64_t - failed -- Looking for fseeko -- Looking for fseeko - not found -- Looking for strerror -- Looking for strerror - found -- Looking for posix_memalign -- Looking for posix_memalign - not found -- Looking for aligned_alloc -- Looking for aligned_alloc - not found -- Performing Test HAVE_NO_INTERPOSITION -- Performing Test HAVE_NO_INTERPOSITION - Failed -- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN -- Performing Test HAVE_ATTRIBUTE_VISIBILITY_HIDDEN - Failed -- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL -- Performing Test HAVE_ATTRIBUTE_VISIBILITY_INTERNAL - Failed -- Performing Test HAVE_ATTRIBUTE_ALIGNED -- Performing Test HAVE_ATTRIBUTE_ALIGNED - Failed -- Performing Test HAVE_BUILTIN_ASSUME_ALIGNED -- Performing Test HAVE_BUILTIN_ASSUME_ALIGNED - Success -- Performing Test HAVE_BUILTIN_CTZ -- Performing Test HAVE_BUILTIN_CTZ - Failed -- Performing Test HAVE_BUILTIN_CTZLL -- Performing Test HAVE_BUILTIN_CTZLL - Failed -- Performing Test HAVE_PTRDIFF_T -- Performing Test HAVE_PTRDIFF_T - Success -- Performing Test HAVE_XSAVE_INTRIN -- Performing Test HAVE_XSAVE_INTRIN - Success -- Performing Test HAVE_SSE2_INTRIN -- Performing Test HAVE_SSE2_INTRIN - Success -- Performing Test HAVE_SSSE3_INTRIN -- Performing Test HAVE_SSSE3_INTRIN - Success -- Performing Test HAVE_SSE42_INTRIN -- Performing Test HAVE_SSE42_INTRIN - Success -- Performing Test HAVE_PCLMULQDQ_INTRIN -- Performing Test HAVE_PCLMULQDQ_INTRIN - Success -- Performing Test HAVE_AVX2_INTRIN -- Performing Test HAVE_AVX2_INTRIN - Success -- Performing Test HAVE_AVX512_INTRIN -- Performing Test HAVE_AVX512_INTRIN - Success -- Performing Test HAVE_AVX512VNNI_INTRIN -- Performing Test HAVE_AVX512VNNI_INTRIN - Success -- Performing Test HAVE_VPCLMULQDQ_INTRIN -- Performing Test HAVE_VPCLMULQDQ_INTRIN - Success -- Architecture-specific source files: arch/x86/x86_features.c;arch/x86/chunkset_sse2.c;arch/x86/compare256_sse2.c;arch/x86/slide_hash_sse2.c;arch/x86/adler32_ssse3.c;arch/x86/chunkset_ssse3.c;arch/x86/adler32_sse42.c;arch/x86/crc32_pclmulqdq.c;arch/x86/slide_hash_avx2.c;arch/x86/chunkset_avx2.c;arch/x86/compare256_avx2.c;arch/x86/adler32_avx2.c;arch/x86/adler32_avx512.c;arch/x86/adler32_avx512_vnni.c;arch/x86/crc32_vpclmulqdq.c -- The following features have been enabled: * XSAVE, Support XSAVE intrinsics using "" * SSSE3_ADLER32, Support SSSE3-accelerated adler32, using "" * SSE42_CRC, Support SSE4.2 optimized adler32 hash generation, using "" * PCLMUL_CRC, Support CRC hash generation using PCLMULQDQ, using " " * AVX2_SLIDEHASH, Support AVX2 optimized slide_hash, using "/arch:AVX2" * AVX2_CHUNKSET, Support AVX2 optimized chunkset, using "/arch:AVX2" * AVX2_COMPARE256, Support AVX2 optimized compare256, using "/arch:AVX2" * AVX2_ADLER32, Support AVX2-accelerated adler32, using "/arch:AVX2" * AVX512_ADLER32, Support AVX512-accelerated adler32, using "/arch:AVX512" * AVX512VNNI_ADLER32, Support AVX512VNNI adler32, using "/arch:AVX512" * VPCLMUL_CRC, Support CRC hash generation using VPCLMULQDQ, using " /arch:AVX512" * WITH_GZFILEOP, Compile with support for gzFile related functions * ZLIBNG_ENABLE_TESTS, Test zlib-ng specific API * WITH_SANITIZER, Enable sanitizer support * WITH_GTEST, Build gtest_zlib * WITH_OPTIM, Build with optimisation * WITH_NEW_STRATEGIES, Use new strategies * WITH_RUNTIME_CPU_DETECTION, Build with runtime CPU detection * WITH_AVX2, Build with AVX2 * WITH_AVX512, Build with AVX512 * WITH_AVX512VNNI, Build with AVX512 VNNI * WITH_SSE2, Build with SSE2 * WITH_SSSE3, Build with SSSE3 * WITH_SSE42, Build with SSE42 * WITH_PCLMULQDQ, Build with PCLMULQDQ * WITH_VPCLMULQDQ, Build with VPCLMULQDQ -- The following features have been disabled: * ZLIB_SYMBOL_PREFIX, Publicly exported symbols DO NOT have a custom prefix * ZLIB_COMPAT, Compile with zlib compatible API * ZLIB_ENABLE_TESTS, Build test binaries * WITH_FUZZERS, Build test/fuzz * WITH_BENCHMARKS, Build test/benchmarks * WITH_BENCHMARK_APPS, Build application benchmarks * WITH_NATIVE_INSTRUCTIONS, Instruct the compiler to use the full instruction set on this host (gcc/clang -march=native) * WITH_MAINTAINER_WARNINGS, Build with project maintainer warnings * WITH_CODE_COVERAGE, Enable code coverage reporting * WITH_INFLATE_STRICT, Build with strict inflate distance checking * WITH_INFLATE_ALLOW_INVALID_DIST, Build with zero fill for inflate invalid distances * INSTALL_UTILS, Copy minigzip and minideflate during install -- Configuring done (56.9s) -- Generating done (0.1s) -- Build files have been written to: C:/Users/shenjack.SHENJACK-5600X/AppData/Local/Temp/cargo-installxHs1ll/release/build/libz-ng-sys-20cfbbbe2e3f522b/out/build running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--parallel" "16" 适用于 .NET Framework MSBuild 版本 17.11.9+a69bbaaf5 1>Checking Build System Building Custom Rule D:/APPS/rust/cargo/registry/src/rsproxy.cn-0dccff568467c15b/libz-ng-sys-1.1.20/src/zlib-ng/CMakeLists.txt adler32_c.c D:\APPS\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\libz-ng-sys-1.1.20\src\zlib-ng\zbuild.h(1,1): error C2220: 以下警告被视为错误 [C:\Users\shenjack.SHENJACK-5600X\AppData\Local\Temp\cargo-installxHs1ll\release\build\libz-ng-sys-20cfbbbe2e3f522b\out\build\zlib.vcxproj] (编译源文件“D:/APPS/rust/cargo/registry/src/rsproxy.cn-0dccff568467c15b/libz-ng-sys-1.1.20/src/zlib-ng/arch/generic/adler32_c.c”) ``` about a few hundred lines ``` (编译源文件“gzread.c”) D:\APPS\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\libz-ng-sys-1.1.20\src\zlib-ng\zbuild.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [C:\Users\shenjack.SHENJACK-5600X\AppData\Local\Temp\cargo-installxHs1ll\release\build\libz-ng-sys-20cfbbbe2e3f522b\out\build\zlib.vcxproj] (编译源文件“gzread.c”) gzwrite.c D:\APPS\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\libz-ng-sys-1.1.20\src\zlib-ng\zbuild.h(1,1): error C2220: 以下警告被视为错误 [C:\Users\shenjack.SHENJACK-5600X\AppData\Local\Temp\cargo-installxHs1ll\release\build\libz-ng-sys-20cfbbbe2e3f522b\out\build\zlib.vcxproj] (编译源文件“D:/APPS/rust/cargo/registry/src/rsproxy.cn-0dccff568467c15b/libz-ng-sys-1.1.20/src/zlib-ng/gzwrite.c”) D:\APPS\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\libz-ng-sys-1.1.20\src\zlib-ng\zbuild.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [C:\Users\shenjack.SHENJACK-5600X\AppData\Local\Temp\cargo-installxHs1ll\release\build\libz-ng-sys-20cfbbbe2e3f522b\out\build\zlib.vcxproj] (编译源文件“D:/APPS/rust/cargo/registry/src/rsproxy.cn-0dccff568467c15b/libz-ng-sys-1.1.20/src/zlib-ng/gzwrite.c”) 正在生成代码... --- stderr CMake Warning: Manually-specified variables were not used by the project: CMAKE_ASM_FLAGS CMAKE_ASM_FLAGS_RELEASE CMAKE_BUILD_TYPE CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE thread 'main' panicked at D:\APPS\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\cmake-0.1.51\src/lib.rs:1100:5: command did not execute successfully, got: exit code: 1 build script failed, must exit now note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: failed to compile `gitoxide v0.38.0`, intermediate artifacts can be found at `C:\Users\SHENJA~1.SHE\AppData\Local\Temp\cargo-installxHs1ll`. To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path. ```
shenjackyuanjie commented 1 day ago

to be notice, this is different with #225 , which is a linker error this is an cmake error

Byron commented 1 day ago

Thanks for reporting and for differentiating it from #225.

It's very hard to see what the actual error is, within the cmake invocation. Further, is it correct to assume that the previous version, 1.1.16 worked?

shenjackyuanjie commented 1 day ago

Further, is it correct to assume that the previous version, 1.1.16 worked?

I'm testing it

shenjackyuanjie commented 1 day ago

hmmmm the issue appeared when i'm installing gitoxide-0.39.0 but I don't know how to replace the dependency

Byron commented 1 day ago

Interesting! You could try to downgrade cargo update --precise 1.1.16 -p libz-ng-sys@1.1.20 - it will probably work then as the previous release didn't have that problem.

shenjackyuanjie commented 1 day ago

yes, downgrading to 1.1.16 works

Byron commented 1 day ago

After looking at the changes between https://github.com/rust-lang/libz-sys/compare/1.1.16-zng...1.1.20-zng it once again became clear that the cause of the issue certainly is upstream. I can't see how the changes here should affect cmake that way.

shenjackyuanjie commented 1 day ago

I have notice some thing


    compare256_c.c
  D:\APPS\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\libz-ng-sys-1.1.20\src\zlib-ng\zbuild.h(1,1): error C2220: 以下警告被视为错误 [V:\githubs\tmp-path\gitoxide\target\release\build\libz-ng-sys-20cfbbbe2e3f522b\out\build\zlib.vcxproj]
    (编译源文件“D:/APPS/rust/cargo/registry/src/rsproxy.cn-0dccff568467c15b/libz-ng-sys-1.1.20/src/zlib-ng/arch/generic/compare256_c.c”)

  D:\APPS\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\libz-ng-sys-1.1.20\src\zlib-ng\zbuild.h(1,1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 [V:\githubs\tmp-path\gitoxide\target\release\build\libz-ng-sys-20cfbbbe2e3f522b\out\build\zlib.vcxproj]
    (编译源文件“D:/APPS/rust/cargo/registry/src/rsproxy.cn-0dccff568467c15b/libz-ng-sys-1.1.20/src/zlib-ng/arch/generic/compare256_c.c”)

C2220: 以下警告被视为错误 C2220: The following warnings are considered errors

is this some kind of -Wall ? and the warning is actually just encoding warnings

NobodyXu commented 6 hours ago

is this some kind of -Wall ?

It seems like so, maybe you are using the wrong encoding/locale for the source file?

Not familiar with these encoding stuff but I think it's best to save everything as utf-8

shenjackyuanjie commented 1 hour ago

it is actually a warning that you have saved your file in utf-8, but the local encodings are gbk