You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jp...@apache.org on 2019/05/17 20:35:19 UTC

[mesos] branch master updated: Fix the XFS build for recent Fedora versions.

This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b7a4f5  Fix the XFS build for recent Fedora versions.
5b7a4f5 is described below

commit 5b7a4f50da026f7a3ff9edbeae5b7753aa8a1d37
Author: James Peach <jp...@apache.org>
AuthorDate: Fri May 17 13:34:19 2019 -0700

    Fix the XFS build for recent Fedora versions.
    
    On Fedora 30, we need to include <xfs/xfs.h> to get the right
    types, since <xfs/xfs_types.h> is no longer self-contained. For
    earlier versions, it is still safe to include both headers if
    they are available, though <xfs/xfs_types.>h> may need to be
    obtained via the xfsprogs-qa-devel package.
    
    Review: https://reviews.apache.org/r/70660/
---
 configure.ac                                          | 3 +++
 src/slave/containerizer/mesos/isolators/xfs/utils.hpp | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/configure.ac b/configure.ac
index b4bad57..4635bb3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2189,6 +2189,9 @@ packages for XFS disk isolator support.
 -------------------------------------------------------------------
   ])])
 
+  # xfs_types.h is optional, depending on the build OS.
+  AC_CHECK_HEADERS([xfs/xfs_types.h])
+
   AC_CHECK_HEADERS([blkid/blkid.h], [], [AC_MSG_ERROR([missing libblkid headers
 -------------------------------------------------------------------
 Please install the libblkid development package for XFS disk
diff --git a/src/slave/containerizer/mesos/isolators/xfs/utils.hpp b/src/slave/containerizer/mesos/isolators/xfs/utils.hpp
index db1829a..ee83f59 100644
--- a/src/slave/containerizer/mesos/isolators/xfs/utils.hpp
+++ b/src/slave/containerizer/mesos/isolators/xfs/utils.hpp
@@ -24,7 +24,13 @@
 #include <stout/nothing.hpp>
 #include <stout/try.hpp>
 
+// Fedora 30 defines prid_t via <xfs/xfs.h>, but earlier versions
+// need an explicit <xfs/xfs_types.h>.
+#include <xfs/xfs.h>
+
+#if HAVE_XFS_XFS_TYPES_H
 #include <xfs/xfs_types.h>
+#endif
 
 namespace mesos {
 namespace internal {