microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.38k stars 6.19k forks source link

[openssl] Build error on x64-windows #37134

Closed zjljaycn closed 3 months ago

zjljaycn commented 4 months ago

Package: openssl:x64-windows@3.2.1

Host Environment

To Reproduce

vcpkg install openssl:x64-windows Failure logs

-- Using cached openssl-openssl-openssl-3.2.1.tar.gz.
-- Cleaning sources at I:/cppCode/vcpkg/buildtrees/openssl/src/nssl-3.2.1-8707343470.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source I:/cppCode/vcpkg/downloads/openssl-openssl-openssl-3.2.1.tar.gz
-- Applying patch script-prefix.patch
-- Applying patch windows/install-layout.patch
-- Applying patch windows/install-pdbs.patch
-- Applying patch unix/android-cc.patch
-- Applying patch unix/move-openssldir.patch
-- Applying patch unix/no-empty-dirs.patch
-- Applying patch unix/no-static-libs-for-shared.patch
-- Using source at I:/cppCode/vcpkg/buildtrees/openssl/src/nssl-3.2.1-8707343470.clean
-- Getting CMake variables for x64-windows
-- Getting CMake variables for x64-windows
-- Prerunning x64-windows-dbg
-- Building x64-windows-dbg
-- Restarting build without parallelism
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: "K:/Visual Studio/2022/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/nmake.exe" /NOLOGO /G /U /F makefile install_dev install_modules INSTALL_PDBS=ON
    Working Directory: I:/cppCode/vcpkg/buildtrees/openssl/x64-windows-dbg
    See logs for more information:
      I:\cppCode\vcpkg\buildtrees\openssl\install-x64-windows-dbg-nmake-out.log
      I:\cppCode\vcpkg\buildtrees\openssl\install-x64-windows-dbg-nmake-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_nmake.cmake:156 (vcpkg_execute_build_process)
  ports/openssl/windows/portfile.cmake:69 (vcpkg_build_nmake)
  ports/openssl/portfile.cmake:74 (include)
  scripts/ports.cmake:172 (include)
I:\cppCode\vcpkg\buildtrees\openssl\install-x64-windows-dbg-nmake-err.log ``` cl: 命令行 warning D9025 :正在重写“/Zi”(用“/Z7”) NMAKE : fatal error U1077: ¡°"K:\Visual Studio\2022\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64\cl.exe" /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MDd -nologo -DWIN32 -D_WINDOWS -W3 -utf-8 -MP -D_DEBUG -MDd -Z7 -Ob0 -Od -RTC1 -I"crypto" -I"." -I"include" -I"providers\common\include" -I"providers\implementations\include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSLDIR=\"I:\\cppCode\\vcpkg\\packages\\openssl_x64-windows\\debug\"" -D"ENGINESDIR=\"I:\\cppCode\\vcpkg\\packages\\openssl_x64-windows\\debug\\lib\\engines-3\"" -D"MODULESDIR=\"I:\\cppCode\\vcpkg\\packages\\openssl_x64-windows\\debug\\bin\"" -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_USE_APPLINK -DPADLOCK_ASM -DPOLY1305_ASM -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -c /Focrypto\libcrypto-shlib-cversion.obj "crypto\cversion.c"¡±: ·µ»شú«¡°0x2¡± Stop. NMAKE : fatal error U1077: ¡°"K:\Visual Studio\2022\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64\nmake.exe" /LU _build_libs¡±: ·µ»شú«¡°0x2¡± Stop. ```
I:\cppCode\vcpkg\buildtrees\openssl\install-x64-windows-dbg-nmake-out.log ``` "K:\Visual Studio\2022\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64\nmake.exe" /LU depend "K:\Visual Studio\2022\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64\nmake.exe" /LU _build_libs "K:\Visual Studio\2022\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64\cl.exe" /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MDd -nologo -DWIN32 -D_WINDOWS -W3 -utf-8 -MP -D_DEBUG -MDd -Z7 -Ob0 -Od -RTC1 -I"crypto" -I"." -I"include" -I"providers\common\include" -I"providers\implementations\include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSLDIR=\"I:\\cppCode\\vcpkg\\packages\\openssl_x64-windows\\debug\"" -D"ENGINESDIR=\"I:\\cppCode\\vcpkg\\packages\\openssl_x64-windows\\debug\\lib\\engines-3\"" -D"MODULESDIR=\"I:\\cppCode\\vcpkg\\packages\\openssl_x64-windows\\debug\\bin\"" -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_USE_APPLINK -DPADLOCK_ASM -DPOLY1305_ASM -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -c /Focrypto\libcrypto-shlib-cversion.obj "crypto\cversion.c" cversion.c crypto\cversion.c(60): warning C4129: “V”: 不可识别的字符转义序列 crypto\cversion.c(60): warning C4129: “T”: 不可识别的字符转义序列 crypto\cversion.c(60): warning C4129: “M”: 不可识别的字符转义序列 crypto\cversion.c(60): warning C4129: “H”: 不可识别的字符转义序列 crypto\cversion.c(60): warning C4129: “c”: 不可识别的字符转义序列 crypto\cversion.c(60): error C2143: 语法错误: 缺少“;”(在“常数”的前面) crypto\cversion.c(60): error C2143: 语法错误: 缺少“;”(在“字符串”的前面) ```
FrankXie05 commented 4 months ago

