You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2017/07/03 22:20:29 UTC

[1/2] mesos git commit: Fixed interference of unbundled dependency include paths with Boost.

Repository: mesos
Updated Branches:
  refs/heads/1.2.x 7e5c2b2e3 -> 31f13a52b


Fixed interference of unbundled dependency include paths with Boost.

Since some of the contents of Boost headers we include trigger
diagnostics with our compiler setups (e.g., use of 'auto_ptr'), we
include Boost with '-isystem' instead of '-I'. This treats headers
included from such paths as system headers which suppresses all
diagnostics. Other headers we include with '-I'.

At least GCC performs separate lookups for headers depending on how
their path was specified[1].

> The lookup order is as follows:
>
> 1. For the quote form of the include directive, the directory of the
>    current file is searched first.
> 2. For the quote form of the include directive, the directories
>    specified by '-iquote' options are searched in left-to-right order,
>    as they appear on the command line.
> 3. Directories specified with '-I' options are scanned in
>    left-to-right order.
> 4. Directories specified with '-isystem' options are scanned in
>    left-to-right order.
> 5. Standard system directories are scanned.
> 6. Directories specified with '-idirafter' options are scanned in
>    left-to-right order.

Since we add Boost headers with '-isystem', but other headers with '-I',
building with e.g., unbundled protobuf by specifying
'--with-protobuf=PROTO_PREFIX' causes the build to possibly pick up a
Boost installed in 'PROTO_PREFIX' -- the protobuf include path is
specified with '-I' while the Boost include path is specified with
'-isystem' causes the compiler to first look for Boost headers in the
paths specified with '-I', e.g., the protobuf prefix.

In order to prevent finding wrong Boost headers, all include paths
possibly containing Boost headers need to be added with the same flag as
the Boost headers itself, i.e., with '-isystem'. This commit adjusts
include path specification for all possibly externally provided
locations, i.e., unbundled third-party dependencies.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html

Review: https://reviews.apache.org/r/59625/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/da240ec9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/da240ec9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/da240ec9

Branch: refs/heads/1.2.x
Commit: da240ec99f02fefc737c7d31c4fb874498484c06
Parents: 7e5c2b2
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Thu Jun 8 20:04:06 2017 +0200
Committer: Till Toenshoff <to...@me.com>
Committed: Mon Jul 3 22:57:51 2017 +0200

----------------------------------------------------------------------
 configure.ac | 66 +++++++++++++++++++++++++++++++------------------------
 1 file changed, 37 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/da240ec9/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 98fa425..a1a2092 100644
--- a/configure.ac
+++ b/configure.ac
@@ -709,10 +709,12 @@ fi
 # suffixes. We include /include/apr-1 because we include <apr*>
 # headers directly.
 if test -n "`echo $with_apr`" ; then
-    CPPFLAGS="-I${with_apr}/include/apr-1 -I${with_apr}/include/apr-1.0 $CPPFLAGS"
+    CPPFLAGS="-isystem ${with_apr}/include/apr-1 \
+              -isystem ${with_apr}/include/apr-1.0 $CPPFLAGS"
     LDFLAGS="-L${with_apr}/lib $LDFLAGS"
 else
