Closed albertlarsan68 closed 1 year ago
It looks like it is a unicode problem. I'm not an expert in this, but could it be that the file is corrupted?
Maybe you can try remove /target
or even the entire repository and re-download it.
I got the problem while trying to update cargo-binstall
, tracked down the source of the error to lzma-sys
, then cloned this repo with submodules. the error I pasted comes from trying to build the root (xz2
). It doesn't matter whether or not the crate is build with the static
flag, I always get the error.
I got the problem while trying to update
cargo-binstall
, tracked down the source of the error tolzma-sys
, then cloned this repo with submodules. the error I pasted comes from trying to build the root (xz2
). It doesn't matter whether or not the crate is build with thestatic
flag, I always get the error.
Hmmm, then I have no clue how to fix it.
P.S. You can download a prebuilt version of cargo-binstall
using cargo binstall cargo-binstall
. Also latest cargo-updates
supports upgrading using cargo-binstall
.
The main error was that the synchapi.h
file was entirely zeroed out. The subsequent errors were because names had not been defined.
Fully uninstalling VS and reinstalling it solved it.
Hello,
I am not able to compile
lzma-sys
on my Windows machine. The build script fails with the following error:error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "xz-5.2/src/liblzma/api" "-I" "xz-5.2/src/liblzma/lzma" "-I" "xz-5.2/src/liblzma/lz" "-I" "xz-5.2/src/liblzma/check" "-I" "xz-5.2/src/liblzma/simple" "-I" "xz-5.2/src/liblzma/delta" "-I" "xz-5.2/src/liblzma/common" "-I" "xz-5.2/src/liblzma/rangecoder" "-I" "xz-5.2/src/common" "-I" "C:\\Users\\Elève\\Desktop\\rust\\xz2-rs\\lzma-sys" "-W4" "-DHAVE_CONFIG_H=1" "-FoC:\\Users\\Elève\\Desktop\\rust\\xz2-rs\\target\\debug\\build\\lzma-sys-84c50c16c770253c\\out\\xz-5.2/src/liblzma/common\\alone_decoder.o" "-c" "xz-5.2/src/liblzma/common\\alone_decoder.c" with args "cl.exe" did not execute successfully (status code exit code: 2).
Full log:
``` error: failed to run custom build command for `lzma-sys v0.1.19 (C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys)` Caused by: process didn't exit successfully: `C:\Users\Elève\Desktop\rust\xz2-rs\target\debug\build\lzma-sys-bedfe75a8fb1aecd\build-script-build` (exit code: 1) --- stdout cargo:rerun-if-changed=build.rs cargo:rerun-if-env-changed=LZMA_API_STATIC cargo:root=C:\Users\Elève\Desktop\rust\xz2-rs\target\debug\build\lzma-sys-84c50c16c770253c\out cargo:include=C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2/src/liblzma/api TARGET = Some("x86_64-pc-windows-msvc") OPT_LEVEL = Some("0") HOST = Some("x86_64-pc-windows-msvc") CC_x86_64-pc-windows-msvc = None CC_x86_64_pc_windows_msvc = None HOST_CC = None CC = None CFLAGS_x86_64-pc-windows-msvc = None CFLAGS_x86_64_pc_windows_msvc = None HOST_CFLAGS = None CFLAGS = None CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some("aes,fxsr,pclmulqdq,popcnt,rdrand,rdseed,sha,sse,sse2,sse3,sse4.1,sse4.2,ssse3") DEBUG = Some("true") running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "xz-5.2/src/liblzma/api" "-I" "xz-5.2/src/liblzma/lzma" "-I" "xz-5.2/src/liblzma/lz" "-I" "xz-5.2/src/liblzma/check" "-I" "xz-5.2/src/liblzma/simple" "-I" "xz-5.2/src/liblzma/delta" "-I" "xz-5.2/src/liblzma/common" "-I" "xz-5.2/src/liblzma/rangecoder" "-I" "xz-5.2/src/common" "-I" "C:\\Users\\Elève\\Desktop\\rust\\xz2-rs\\lzma-sys" "-W4" "-DHAVE_CONFIG_H=1" "-FoC:\\Users\\Elève\\Desktop\\rust\\xz2-rs\\target\\debug\\build\\lzma-sys-84c50c16c770253c\\out\\xz-5.2/src/liblzma/common\\alone_decoder.o" "-c" "xz-5.2/src/liblzma/common\\alone_decoder.c" alone_decoder.c C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\synchapi.h(1): warning C4821: Unable to determine Unicode encoding type, please save the file with signature (BOM) C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(349): error C2061: syntax error: identifier 'mythread_cond' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(349): error C2059: syntax error: ';' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(402): warning C4013: 'WaitForSingleObject' undefined; assuming extern returning int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(415): warning C4013: 'InitializeCriticalSection' undefined; assuming extern returning int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(422): warning C4013: 'DeleteCriticalSection' undefined; assuming extern returning int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(428): warning C4013: 'EnterCriticalSection' undefined; assuming extern returning int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(434): warning C4013: 'LeaveCriticalSection' undefined; assuming extern returning int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(439): error C2143: syntax error: missing ')' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(439): error C2143: syntax error: missing '{' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(439): error C2059: syntax error: ')' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(440): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(440): error C2054: expected '(' to follow 'cond' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(451): error C2143: syntax error: missing ')' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(451): error C2143: syntax error: missing '{' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(451): error C2059: syntax error: ')' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(452): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(452): error C2054: expected '(' to follow 'cond' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(461): error C2143: syntax error: missing ')' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(461): error C2143: syntax error: missing '{' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(461): error C2059: syntax error: ')' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(462): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(462): error C2054: expected '(' to follow 'cond' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(471): error C2143: syntax error: missing ')' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(471): error C2143: syntax error: missing '{' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(471): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(471): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(471): error C2371: 'mythread_mutex': redefinition; different basic types C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(344): note: see declaration of 'mythread_mutex' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(471): error C2143: syntax error: missing ';' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(471): warning C4218: nonstandard extension used: must specify at least a storage class or a type C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(471): error C2059: syntax error: ')' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(472): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(472): error C2054: expected '(' to follow 'mutex' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(485): error C2143: syntax error: missing ')' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(485): error C2143: syntax error: missing '{' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(485): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(485): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(485): error C2371: 'mythread_mutex': redefinition; different basic types C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(344): note: see declaration of 'mythread_mutex' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(485): error C2143: syntax error: missing ';' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(485): warning C4218: nonstandard extension used: must specify at least a storage class or a type C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(485): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(486): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(486): error C2371: 'mythread_condtime': redefinition; different basic types C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(362): note: see declaration of 'mythread_condtime' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(486): warning C4228: nonstandard extension used: qualifiers after comma in declarator list are ignored C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(486): error C2143: syntax error: missing ';' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(486): warning C4218: nonstandard extension used: must specify at least a storage class or a type C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(486): error C2059: syntax error: ')' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(487): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(487): error C2054: expected '(' to follow 'condtime' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(511): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(511): error C2143: syntax error: missing ')' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(511): error C2143: syntax error: missing '{' before '*' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(511): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(512): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(512): warning C4142: 'uint32_t': benign redefinition of type C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include\stdint.h(24): note: see declaration of 'uint32_t' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(512): error C2370: 'uint32_t': redefinition; different storage class C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include\stdint.h(24): note: see declaration of 'uint32_t' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(512): error C2146: syntax error: missing ';' before identifier 'timeout' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(512): warning C4218: nonstandard extension used: must specify at least a storage class or a type C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(512): error C2059: syntax error: ')' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(513): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\common\mythread.h(513): error C2054: expected '(' to follow 'timeout' C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\liblzma\lz\lz_decoder.h(132): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\liblzma\lz\lz_decoder.h(159): warning C4267: 'initializing': conversion from 'size_t' to 'const uint32_t', possible loss of data C:\Users\Elève\Desktop\rust\xz2-rs\lzma-sys\xz-5.2\src\liblzma\lz\lz_decoder.h(160): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data exit code: 2 --- stderr error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "xz-5.2/src/liblzma/api" "-I" "xz-5.2/src/liblzma/lzma" "-I" "xz-5.2/src/liblzma/lz" "-I" "xz-5.2/src/liblzma/check" "-I" "xz-5.2/src/liblzma/simple" "-I" "xz-5.2/src/liblzma/delta" "-I" "xz-5.2/src/liblzma/common" "-I" "xz-5.2/src/liblzma/rangecoder" "-I" "xz-5.2/src/common" "-I" "C:\\Users\\Elève\\Desktop\\rust\\xz2-rs\\lzma-sys" "-W4" "-DHAVE_CONFIG_H=1" "-FoC:\\Users\\Elève\\Desktop\\rust\\xz2-rs\\target\\debug\\build\\lzma-sys-84c50c16c770253c\\out\\xz-5.2/src/liblzma/common\\alone_decoder.o" "-c" "xz-5.2/src/liblzma/common\\alone_decoder.c" with args "cl.exe" did not execute successfully (status code exit code: 2). ```
Can anyone help me compile ?