@zjljaycn Thanks for posting this issue, please download the English language pack of vs and use the English path.

edobez commented 4 months ago

Same errors as @zjljaycn. Here are my logs in English.

Console output ``` vcpkg.exe install openssl warning: In the September 2023 release, the default triplet for vcpkg libraries changed from x86-windows to the detected host triplet (x64-windows). For the old behavior, add --triplet x86-windows . To suppress this message, add --triplet x64-windows . Computing installation plan... The following packages will be built and installed: openssl:x64-windows@3.2.1 Detecting compiler hash for triplet x64-windows... Restored 0 package(s) from C:\Users\xxx\AppData\Local\vcpkg\archives in 163 us. Use --debug to see more details. Installing 1/1 openssl:x64-windows@3.2.1... Building openssl:x64-windows@3.2.1... -- Using cached openssl-openssl-openssl-3.2.1.tar.gz. -- Extracting source W:/git/vcpkg/downloads/openssl-openssl-openssl-3.2.1.tar.gz -- Applying patch script-prefix.patch -- Applying patch windows/install-layout.patch -- Applying patch windows/install-pdbs.patch -- Applying patch unix/android-cc.patch -- Applying patch unix/move-openssldir.patch -- Applying patch unix/no-empty-dirs.patch -- Applying patch unix/no-static-libs-for-shared.patch -- Using source at W:/git/vcpkg/buildtrees/openssl/src/nssl-3.2.1-8707343470.clean -- Found external ninja('1.10.2'). -- Getting CMake variables for x64-windows -- Getting CMake variables for x64-windows -- Prerunning x64-windows-dbg -- Building x64-windows-dbg -- Restarting build without parallelism CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message): Command failed: "C:/Build/_All/Visual Studio/2019/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/nmake.exe" /NOLOGO /G /U /F makefile install_dev install_modules INSTALL_PDBS=ON Working Directory: W:/git/vcpkg/buildtrees/openssl/x64-windows-dbg See logs for more information: W:\git\vcpkg\buildtrees\openssl\install-x64-windows-dbg-nmake-out.log W:\git\vcpkg\buildtrees\openssl\install-x64-windows-dbg-nmake-err.log Call Stack (most recent call first): scripts/cmake/vcpkg_build_nmake.cmake:156 (vcpkg_execute_build_process) ports/openssl/windows/portfile.cmake:69 (vcpkg_build_nmake) ports/openssl/portfile.cmake:74 (include) scripts/ports.cmake:172 (include) error: building openssl:x64-windows failed with: BUILD_FAILED Elapsed time to handle openssl:x64-windows: 1.4 min Please ensure you're using the latest port files with `git pull` and `vcpkg update`. Then check for known issues at: https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+openssl You can submit a new issue at: https://github.com/microsoft/vcpkg/issues/new?title=[openssl]+Build+error+on+x64-windows&body=Copy+issue+body+from+W%3A%2Fgit%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md ```
install-x64-windows-dbg-nmake-out.log ``` "C:\Build\_All\Visual Studio\2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\nmake.exe" /LU depend "C:\Build\_All\Visual Studio\2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\nmake.exe" /LU _build_libs "C:\Build\_All\Visual Studio\2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe" /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MDd -nologo -DWIN32 -D_WINDOWS -W3 -utf-8 -MP -D_DEBUG -MDd -Z7 -Ob0 -Od -RTC1 -I"crypto" -I"." -I"include" -I"providers\common\include" -I"providers\implementations\include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSLDIR=\"W:\\git\\vcpkg\\packages\\openssl_x64-windows\\debug\"" -D"ENGINESDIR=\"W:\\git\\vcpkg\\packages\\openssl_x64-windows\\debug\\lib\\engines-3\"" -D"MODULESDIR=\"W:\\git\\vcpkg\\packages\\openssl_x64-windows\\debug\\bin\"" -D"OPENSSL_BUILDING_OPENSSL" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -DAES_ASM -DBSAES_ASM -DCMLL_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DKECCAK1600_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_USE_APPLINK -DPADLOCK_ASM -DPOLY1305_ASM -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DX25519_ASM -c /Focrypto\libcrypto-shlib-cversion.obj "crypto\cversion.c" cversion.c crypto\cversion.c(60): warning C4129: 'V': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'T': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'M': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'H': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'c': unrecognized character escape sequence crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'constant' crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'string' ```
install-x64-windows-dbg-nmake-err.log ``` cl : Command line warning D9025 : overriding '/Zi' with '/Z7' NMAKE : fatal error U1077: '"C:\Build\_All\Visual Studio\2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Build\_All\Visual Studio\2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\nmake.exe"' : return code '0x2' Stop. ```
ghesketh commented 4 months ago

