Closed DillonHeinenIntel closed 3 weeks ago
I don't see this on my system. What does cl /?
produce? I've got
Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34123 for x64
I don't see this on my system. What does
cl /?
produce?
This is my cl output:
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
That's VS 2015. What happens if you use -DTOOLCHAIN=VS2015
? I would imagine the same thing, so we may need to disable that warning on VS2015, or maybe fix the code.
For another issue, in CI/CD we only test with VS2019. It should at least be 2022. I'll file a separate issue for that.
I went ahead and updated to using VS 2022. Now the build gets to 97%, but I'm seeing what looks like a separate issue. Is it possible this is a path/filename length problem? (please see https://stackoverflow.com/questions/34074925/vs-2015-cannot-open-compiler-generated-file-invalid-argument):
[ 97%] Building C object unit_test/fuzzing/test_requester/test_spdm_requester_get_measurement_extension_log/CMakeFiles/test_spdm_requester_get_measurement_extension_log.dir///spdm_unit_fuzzing_common/common.c.obj common.c _C:\Users\dheinen\OneDrive\Documents\libspdm\unit_test\fuzzing\spdm_unit_fuzzingcommon\common.c : fatal error C1083: Cannot open compiler generated file: '': Invalid argument NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\test_spdm_requester_get_measurement_extensionlog.dir___\spdm_unit_fuzzing_common\common.c.obj.d --working-dir="C:\Users\dheinen\OneDrive - Intel Corporation\Documents\libspdm\build\unit_test\fuzzing\test_requester\test_spdm_requester_get_measurement_extension_log" --filter-prefix="Note: including file: " -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe @C:\Users\dheinen\AppData\Local\Temp\nm9689.tmp' : return code '0x1' Stop.
I went ahead and updated to using VS 2022. Now the build gets to 97%, but I'm seeing what looks like a separate issue. Is it possible this is a path/filename length problem? (please see https://stackoverflow.com/questions/34074925/vs-2015-cannot-open-compiler-generated-file-invalid-argument):
[ 97%] Building C object unit_test/fuzzing/test_requester/test_spdm_requester_get_measurement_extension_log/CMakeFiles/test_spdm_requester_get_measurement_extension_log.dir///spdm_unit_fuzzing_common/common.c.obj common.c _C:\Users\dheinen\OneDrive\Documents\libspdm\unit_test\fuzzing\spdm_unit_fuzzingcommon\common.c : fatal error C1083: Cannot open compiler generated file: '': Invalid argument NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\test_spdm_requester_get_measurement_extension_log.dir____\spdm_unit_fuzzing_common\common.c.obj.d --working-dir="C:\Users\dheinen\OneDrive - Intel Corporation\Documents\libspdm\build\unit_test\fuzzing\test_requester\test_spdm_requester_get_measurement_extension_log" --filter-prefix="Note: including file: " -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe @C:\Users\dheinen\AppData\Local\Temp\nm9689.tmp' : return code '0x1' Stop.
Reducing the number of levels in my directory hierarchy fixed this. I'll close this issue. Thanks for your help with the earlier issue, Steven; I really appreciate your responsiveness.
I'm building with the following commands in a batch script:
_git clone https://github.com/DMTF/libspdm.git libspdm cd libspdm git submodule update --init git submodule update mkdir build cd build cmake -G"NMake Makefiles" -DARCH=x64 -DTOOLCHAIN=VS2022 -DTARGET=Debug -DCRYPTO=openssl .. nmake copy_samplekey nmake
... [ 53%] Building C object library/spdm_requester_lib/CMakeFiles/spdm_requester_lib.dir/libspdm_req_encap_request.c.obj libspdm_req_encap_request.c E:\dheinen\libspdm\library\spdm_requester_lib\libspdm_req_encap_request.c(23): error C2220: warning treated as error - no 'object' file generated E:\dheinen\libspdm\library\spdm_requester_lib\libspdm_req_encap_request.c(23): warning C4054: 'type cast': from function pointer 'const libspdm_get_encap_response_func' to data pointer 'void ' E:\dheinen\libspdm\library\spdm_requester_lib\libspdm_req_encap_request.c(96): warning C4055: 'type cast': from data pointer 'void ' to function pointer 'libspdm_get_encap_response_func' NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake\bin\cmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2' Stop.
I've tried passing --compile-no-warning-as-error to the cmake command, but this doesn't fix the issue. Is there a best known method for turning off this warning -> error behavior? My apologies if I missed something in the documentation.