Closed springmeyer closed 6 years ago
fe692a0 is based on some learning trying to debug hanging clang-tidy jobs in another repo. I think what was happening was:
tee
the output from make
was being pushed to a filemake
took a long time travis would not see any output in stdout
So, using tee
ensures that the normal build output is still streamed to travis logs, but also to a file (so that we can then generate the compile_commands.json when needed).
/cc @GretaCB
Ah, I see. Thanks for the clear explanation of how tee
solves the problem of travis seeing no output during a long make
. And this also addresses the issue we discussed in the larger PR. Good find.
lgtm!
This fixes a longstanding issue in the
scripts/clang-tidy.sh
script. Previously if the build failed it would leave behind an emptybuild/compile_commands.json
. Then - when you went to run thetidy
target again - the script logic would see thatbuild/compile_commands.json
existed and would avoid running the build again, leading clang-tidy to spuriously report nothing.This change improves the script to avoid the possibility that it will write an empty
build/compile_commands.json
Context: The
scripts/generate_compile_commands.py
is needed to reformat the build out into this specific format (https://clang.llvm.org/docs/JSONCompilationDatabase.html). Some build systems can do this automatically (like cmake https://cmake.org/cmake/help/v3.5/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html) but here we use gyp, which cannot. So thescripts/generate_compile_commands.py
is my attempt to bolt this functionality onto gyp./cc @allieoop for final PR. This PR is a subset created via https://github.com/mapbox/node-cpp-skel/pull/118/files#diff-297d66ab0c294f76d1a7ab83006a7383