-    CPPFLAGS="-I/usr/include/apr-1 -I/usr/include/apr-1.0 $CPPFLAGS"
+    CPPFLAGS="-isystem /usr/include/apr-1 -isystem /usr/include/apr-1.0	\
+      $CPPFLAGS"
 fi
 
 AC_CHECK_HEADERS([apr_pools.h],
@@ -731,6 +733,12 @@ libapr-1 is required for mesos to build.
 # We use "-isystem" instead of "-I" to add Boost to the include search
 # path. This disables compiler warnings inside Boost headers since we
 # can't easily fix them. See MESOS-3799.
+#
+# Note that the use of "-isystem" modifies header lookup order; the
+# preprocessor will first look for headers in *all* paths given with
+# "-I" and only then look into "-isystem" paths. This means that all
+# prefixes potentially containing Boost headers should be added with
+# "-isystem" as well.
 if test -n "`echo $with_boost`"; then
   CPPFLAGS="$CPPFLAGS -isystem ${with_boost}/include"
 fi
@@ -768,7 +776,7 @@ AM_CONDITIONAL([WITH_BUNDLED_BOOST], [test "x$with_bundled_boost" = "xyes"])
 # the CPPFLAGS and LDFLAGS with respective /include and /lib path
 # suffixes.
 if test -n "`echo $with_curl`" ; then
-    CPPFLAGS="-I${with_curl}/include $CPPFLAGS"
+    CPPFLAGS="-isystem ${with_curl}/include $CPPFLAGS"
     LDFLAGS="-L${with_curl}/lib $LDFLAGS"
 fi
 
@@ -790,7 +798,7 @@ if test "x$without_bundled_elfio" = "xyes" || \
     if test "$with_elfio" = "${with_elfio#/}"; then
       AC_MSG_ERROR([The path passed to --with-elfio must be absolute.])
     fi
-     CPPFLAGS="-I${with_elfio} $CPPFLAGS"
+     CPPFLAGS="-isystem ${with_elfio} $CPPFLAGS"
   fi
 
   AC_CHECK_HEADERS([elfio/elfio.h], [],
@@ -812,7 +820,7 @@ AM_CONDITIONAL([WITH_BUNDLED_ELFIO], [test "x$with_bundled_elfio" = "xyes"])
 # while extending it by /include and to LDFLAGS while extending it by
 # /lib.
 if test -n "`echo $with_glog`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_glog}/include"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_glog}/include"
   LDFLAGS="$LDFLAGS -L${with_glog}/lib"
 fi
 
@@ -854,12 +862,12 @@ GMOCKSRC="gmock-all.cc"
 GTESTSRC="gtest-all.cc"
 
 if test -n "`echo $with_gmock`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_gmock} -I${with_gmock}/include \
-    -I${with_gmock}/src -I${with_gmock}/gtest -I${with_gmock}/gtest/include \
-    -I${with_gmock}/gtest/src"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_gmock} -isystem ${with_gmock}/include \
+    -isystem ${with_gmock}/src -isystem ${with_gmock}/gtest \
+    -isystem ${with_gmock}/gtest/include -isystem ${with_gmock}/gtest/src"
 
 elif test "x$enable_bundled" != "xyes"; then
-  CPPFLAGS="$CPPFLAGS -I/usr/src/gmock"
+  CPPFLAGS="$CPPFLAGS -isystem /usr/src/gmock"
   # On system installations the deps are handled separately.
   # So insert a placeholder for substitution.
   GTESTSRC="stdio.h"
@@ -908,7 +916,7 @@ AC_SUBST([GTESTSRC])
 
 
 if test -n "`echo $with_http_parser`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_http_parser}/include"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_http_parser}/include"
   LDFLAGS="$LDFLAGS -L${with_http_parser}/lib"
 fi
 
@@ -1070,8 +1078,8 @@ __EOF__
     if test "$OS_NAME" = "darwin"; then
       while true; do # Loop until sucessful (via break) or exhausted options.
         m4_foreach([java_cppflags],
-                   [["-I$JAVA_HOME/include -I$JAVA_HOME/include/$OS_NAME"],
-                    ["-I/System/Library/Frameworks/JavaVM.framework/Headers"]],
+                   [["-isystem $JAVA_HOME/include -isystem $JAVA_HOME/include/$OS_NAME"],
+                    ["-isystem /System/Library/Frameworks/JavaVM.framework/Headers"]],
                    [JAVA_CPPFLAGS=java_cppflags
                     TRY_LINK_JNI([break])])
         # Exhausted options.
@@ -1089,7 +1097,7 @@ __EOF__
     else
       while true; do # Loop until sucessful (via break) or exhausted options.
         m4_foreach([java_cppflags],
-                   [["-I$JAVA_HOME/include -I$JAVA_HOME/include/$OS_NAME"]],
+                   [["-isystem $JAVA_HOME/include -isystem $JAVA_HOME/include/$OS_NAME"]],
                    [JAVA_CPPFLAGS=java_cppflags
                     TRY_LINK_JNI([break])])
         # Exhausted options.