I have the same problem with a new, clean install of Visual Studio 2022 and vcpkg :(

crypto\cversion.c(60): warning C4129: 'V': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'T': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'M': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'H': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'c': unrecognized character escape sequence crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'constant' crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'string'

zjljaycn commented 4 months ago

I have the same problem with a new, clean install of Visual Studio 2022 and vcpkg :(

crypto\cversion.c(60): warning C4129: 'V': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'T': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'M': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'H': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'c': unrecognized character escape sequence crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'constant' crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'string'

My problem hasn't been resolved yet, I'm not sure if it's due to spaces in the path

zjljaycn commented 4 months ago

My problem hasn't been resolved yet, I'm not sure if it's due to spaces in the path

My problem hasn't been resolved yet, I'm not sure if it's due to spaces in the path

ghesketh commented 4 months ago

The problem is backslash ("\") characters followed by a letter being interpreted as an escape sequence (by what must be a program written to use POSIX paths). The question is what changed to make this a problem, because I have installed openssl successfully (on other computers) in the past.

------ Original Message ------ From "福仔" @.> To "microsoft/vcpkg" @.> Cc "ghesketh" @.>; "Manual" @.> Date 2024-03-05 20:52:56 Subject Re: [microsoft/vcpkg] [openssl] Build error on x64-windows (Issue #37134)

I have the same problem with a new, clean install of Visual Studio 2022 and vcpkg :(

crypto\cversion.c(60): warning C4129: 'V': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'T': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'M': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'H': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'c': unrecognized character escape sequence crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'constant' crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'string'

My problem hasn't been resolved yet, I'm not sure if it's due to spaces in the path

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/37134#issuecomment-1979984960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK6DE6PTVDEHSUH75HDNITYW2AIRAVCNFSM6AAAAABEGTHC4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZZHE4DIOJWGA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

FrankXie05 commented 4 months ago

https://github.com/openssl/openssl/commit/85b8bea72e2434de5708462f0bf642c5f6bd2f0e

dg0yt commented 4 months ago

openssl/openssl@85b8bea

???

FrankXie05 commented 4 months ago

openssl/openssl@85b8bea

???

Sorry, I seem to have pressed some buttons by mistake. 🤐

Misnigo commented 4 months ago

English path, English VS and the same problem. Perhaps some new changes in vcpkg are not compatible with those in openssl. Or maybe the problem is related to VS too.

dg0yt commented 4 months ago

However, it builds in vcpkg CI. Every day.

Did anyone look at crypto\cversion.c(60) (in the patched sources)? Can anyone check how the macro at the spot is passed through the layers in successful builds?

We have an interaction of cmake, msys, perl, command line interpreter, preprocessor. You have to check the transitions between these layers when it comes to properly dealing with escaped \ filepath separators in quoted strings on windows. I think that perl or command line interpreter might be uncontrolled variables here.

ghesketh commented 4 months ago

However, it builds in vcpkg CI. Every day.

Did anyone look at crypto\cversion.c(60) (in the patched sources)? Can anyone check how the macro at the spot is passed through the layers in successful builds?

We have an interaction of cmake, msys, perl, command line interpreter, preprocessor. You have to check the transitions between these layers when it comes to properly dealing with escaped \ filepath separators in quoted strings on windows. I think that perl or command line interpreter might be uncontrolled variables here.

It seems pretty obvious that vcpkg CI is failing to predict real-world failures.

I just ran vpkg upgrade without paying attention (my failure) and have now lost several packages that are critical for my work due to their dependency on openssl:

libhv:x64-windows-static: REMOVED: 12.1 ms libpq:x64-windows-static: REMOVED: 118 ms python3:x64-windows: REMOVED: 369 ms openssl:x64-windows: REMOVED: 31.3 ms openssl:x64-windows-static: REMOVED: 28.5 ms openssl:x64-windows-static: BUILD_FAILED: 40 s libhv:x64-windows-static: CASCADED_DUE_TO_MISSING_DEPENDENCIES: 193 us libpq:x64-windows-static: CASCADED_DUE_TO_MISSING_DEPENDENCIES: 170 us openssl:x64-windows: BUILD_FAILED: 43 s python3:x64-windows: CASCADED_DUE_TO_MISSING_DEPENDENCIES: 347 us

vcpkg's openssl port is broken, and openssl (in my opinion) is in the top-tier of importance for the entire vcpkg ecosystem.

ghesketh commented 4 months ago

The following hack worked for me.

For x64-windows-static, for example:

move x64-windows-static x64-windows-static.old

vcpkg remove openssl:x64-windows-static

vcpkg install openssl:x64-windows-static

xcopy x64-windows-static\*.* x64-windows-static.old\

rd /s/q x64-windows-static

move x64-windows-static.old x64-windows-static

I cannot guarantee this will work for all cases, but it did for me.

dg0yt commented 4 months ago

It seems pretty obvious that vcpkg CI is failing to predict real-world failures.

CI is running in controlled environment, and real world is a jungle.


openssl:x64-windows-static: BUILD_FAILED: 40 s

So you ran into the crypto\cversion.c(60) error (this issue)? Or some other error?


move x64-windows-static x64-windows-static.old

Which directory is that? Normally it doesn't exist where your run vcpkg install openssl:x64-windows-static.


vcpkg remove openssl:x64-windows-static
vcpkg install openssl:x64-windows-static

Might be helpful to know what else was installed if this makes a difference. Something like


vcpkg list x64-windows-static
ghesketh commented 4 months ago

So you ran into the crypto\cversion.c(60) error (this issue)? Or some other error?

Yes, it is the problem whose apparent trigger is confusion of backslash characters in the path to be introducing escape sequences.

Which directory is that? Normally it doesn't exist where your run vcpkg install openssl:x64-windows-static.

I was just moving the existing folder out of the way. The name of the .old directory is not significant.

Might be helpful to know what else was installed if this makes a difference. Something like

I have 135 entries in my list. Maybe someone with a smaller list would be a better source -- but I can send you mine if you think it necessary.

dg0yt commented 4 months ago

Which directory is that? Normally it doesn't exist where your run vcpkg install openssl:x64-windows-static.

I was just moving the existing folder out of the way. The name of the .old directory is not significant.

The point is: There is no <triplet> dir in the vcpkg root folder.

Might be helpful to know what else was installed if this makes a difference. Something like

I have 135 entries in my list. Maybe someone with a smaller list would be a better source -- but I can send you mine if you think it necessary.

Well, it is one line per feature... I wouldn't complain if it comes as it is. I don't want to raise barriers. (I just can't promise that it is helpful at all. Given that you rotate directories which I don't expect to exist, it is just another perspective on the jungle, not on a controlled environment.)

dg0yt commented 4 months ago

Did anyone look at crypto\cversion.c(60) (in the patched sources)?

Nobody from those affected did, so let me help a little bit:

        return PLATFORM;

https://github.com/openssl/openssl/blob/openssl-3.2.1/crypto/cversion.c#L60

Can anyone check how the macro at the spot is passed through the layers in successful builds?

The PLATFORM macro. It is from the generate file buildtrees/<triplet>-dbg/buildinf.h. Can anybody share this file if he is affected by the cversion.c:60 error?

And it is generated via

GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"

https://github.com/openssl/openssl/blob/openssl-3.2.1/crypto/build.info#L118

It would be nice to trace the command's invocation. If quoting "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" goes wrong, filepaths with \ might slip into PLATFORM.

ghesketh commented 4 months ago

The PLATFORM macro. It is from the generate file buildtrees/<triplet>-dbg/buildinf.h. Can anybody share this file if he is affected by the cversion.c:60 error?

I do not have a buildinf.h file, but I was poking around and found this line in buildtrees\openssl\x64-windows-static-dbg\makefile:

CC="C:\Program Files\VisualStudio\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64\cl.exe"

... which best matches the complaints in my install-x64-windows-static-dbg-nmake-out.log:

crypto\cversion.c(60): warning C4129: 'V': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'T': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'M': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'H': unrecognized character escape sequence crypto\cversion.c(60): warning C4129: 'c': unrecognized character escape sequence crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'constant' crypto\cversion.c(60): error C2143: syntax error: missing ';' before 'string'

dg0yt commented 4 months ago

crypto\cversion.c has #include "buildinf.h", so it must exist as a generated file. And yes, we are getting closer to confirming that

GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"

is incorrectly splitting arguments on the space in the Program Files sequence in some environments.

dg0yt commented 3 months ago

I guess the issue sufficiently explained with using COMSPEC=powershell (user configuration), and passing the full compiler path in CC (vcpkg port). At least this is what I can simulate locally with jom and stripped-down Makefile. (Sorry, still no Visual Studio.) So the next step is wrapping the Windows build into env COMSPEC=cmd.

(I found a invocation log of mkbuildinf.pl in https://github.com/openssl/openssl/issues/11699. There you can see what is called and where the quotes are when CC=cl).

dg0yt commented 3 months ago

Please test #37716.

zjljaycn commented 3 months ago

I reinstalled Visual Studio. The original path had spaces, but now there are no more. The installation was successful

Thank you all, everyone