Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-7396

Build errors on a recent Linux (4.10.9)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.0
    • None
    • None

    Description

      A couple of issues building with the regular PKGBUILD for Archlinux:
      https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mesos

      The build script (simple and somewhat readable) includes the following notable flags :

       ../configure \
        --enable-optimize \
        --prefix=/usr \
        --sysconfdir=/etc \
        --libexecdir=/usr/lib \
        --exec-prefix=/usr \
        --sbindir=/usr/bin \
        --with-network-isolator
       make
      

      The first set of errors is :

      In file included from ../../src/checks/health_checker.cpp:56:0:
      ../../src/linux/ns.hpp: In function ‘Try<int> ns::clone(pid_t, int, const std::function<int()>&, int)’:
      ../../src/linux/ns.hpp:487:69: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
           pid_t pid = ((struct ucred*) CMSG_DATA(CMSG_FIRSTHDR(&message)))->pid;
                                                                           ^
      ../../src/linux/ns.hpp: In lambda function:
      ../../src/linux/ns.hpp:589:59: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
             ((struct ucred*) CMSG_DATA(CMSG_FIRSTHDR(&message)))->pid = ::getpid();
                                                                 ^
      ../../src/linux/ns.hpp:590:59: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
             ((struct ucred*) CMSG_DATA(CMSG_FIRSTHDR(&message)))->uid = ::getuid();
                                                                 ^
      ../../src/linux/ns.hpp:591:59: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
             ((struct ucred*) CMSG_DATA(CMSG_FIRSTHDR(&message)))->gid = ::getgid();
                                                                 ^
      cc1plus: all warnings being treated as errors
      make[2]: *** [Makefile:6848: checks/libmesos_no_3rdparty_la-health_checker.lo] Error 1
      make[2]: Leaving directory '/home/huitseeker/mesos/src/mesos-1.2.0/build/src'
      make[1]: *** [Makefile:3476: all] Error 2
      make[1]: Leaving directory '/home/huitseeker/mesos/src/mesos-1.2.0/build/src'
      make: *** [Makefile:765: all-recursive] Error 1
      ==> ERROR: A failure occurred in build().
          Aborting...
      

      Full log: https://gist.github.com/7b01ff080d91780ad5e4825dff610517

      This can be managed by adding :

      CPPFLAGS="-fno-strict-aliasing"
      

      before the above call to confgure.

      The following build error is :

      ../../src/linux/fs.cpp:273:13: error: In the GNU C Library, "makedev" is defined
       by <sys/sysmacros.h>. For historical compatibility, it is
       currently defined by <sys/types.h> as well, but we plan to
       remove this soon. To use "makedev", include <sys/sysmacros.h>
       directly. If you did not intend to use a system-defined macro
       "makedev", you should undefine it after including <sys/types.h>. [-Werror]
         entry.devno = makedev(major.get(), minor.get());
                   ^
      cc1plus: all warnings being treated as errors
      make[2]: *** [Makefile:7716: linux/libmesos_no_3rdparty_la-fs.lo] Error 1
      make[2]: Leaving directory '/home/huitseeker/mesos/src/mesos-1.2.0/build/src'
      make[1]: *** [Makefile:3476: all] Error 2
      make[1]: Leaving directory '/home/huitseeker/mesos/src/mesos-1.2.0/build/src'
      make: *** [Makefile:765: all-recursive] Error 1
      ==> ERROR: A failure occurred in build().
          Aborting...
      

      Full log :
      https://gist.github.com/be7ba7cd3251ae9ac1b63b09ee2a38cf

      This is fixed by adding

      #include <sys/sysmacros.h>
      

      towards the end of external imports in src/mesos-1.2.0/src/linux/fs.cpp

      Finally, the same error is triggered by the use of major and minor in
      src/mesos-1.2.0/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp and is fixed by the same import as well.

      (If you want to reproduce under Archlinux, use makepkg -e after any edition of the source, though Arch build scripts are not necessary)

      Attachments

        Activity

          People

            Unassigned Unassigned
            huitseeker François Garillot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: