Error message should be reported after detecting protoc execution failure
Hi guys, Recently, some issues in vcpkg reported that opencv4 or Darknet failed to build when using protoc(#10695 #11802 etc.). After an in-depth investigation, the reason for the build failure is that the library that protoc depends on has not been found or installed in the path where it is located. And I found that the execution command of protoc is written here: https://github.com/protocolbuffers/protobuf/blob/1dae8fdd6271d091bbf43c0fd5855603ba533c1d/cmake/protobuf-config.cmake.in#L126
Is there any way to write detailed logs to the log when protoc fails to execute?
Thanks.
What version of protobuf and what language are you using? Version: 3.12.0 Language: C++/CMake
What operating system (Linux, Windows, ...) and version? Windows What runtime / compiler are you using (e.g., python version or gcc version) N/A What did you do? Steps to reproduce the behavior(on Windows):
git clone https://github.com/microsoft/vcpkg.git./bootstrap-vcpkg.bat./vcpkg install protobufdel PATH_TO_VCPKG/installed/x86-windows/tools/protobuf/libprotobuf.dll./vcpkg install opencv4- See error in PATH_TO_VCPKG/buildtrees/opencv4/install-x86-windows-dbg-out.log
What did you expect to see Report error info in log,
What did you see instead?
[233/470] cmd.exe /C "cd /D F:\vcpkg\buildtrees\opencv4\x86-windows-dbg\modules\dnn && F:\vcpkg\installed\x86-windows\tools\protobuf\protoc.exe --cpp_out F:/vcpkg/buildtrees/opencv4/x86-windows-dbg/modules/dnn -I F:/vcpkg/buildtrees/opencv4/src/4.1.1-fb9e10326a/modules/dnn/src/caffe -I F:/vcpkg/buildtrees/opencv4/src/4.1.1-fb9e10326a/modules/dnn/src/onnx -I F:/vcpkg/buildtrees/opencv4/src/4.1.1-fb9e10326a/modules/dnn/src/tensorflow F:/vcpkg/buildtrees/opencv4/src/4.1.1-fb9e10326a/modules/dnn/src/tensorflow/attr_value.proto" FAILED: modules/dnn/attr_value.pb.h modules/dnn/attr_value.pb.cc Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment vcpkg-latest
If I follow, this is a bug in vcpkg, not protoc. protoc can't log anything if it isn't even launched. If I'm misreading this, please reopen.
@elharo Yeah that's caused by a vcpkg bug, but I wish to print some error message when add_custom_command run failed.
This change is not OK per the JSON spec. JSON allows "true" and "false" for boolean values. It does not allow TRUE, False, ERROR, etc.
sorry, commented on wrong issue.
Turning up the verbosity in CMake may help, but this doesn't seem like a problem protobuf can fix (it looks like a CMake/vcpkg issue to me)