chen3feng / blade-build

Blade is a powerful build system from Tencent, supports many mainstream programming languages, such as C/C++, java, scala, python, protobuf...
Other
2.05k stars 500 forks source link

compilation error message is not print to stdout with distcc on #956

Closed kuafu-run closed 2 years ago

kuafu-run commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Run '...'
  3. See error

Expected behavior I have some problematic C++ code during building,once faild only to see FAILED: xxxxxxxxxxx.o if anything,i would like to see the error message.

Error message If applicable, add an error message to help explain your problem.

System (please complete the following information):

Additional context Add any other context about the problem here.

chen3feng commented 3 years ago

Can you provide a minimal reproducible set of code?

kuafu-run commented 3 years ago

my machine is centos 7.6 , gcc 4.8.5, CXX=distcc g++ , export DISTCC_HOSTS='xx.xx.xx.xx' and build sth with blade build XXX/ and get

FAILED: build64_release/xxxxxxx/xxxxxx.cpp.o export LC_ALL=C; set -o pipefail; distcc g++ { not important things } -H 2>&1 | awk '/Multiple include guards may be useful for:/ {stop=1} /^.+ [^\/]/ { print $0} !/^.+ / && !stop {print $0 > "/dev/stderr"}' > build64_release/xxx.cpp.o.H

so i redirected the output to a distcc_g++.txt and found this:

. /usr/include/c++/4.8.2/string .. /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h ... /usr/include/bits/wordsize.h {not important things }

Multiple include guards may be useful for: /usr/include/asm/errno.h /usr/include/asm/param.h /usr/include/asm/socket.h /usr/include/asm/sockios.h /usr/include/bits/byteswap-16.h /usr/include/bits/confname.h {not important things } ads/serving/short_url/short_url_service.cpp:48:1: error: 'abcde' does not name a type abcde; ^ Multiple include guards may be useful for: /usr/include/asm/errno.h /usr/include/asm/param.h /usr/include/asm/socket.h /usr/include/asm/sockios.h /usr/include/bits/byteswap-16.h {not important things }

while if i remove the distcc and re-run the command and redirect the output , only one line of "Multiple include guards may be useful for:" is shown , and the gcc error is printed. so i guess the awk script has some responsibility for this.

chen3feng commented 2 years ago

Thanks, to be confirmed.

chen3feng commented 2 years ago

There are 2 Multiple include guards may be useful for: lines in the stderr when distcc is used, which should be 1 line normally.

Maybe because distcc can't handle the stderr of compilation correctly when the -H option is used.

try upgrade distcc to the latest version?