You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2016/01/26 02:30:35 UTC

[2/2] incubator-kudu git commit: client: fix missing includes in scan_batch.h

client: fix missing includes in scan_batch.h

scan_batch.h was missing some includes for gutil macros that it used.
This didn't cause problems in our own build, because we typically
had included the right files above including this header. But this
broke an Impala build where the caller wasn't explicitly including
other code ahead of this.

This adds a new bit of code to client_samples-test which verifies
that the installed library's headers are all buildable on their own.
This isn't _exactly_ part of the job description of the 'samples' test,
but we already had the build and install code there and didn't want
to duplicate it, nor did I want to take the time to refactor a bunch
of shell code at this juncture.

Change-Id: I8e10f406c80dff7cbc61ca609d8d2bde737b91b6
Reviewed-on: http://gerrit.cloudera.org:8080/1896
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/7900bd5c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/7900bd5c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/7900bd5c

Branch: refs/heads/master
Commit: 7900bd5ce73a203aff565aae0996a8e53c4926ea
Parents: 76e285e
Author: Todd Lipcon <to...@apache.org>
Authored: Mon Jan 25 14:45:14 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue Jan 26 01:28:58 2016 +0000

----------------------------------------------------------------------
 src/kudu/client/client_samples-test.sh | 22 ++++++++++++++++++----
 src/kudu/client/scan_batch.h           |  7 +++++++
 2 files changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/7900bd5c/src/kudu/client/client_samples-test.sh
----------------------------------------------------------------------
diff --git a/src/kudu/client/client_samples-test.sh b/src/kudu/client/client_samples-test.sh
index 7925261..f573207 100755
--- a/src/kudu/client/client_samples-test.sh
+++ b/src/kudu/client/client_samples-test.sh
@@ -17,10 +17,9 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-# Tests that the Kudu client sample code can be built out-of-tree and runs
-# properly.
-
-set -e
+# Tests that the Kudu client library can be installed outside
+# the build tree, that the installed headers are sane, and that
+# the sample code can be built and runs correctly.
 
 # Clean up after the test. Must be idempotent.
 cleanup() {
@@ -57,6 +56,21 @@ else
 fi
 popd
 
+# Test that all of the installed headers can be compiled on their own.
+# This catches bugs where we've made a mistake in 'include-what-you-use'
+# within the library.
+for include_file in $(find $LIBRARY_DIR -name \*.h) ; do
+  echo Checking standalone compilation of $include_file...
+  if ! ${CXX:-g++} -o /dev/null -I$LIBRARY_DIR/usr/local/include $include_file ; then
+    set +x
+    echo
+    echo -----------------------------------------
+    echo $include_file fails to build on its own.
+    echo See log above for details.
+    echo -----------------------------------------
+    exit 1
+  fi
+done
 # Prefer the cmake on the system path, since we expect our client library
 # to be usable with older versions of cmake. But if it isn't there,
 # use the one from thirdparty.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/7900bd5c/src/kudu/client/scan_batch.h
----------------------------------------------------------------------
diff --git a/src/kudu/client/scan_batch.h b/src/kudu/client/scan_batch.h
index c08130a..3d510d4 100644
--- a/src/kudu/client/scan_batch.h
+++ b/src/kudu/client/scan_batch.h
@@ -19,6 +19,13 @@
 
 #include <string>
 
+#ifdef KUDU_HEADERS_NO_STUBS
+#include "kudu/gutil/macros.h"
+#include "kudu/gutil/port.h"
+#else
+#include "kudu/client/stubs.h"
+#endif
+
 #include "kudu/util/kudu_export.h"
 #include "kudu/util/slice.h"