IMPALA-6363: avoid cscope build races Use the -ignore_readdir_race flag for find so that find doesn't fail if a directory disappears under it. From what I could tell the flag has been in GNU find for a long time and is also available in other OS flavours like BSD and OS X.
Make the step depend on gen-deps so that it can index thrift, protobuf, etc, output. Change-Id: I22bdb7c64036cb88a8a10907af35c5e3a55a9195 Reviewed-on: http://gerrit.cloudera.org:8080/9007 Reviewed-by: Tim Armstrong <[email protected]> Tested-by: Impala Public Jenkins Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/6bff0bd7 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/6bff0bd7 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/6bff0bd7 Branch: refs/heads/master Commit: 6bff0bd766ece21c6f7605f0307fcc710641ab7f Parents: 10fb24a Author: Tim Armstrong <[email protected]> Authored: Thu Jan 11 11:28:52 2018 -0800 Committer: Impala Public Jenkins <[email protected]> Committed: Sat Jan 13 03:24:06 2018 +0000 ---------------------------------------------------------------------- CMakeLists.txt | 2 +- bin/gen-cscope.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/6bff0bd7/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 74cf37e..37a6324 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -368,7 +368,7 @@ add_custom_target(shell_tarball DEPENDS gen-deps COMMAND "${CMAKE_SOURCE_DIR}/shell/make_shell_tarball.sh" ) -add_custom_target(cscope ALL +add_custom_target(cscope ALL DEPENDS gen-deps COMMAND "${CMAKE_SOURCE_DIR}/bin/gen-cscope.sh" ) http://git-wip-us.apache.org/repos/asf/impala/blob/6bff0bd7/bin/gen-cscope.sh ---------------------------------------------------------------------- diff --git a/bin/gen-cscope.sh b/bin/gen-cscope.sh index 0007782..d3b4423 100755 --- a/bin/gen-cscope.sh +++ b/bin/gen-cscope.sh @@ -22,7 +22,10 @@ bin=`dirname "$0"` bin=`cd "$bin"; pwd` . "$bin"/impala-config.sh -# Generate list of files for Cscope to index +# Generate list of files for Cscope to index. +# -ignore_readdir_race: this scripts runs in parallel with other build steps, so races +# with unrelated directories being deleted are possible (IMPALA-6363). cd $IMPALA_HOME -find . -regex '.*\.\(cc\|c\|hh\|h\|java\|thrift\|flex\|y\)$' > cscope.files +find . -ignore_readdir_race -regex '.*\.\(cc\|c\|hh\|h\|java\|thrift\|flex\|y\)$' \ + > cscope.files
