protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.57k stars 15.48k forks source link

Google_protobuf failed to build with debug configuration #4409

Closed shanshan0309 closed 6 years ago

shanshan0309 commented 6 years ago

Environment: Windows Server 2016 + VS2017 Update 5 + Google_protobuf master branch latest srouce code

I tried to build Google_protobuf with debug configuration on Windows but failed. Could you please help take a look at this? Thanks in advance!

Steps to Reproduce:

  1. git clone https://github.com/google/protobuf.git D:\Google-Protobuf\src
  2. Open a VS 2017 command prompt and browse to D:\Google-Protobuf
  3. mkdir build_x86 && pushd build_x86
  4. cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.16299.0 ..\src\cmake
  5. popd
  6. msbuild /p:Configuration=Debug;Platform=Win32 build_x86\protobuf.sln /t:Rebuild

Actual result: 3 projects failed. The full log file is attached. log_x86_build.log

Build FAILED. "D:\Google-Protobuf\build_x86\protobuf.sln" (Rebuild target) (1) -> "D:\Google-Protobuf\build_x86\ALL_BUILD.vcxproj.metaproj" (Rebuild target) (2) -> "D:\Google-Protobuf\build_x86\lite-arena-test.vcxproj.metaproj" (Rebuild target) (16) -> "D:\Google-Protobuf\build_x86**lite-arena-test.vcxproj**" (Rebuild target) (19) -> (CustomBuild target) -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 3. [D:\Google-Protobuf\build_x86\lite-arena-test.vcxproj]

"D:\Google-Protobuf\build_x86\protobuf.sln" (Rebuild target) (1) -> "D:\Google-Protobuf\build_x86\ALL_BUILD.vcxproj.metaproj" (Rebuild target) (2) -> "D:\Google-Protobuf\build_x86\lite-test.vcxproj.metaproj" (Rebuild target) (20) -> "D:\Google-Protobuf\build_x86**lite-test.vcxpro**j" (Rebuild target) (21) -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 3. [D:\Google-Protobuf\build_x86\lite-test.vcxproj]

"D:\Google-Protobuf\build_x86\protobuf.sln" (Rebuild target) (1) -> "D:\Google-Protobuf\build_x86\ALL_BUILD.vcxproj.metaproj" (Rebuild target) (2) -> "D:\Google-Protobuf\build_x86\tests.vcxproj.metaproj" (Rebuild target) (24) -> "D:\Google-Protobuf\build_x86**tests.vcxproj**" (Rebuild target) (25) -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 3. [D:\Google-Protobuf\build_x86\tests.vcxproj]

shanshan0309 commented 6 years ago

Hi, any update for this?

xfxyjwf commented 6 years ago

It seems protoc check-failed when invoked to compile test protos. Relevant error message in the output log:


CustomBuild:
  Building Custom Rule D:/Google-Protobuf/src/cmake/CMakeLists.txt
  CMake does not need to re-run because D:/Google-Protobuf/build_x86/CMakeFiles/generate.stamp is up-to-date.
  Generating D:/Google-Protobuf/src/src/google/protobuf/any_test.pb.cc
  [libprotobuf FATAL D:\Google-Protobuf\src\src\google\protobuf\generated_message_reflection.cc:2372] CHECK failed: file != NULL: 
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 3. [D:\Google-Protobuf\build_x86\tests.vcxproj]
Done Building Project "D:\Google-Protobuf\build_x86\tests.vcxproj" (Rebuild target(s)) -- FAILED.
xfxyjwf commented 6 years ago

@shanshan0309 What version of protobuf are you using? Could you try 3.5.2?

shanshan0309 commented 6 years ago

Thanks for looking into this issue, @xfxyjwf. The version of protobuf I currently use is 3.5.1. I don't seem to see the version 3.5.2 from https://github.com/google/protobuf/releases. The latest version is 3.5.1 in this link.

xfxyjwf commented 6 years ago

I was able to build 3.5.1 with Visual Studio 2017. Can you double check your version number? Your repo instruction seems suggest you are git clone from head, but depending on when you clone, it could be different versions.

shanshan0309 commented 6 years ago

Thanks, @xfxyjwf. We used the latest revision 416d418 in master branch, but still failed.

xfxyjwf commented 6 years ago

I think I have identified the cause of the issue: https://github.com/google/protobuf/issues/4773

xfxyjwf commented 6 years ago

I'm closing this one. Please follow up the progress in https://github.com/google/protobuf/issues/4773 .