@@ -1153,7 +1161,7 @@ AM_CONDITIONAL([HAS_JAVA], [test "x$has_java" = "xyes"])
 # CPPFLAGS while extending it by /include and to LDFLAGS while
 # extending it by /lib.
 if test -n "`echo $with_leveldb`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_leveldb}/include"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_leveldb}/include"
   LDFLAGS="$LDFLAGS -L${with_leveldb}/lib"
 fi
 
@@ -1202,7 +1210,7 @@ if test -z "`echo $with_libevent`" &&
 fi
 
 if test -n "`echo $with_libevent`"; then
-  CPPFLAGS="-I${with_libevent}/include $CPPFLAGS"
+  CPPFLAGS="-isystem ${with_libevent}/include $CPPFLAGS"
   LDFLAGS="-L${with_libevent}/lib $LDFLAGS"
 fi
 
@@ -1275,10 +1283,10 @@ AM_CONDITIONAL([WITH_BUNDLED_LIBPROCESS], [test "x$with_bundled_libprocess" = "x
 # Perform necessary configuration for network isolator.
 if test "x$with_network_isolator" = "xyes"; then
   if test -n "`echo $with_nl`"; then
-    CPPFLAGS="-I${with_nl}/include/libnl3 $CPPFLAGS"
+    CPPFLAGS="-isystem ${with_nl}/include/libnl3 $CPPFLAGS"
     LDFLAGS="-L${with_nl}/lib $LDFLAGS"
   else
-    CPPFLAGS="-I/usr/include/libnl3 $CPPFLAGS"
+    CPPFLAGS="-isystem /usr/include/libnl3 $CPPFLAGS"
   fi
 
   # Check for OS support.
@@ -1362,7 +1370,7 @@ if test "x$without_bundled_nvml" = "xyes" || \
     if test "$with_nvml" = "${with_nvml#/}"; then
       AC_MSG_ERROR([The path passed to --with-nvml must be absolute.])
     fi
-     CPPFLAGS="-I${with_nvml} $CPPFLAGS"
+     CPPFLAGS="-isystem ${with_nvml} $CPPFLAGS"
   fi
 
   AC_CHECK_HEADERS([nvidia/gdk/nvml.h], [],
@@ -1385,7 +1393,7 @@ AM_CONDITIONAL([WITH_BUNDLED_NVML],
 # CPPFLAGS while extending it by /include and to LDFLAGS while
 # extending it by /lib.
 if test -n "`echo $with_protobuf`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_protobuf}/include"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_protobuf}/include"
   LDFLAGS="$LDFLAGS -L${with_protobuf}/lib"
 fi
 
@@ -1467,7 +1475,7 @@ AC_SUBST([PROTOBUF_JAR])
 AC_SUBST([PROTOCOMPILER])
 
 if test -n "`echo $with_libev`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_libev}/include"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_libev}/include"
   LDFLAGS="$LDFLAGS -L${with_libev}/lib"
 fi
 
@@ -1513,7 +1521,7 @@ fi
 
 
 if test -n "`echo $with_picojson`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_picojson}/include"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_picojson}/include"
 fi
 
 # Check if user has asked us to use a preinstalled picojson, or if
@@ -1549,14 +1557,14 @@ AM_CONDITIONAL([WITH_BUNDLED_PICOJSON], [test "x$with_bundled_picojson" = "xyes"
 # CPPFLAGS while extending it by /include and to LDFLAGS while
 # extending it by /lib.
 if test -n "`echo $with_protobuf`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_protobuf}/include"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_protobuf}/include"
   LDFLAGS="$LDFLAGS -L${with_protobuf}/lib"
 fi
 # Check if Sasl2 prefix path was provided, and if so, add it to
 # the CPPFLAGS and LDFLAGS with respective /include and /lib path
 # suffixes.
 if test -n "`echo $with_sasl`" ; then
-  CPPFLAGS="-I${with_sasl}/include $CPPFLAGS"
+  CPPFLAGS="-isystem ${with_sasl}/include $CPPFLAGS"
   LDFLAGS="-L${with_sasl}/lib $LDFLAGS"
 fi
 
@@ -1650,7 +1658,7 @@ if test -z "`echo $with_ssl`" &&
 fi
 
 if test -n "`echo $with_ssl`"; then
-  CPPFLAGS="-I${with_ssl}/include $CPPFLAGS"
+  CPPFLAGS="-isystem ${with_ssl}/include $CPPFLAGS"
   LDFLAGS="-L${with_ssl}/lib $LDFLAGS"
 fi
 
@@ -1741,10 +1749,10 @@ if test -z "`echo $with_svn`" &&
 fi
 
 if test -n "`echo $with_svn`"; then
-  CPPFLAGS="-I${with_svn}/include/subversion-1 $CPPFLAGS"
+  CPPFLAGS="-isystem ${with_svn}/include/subversion-1 $CPPFLAGS"
   LDFLAGS="-L${with_svn}/lib $LDFLAGS"
 else
-  CPPFLAGS="-I/usr/include/subversion-1 $CPPFLAGS"
+  CPPFLAGS="-isystem /usr/include/subversion-1 $CPPFLAGS"
 fi
 
 AC_CHECK_HEADERS([svn_version.h],
@@ -1822,7 +1830,7 @@ AM_CONDITIONAL([ENABLE_XFS_DISK_ISOLATOR], [test "x$enable_xfs_disk_isolator" =
 # the CPPFLAGS and LDFLAGS with respective /include and /lib path
 # suffixes.
 if test -n "`echo $with_zlib`" ; then
-    CPPFLAGS="-I${with_zlib}/include $CPPFLAGS"
+    CPPFLAGS="-isystem ${with_zlib}/include $CPPFLAGS"
     LDFLAGS="-L${with_zlib}/lib $LDFLAGS"
 fi
 
@@ -1845,10 +1853,10 @@ fi
 # NOTE: The reason we append /include/zookeeper is because in mesos,
 # we include <zookeeper.h> rather than <zookeeper/zookeeper.h>.
 if test -n "`echo $with_zookeeper`"; then
-  CPPFLAGS="$CPPFLAGS -I${with_zookeeper}/include/zookeeper"
+  CPPFLAGS="$CPPFLAGS -isystem ${with_zookeeper}/include/zookeeper"
   LDFLAGS="$LDFLAGS -L${with_zookeeper}/lib"
 elif test "x$enable_bundled" != "xyes"; then
-  CPPFLAGS="$CPPFLAGS -I/usr/include/zookeeper"
+  CPPFLAGS="$CPPFLAGS -isystem /usr/include/zookeeper"
 fi
 
 


[2/2] mesos git commit: Added MESOS-7581 to the 1.2.2 CHANGELOG.

Posted by ti...@apache.org.
Added MESOS-7581 to the 1.2.2 CHANGELOG.

Review: https://reviews.apache.org/r/60427/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/31f13a52
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/31f13a52
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/31f13a52

Branch: refs/heads/1.2.x
Commit: 31f13a52bc5f1fd8c52275b50f9ca5f4857d5e86
Parents: da240ec
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Mon Jul 3 23:09:57 2017 +0200
Committer: Till Toenshoff <to...@me.com>
Committed: Tue Jul 4 00:04:52 2017 +0200

----------------------------------------------------------------------
 CHANGELOG | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/31f13a52/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index bda88ff..3b2be74 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@ All Issues:
   * [MESOS-7540] - Add an agent flag for executor re-registration timeout.
   * [MESOS-7546] - WAIT_NESTED_CONTAINER sometimes returns 404.
   * [MESOS-7569] - Allow "old" executors with half-open connections to be preserved during agent upgrade / restart.
+  * [MESOS-7581] - Fix interference of external Boost installations when using some unbundled dependencies.
   * [MESOS-7689] - Libprocess can crash on malformed request paths for libprocess messages.