From 9ca1d189af3761ef804735c0761f77a1bffa8b6a Mon Sep 17 00:00:00 2001 From: Devin Leamy Date: Mon, 25 Mar 2024 21:31:33 +0000 Subject: [PATCH] [cgroups2] Introduce cgroups v2 isolator process. --- configure.ac | 3004 ---------------- src/Makefile.am | 3062 ----------------- .../mesos/isolators/cgroups2/cgroups2.cpp | 65 + .../mesos/isolators/cgroups2/cgroups2.hpp | 59 + support/mesos-tidy/Dockerfile | 83 - support/mesos-tidy/README.md | 63 - support/mesos-tidy/entrypoint.sh | 94 - support/mesos-website/Dockerfile | 35 - support/mesos-website/entrypoint.sh | 60 - 9 files changed, 124 insertions(+), 6401 deletions(-) delete mode 100644 configure.ac delete mode 100644 src/Makefile.am create mode 100644 src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp create mode 100644 src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.hpp delete mode 100644 support/mesos-tidy/Dockerfile delete mode 100644 support/mesos-tidy/README.md delete mode 100755 support/mesos-tidy/entrypoint.sh delete mode 100644 support/mesos-website/Dockerfile delete mode 100755 support/mesos-website/entrypoint.sh diff --git a/configure.ac b/configure.ac deleted file mode 100644 index e0314fb42e7..00000000000 --- a/configure.ac +++ /dev/null @@ -1,3004 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated with autoscan, then modified appropriately. -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.61]) -AC_INIT([mesos], [1.12.0]) - -# Have autoconf setup some variables related to the system. -AC_CANONICAL_HOST -AC_CANONICAL_BUILD -AC_CANONICAL_TARGET -AC_DISABLE_STATIC - -AC_LANG([C++]) - -# Default to gcc toolchain (we rely on some atomic builtins for now, -# that are also present with clang). -AC_PROG_CXX([g++]) -AC_PROG_CC([gcc]) - -AC_PROG_LN_S - -AX_COMPILER_VERSION -AX_COMPILER_VENDOR - -AC_CONFIG_MACRO_DIR([m4]) - -# Initialize automake. -# -Wno-portability, since we require GNU Make for % patterns -# Removal of -Werror due warnings introduced by automake 1.14. -AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign tar-pax]) -AM_MAINTAINER_MODE([enable]) - -# This is required for linking non-POSIX libs. -m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) - -# Initialize libtool (LT_OUTPUT builds ./libtool immediately, needed -# if we want to do tests with libtool during configuration). -LT_PREREQ([2.2]) -LT_INIT -LT_LANG([C++]) -LT_OUTPUT - -# Save the configure arguments so we can pass them to any third-party -# libraries that we might run configure on (see 3rdparty/Makefile.am). -# One downside of our strategy for shipping and building third-party -# libraries is that we can't expose options from nested third-party -# configure scripts. -CONFIGURE_ARGS="$ac_configure_args" -AC_SUBST(CONFIGURE_ARGS) - -AM_CONDITIONAL([STANDALONE_LIBPROCESS], [false]) -AM_CONDITIONAL([STANDALONE_STOUT], [false]) - -AC_CONFIG_FILES([Makefile mesos.pc]) -AC_CONFIG_FILES([src/Makefile]) -AC_CONFIG_FILES([3rdparty/Makefile]) -AC_CONFIG_FILES([3rdparty/libprocess/Makefile]) -AC_CONFIG_FILES([3rdparty/libprocess/include/Makefile]) -AC_CONFIG_FILES([3rdparty/stout/Makefile]) -AC_CONFIG_FILES([3rdparty/stout/include/Makefile]) -AC_CONFIG_FILES([3rdparty/gmock_sources.cc]) - -AC_CONFIG_FILES( - [bin/mesos.sh], - [chmod +x bin/mesos.sh]) -AC_CONFIG_FILES( - [bin/mesos-agent.sh], - [chmod +x bin/mesos-agent.sh]) -AC_CONFIG_FILES( - [bin/mesos-local.sh], - [chmod +x bin/mesos-local.sh]) -AC_CONFIG_FILES( - [bin/mesos-master.sh], - [chmod +x bin/mesos-master.sh]) -# TODO(tomxing): Remove this script once the -# slave->agent rename is complete(MESOS-3782). -AC_CONFIG_FILES( - [bin/mesos-slave.sh:bin/mesos-agent.sh.in], - [chmod +x bin/mesos-slave.sh]) -AC_CONFIG_FILES( - [bin/mesos-tests.sh], - [chmod +x bin/mesos-tests.sh]) -AC_CONFIG_FILES( - [bin/mesos-agent-flags.sh], - [chmod +x bin/mesos-agent-flags.sh]) -AC_CONFIG_FILES( - [bin/mesos-local-flags.sh], - [chmod +x bin/mesos-local-flags.sh]) -AC_CONFIG_FILES( - [bin/mesos-master-flags.sh], - [chmod +x bin/mesos-master-flags.sh]) -# TODO(tomxing): Remove this script once the -# slave->agent rename is complete(MESOS-3782). -AC_CONFIG_FILES( - [bin/mesos-slave-flags.sh:bin/mesos-agent-flags.sh.in], - [chmod +x bin/mesos-slave-flags.sh]) -AC_CONFIG_FILES( - [bin/mesos-tests-flags.sh], - [chmod +x bin/mesos-tests-flags.sh]) -AC_CONFIG_FILES( - [bin/gdb-mesos-agent.sh], - [chmod +x bin/gdb-mesos-agent.sh]) -AC_CONFIG_FILES( - [bin/gdb-mesos-local.sh], - [chmod +x bin/gdb-mesos-local.sh]) -AC_CONFIG_FILES( - [bin/gdb-mesos-master.sh], - [chmod +x bin/gdb-mesos-master.sh]) -# TODO(tomxing): Remove this script once the -# slave->agent rename is complete(MESOS-3782). -AC_CONFIG_FILES( - [bin/gdb-mesos-slave.sh:bin/gdb-mesos-agent.sh.in], - [chmod +x bin/gdb-mesos-slave.sh]) -AC_CONFIG_FILES( - [bin/gdb-mesos-tests.sh], - [chmod +x bin/gdb-mesos-tests.sh]) -AC_CONFIG_FILES( - [bin/lldb-mesos-agent.sh], - [chmod +x bin/lldb-mesos-agent.sh]) -AC_CONFIG_FILES( - [bin/lldb-mesos-local.sh], - [chmod +x bin/lldb-mesos-local.sh]) -AC_CONFIG_FILES( - [bin/lldb-mesos-master.sh], - [chmod +x bin/lldb-mesos-master.sh]) -# TODO(tomxing): Remove this script once the -# slave->agent rename is complete(MESOS-3782). -AC_CONFIG_FILES( - [bin/lldb-mesos-slave.sh:bin/lldb-mesos-agent.sh.in], - [chmod +x bin/lldb-mesos-slave.sh]) -AC_CONFIG_FILES( - [bin/lldb-mesos-tests.sh], - [chmod +x bin/lldb-mesos-tests.sh]) -AC_CONFIG_FILES( - [bin/valgrind-mesos-agent.sh], - [chmod +x bin/valgrind-mesos-agent.sh]) -AC_CONFIG_FILES( - [bin/valgrind-mesos-local.sh], - [chmod +x bin/valgrind-mesos-local.sh]) -AC_CONFIG_FILES( - [bin/valgrind-mesos-master.sh], - [chmod +x bin/valgrind-mesos-master.sh]) -# TODO(tomxing): Remove this script once the -# slave->agent rename is complete(MESOS-3782). -AC_CONFIG_FILES( - [bin/valgrind-mesos-slave.sh:bin/valgrind-mesos-agent.sh.in], - [chmod +x bin/valgrind-mesos-slave.sh]) -AC_CONFIG_FILES( - [bin/valgrind-mesos-tests.sh], - [chmod +x bin/valgrind-mesos-tests.sh]) -AC_CONFIG_FILES( - [src/deploy/mesos-daemon.sh], - [chmod +x src/deploy/mesos-daemon.sh]) -AC_CONFIG_FILES( - [src/deploy/mesos-start-agents.sh], - [chmod +x src/deploy/mesos-start-agents.sh]) -AC_CONFIG_FILES( - [src/deploy/mesos-start-cluster.sh], - [chmod +x src/deploy/mesos-start-cluster.sh]) -AC_CONFIG_FILES( - [src/deploy/mesos-start-masters.sh], - [chmod +x src/deploy/mesos-start-masters.sh]) -# TODO(tomxing): Remove this script once the -# slave->agent rename is complete(MESOS-3782). -AC_CONFIG_FILES( - [src/deploy/mesos-start-slaves.sh:src/deploy/mesos-start-agents.sh.in], - [chmod +x src/deploy/mesos-start-slaves.sh]) -AC_CONFIG_FILES( - [src/deploy/mesos-stop-agents.sh], - [chmod +x src/deploy/mesos-stop-agents.sh]) -AC_CONFIG_FILES( - [src/deploy/mesos-stop-cluster.sh], - [chmod +x src/deploy/mesos-stop-cluster.sh]) -AC_CONFIG_FILES( - [src/deploy/mesos-stop-masters.sh], - [chmod +x src/deploy/mesos-stop-masters.sh]) -# TODO(tomxing): Remove this script once the -# slave->agent rename is complete(MESOS-3782). -AC_CONFIG_FILES( - [src/deploy/mesos-stop-slaves.sh:src/deploy/mesos-stop-agents.sh.in], - [chmod +x src/deploy/mesos-stop-slaves.sh]) - -AC_CONFIG_FILES([include/mesos/version.hpp]) - -AC_CONFIG_FILES([src/java/generated/org/apache/mesos/MesosNativeLibrary.java]) - - -############################################################################### -# Optional features. -############################################################################### - - -AC_ARG_ENABLE([bundled], - AS_HELP_STRING([--disable-bundled], - [build against preinstalled dependencies instead - of bundled libraries]), - [], [enable_bundled=yes]) - -AC_ARG_ENABLE([bundled-pip], - AS_HELP_STRING([--disable-bundled-pip], - [excludes building and using the bundled pip - package in lieu of an installed version in - PYTHONPATH]), - [], [enable_bundled_pip=yes]) - -AC_ARG_ENABLE([bundled-setuptools], - AS_HELP_STRING([--disable-bundled-setuptools], - [excludes building and using the bundled setuptools - package in lieu of an installed version in - PYTHONPATH]), - [], [enable_bundled_setuptools=yes]) - -AC_ARG_ENABLE([bundled-wheel], - AS_HELP_STRING([--disable-bundled-wheel], - [excludes building and using the bundled wheel - package in lieu of an installed version in - PYTHONPATH]), - [], [enable_bundled_wheel=yes]) - -AC_ARG_ENABLE([debug], - AS_HELP_STRING([--enable-debug], - [enable debugging. If CFLAGS/CXXFLAGS are set, this - option will not change them]), - [], [enable_debug=no]) - -AC_ARG_ENABLE([gc-unused], - AS_HELP_STRING([--enable-gc-unused], - [enable garbage collection of unused program segments]), - [], [enable_gc_unused=no]) - -AC_ARG_ENABLE([hardening], - AS_HELP_STRING([--disable-hardening], - [disables security measures such as stack - protection and position independent library code]), - [], [enable_hardening=yes]) - -AC_ARG_ENABLE([install-module-dependencies], - AS_HELP_STRING([--enable-install-module-dependencies], - [Install third-party bundled dependencies required - for module development]), - [], [enable_install_module_dependencies=no]) - -AC_ARG_ENABLE([network-ports-isolator], - AS_HELP_STRING([--enable-network-ports-isolator], - [enable network ports isolator]), - [], [enable_network_ports_isolator=no]) - -AC_ARG_ENABLE([java], - AS_HELP_STRING([--disable-java], - [do not build Java bindings]), - [], [enable_java=yes]) - -AC_ARG_ENABLE([nvml], - AS_HELP_STRING([--disable-nvml], - [do not use the NVML headers]), - [], [enable_nvml=yes]) - -# TODO(bevers): Eventually make this enabled by default. -AC_ARG_ENABLE([jemalloc-allocator], - AS_HELP_STRING([--enable-jemalloc-allocator], - [Use jemalloc as the default memory allocator for the - mesos-master and mesos-agent binaries.]), - [], [enable_jemalloc_allocator=no]) - -# TODO(benh): Eventually make this enabled by default. -AC_ARG_ENABLE([last_in_first_out_fixed_size_semaphore], - AS_HELP_STRING([--enable-last-in-first-out-fixed-size-semaphore], - [enables the optimized LIFO fixed-size semaphore in libprocess]), - [], [enable_last_in_first_out_fixed_size_semaphore=no]) - -AC_ARG_ENABLE([launcher_sealing], - AS_HELP_STRING([--enable-launcher-sealing], - [Enables sealing of launcher binary during - initialization of Mesos containerizer. - A copy of launcher's binary is cloned into - memory and sealed to prevent overwriting of - launcher's executable by containers. - This is a Linux-specific feature and requires - the support of memfd by the kernel.]), - [], [enable_launcher_sealing=no]) - -AC_ARG_ENABLE([libevent], - AS_HELP_STRING([--enable-libevent], - [use libevent instead of libev]), - [], [enable_libevent=no]) - -# TODO(benh): Eventually make this enabled by default. -AC_ARG_ENABLE([lock_free_event_queue], - AS_HELP_STRING([--enable-lock-free-event-queue], - [enables the lock-free event queue in libprocess]), - [], [enable_lock_free_event_queue=no]) - -# TODO(benh): Eventually make this enabled by default. -AC_ARG_ENABLE([lock_free_run_queue], - AS_HELP_STRING([--enable-lock-free-run-queue], - [enables the lock-free run queue in libprocess]), - [], [enable_lock_free_run_queue=no]) - -AC_ARG_ENABLE([new_cli], - AS_HELP_STRING([--enable-new-cli], - [enable building the new CLI instead of the old one]), - [], [enable_new_cli=no]) - -AC_ARG_ENABLE([libtool-wrappers], - AS_HELP_STRING([--disable-libtool-wrappers], - [Directly create binaries instead of libtool - wrapper scripts to prevent relinking when first - executing binaries from the build directory. This - flag leads to binaries with the build directory - encoded in the executables' RPATH which makes them - in general unfit for installation. - USE WITH CARE.])) - -AC_ARG_ENABLE([optimize], - AS_HELP_STRING([--enable-optimize], - [enable optimizations. If CFLAGS/CXXFLAGS are set, - this option will not change them]), - [], [enable_optimize=no]) - -AC_ARG_ENABLE([parallel_test_execution], - AS_HELP_STRING([--disable-parallel-test-execution], - [disable the parallel runner used during make check]), - [], [enable_parallel_test_execution=yes]) - -AC_ARG_ENABLE([perftools], - AS_HELP_STRING([--enable-perftools], - [enable Google perftools]), - [], [enable_perftools=no]) - -AC_ARG_ENABLE([port-mapping-isolator], - AS_HELP_STRING([--enable-port-mapping-isolator], - [enable port mapping network isolator]), - [], [enable_port_mapping_isolator=no]) - -AC_ARG_ENABLE([python], - AS_HELP_STRING([--disable-python], - [do not build Python bindings]), - [], [enable_python=yes]) - -# This is used to make distcheck and python install work together. For more -# information, see the comment above AM_DISTCHECK_CONFIGURE_FLAGS in -# Makefile.am. -AC_ARG_ENABLE([python-dependency-install], - AS_HELP_STRING([--disable-python-dependency-install], - [when the python packages are installed during - make install, no external dependencies are - downloaded or installed]), - [], [enable_python_dependency_install=yes]) - -AC_ARG_ENABLE([seccomp-isolator], - AS_HELP_STRING([--enable-seccomp-isolator], - [Builds the Seccomp isolator which depends on - libseccomp and requires Linux kernel 3.5+ - This flag will be deprecated in the future when - we drop support for the outdated Linux kernels.]), - [], [enable_seccomp_isolator=no]) - -AC_ARG_ENABLE([ssl], - AS_HELP_STRING([--enable-ssl], - [use ssl for libprocess communication]), - [], [enable_ssl=no]) - -AC_ARG_ENABLE([static-unimplemented], - AS_HELP_STRING([--enable-static-unimplemented], - [generate static assertion errors for unimplemented - functions]), - [], [enable_static_unimplemented=no]) - -AC_ARG_ENABLE([tests-install], - AS_HELP_STRING([--enable-tests-install], - [build and install tests and their helper tools]), - [], [enable_tests_install=no]) - -AC_ARG_ENABLE([werror], - AS_HELP_STRING([--disable-werror], - [do not treat compiler warnings as fatal errors])) - -AC_ARG_ENABLE([xfs-disk-isolator], - AS_HELP_STRING([--enable-xfs-disk-isolator], - [builds the XFS disk isolator]), - [], [enable_xfs_disk_isolator=no]) - -# TODO(dleamy): This flag should flipped to --disable-cgroups-v2 so using -# cgroups v2 is the default. -AC_ARG_ENABLE([cgroups-v2], - AS_HELP_STRING([--enable-cgroups-v2], - [builds the cgroups2 and ebpf modules]), - [], [enable_cgroups_v2=no]) - -############################################################################### -# Optional packages. -############################################################################### - -AC_ARG_WITH([apr], - AS_HELP_STRING([--with-apr=@<:@=DIR@:>@], - [specify where to locate the apr-1 library]), - [], []) - -AC_ARG_WITH([boost], - AS_HELP_STRING([--with-boost@<:@=DIR@:>@], - [excludes building and using the bundled Boost - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_boost=yes], []) - -AC_ARG_WITH([concurrentqueue], - AS_HELP_STRING([--with-concurrentqueue@<:@=DIR@:>@], - [excludes building and using the bundled concurrentqueue - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_concurrentqueue=yes], []) - -AC_ARG_WITH([curl], - AS_HELP_STRING([--with-curl=@<:@=DIR@:>@], - [specify where to locate the curl library]), - [], []) - -AC_ARG_WITH([elfio], - AS_HELP_STRING([--with-elfio@<:@=DIR@:>@], - [excludes building and using the bundled ELFIO - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_elfio=yes], []) - -AC_ARG_WITH([glog], - AS_HELP_STRING([--with-glog@<:@=DIR@:>@], - [excludes building and using the bundled glog - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_glog=yes], []) - -AC_ARG_WITH([gmock], - AS_HELP_STRING([--with-gmock@<:@=DIR@:>@], - [excludes building and using the bundled gmock - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_gmock=yes], []) - -AC_ARG_WITH([grpc], - AS_HELP_STRING([--with-grpc@<:@=DIR@:>@], - [excludes building and using the bundled grpc - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_grpc=yes], []) - -AC_ARG_WITH([http-parser], - AS_HELP_STRING([--with-http-parser@<:@=DIR@:>@], - [excludes building and using the bundled http-parser - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_http_parser=yes], []) - -AC_ARG_WITH([jemalloc], - AS_HELP_STRING([--with-jemalloc@<:@=DIR@:>@], - [excludes building and using the bundled jemalloc - package in lieu of an installed version at a - location prefixed by the given path.]), - [without_bundled_jemalloc=yes], []) - -AC_ARG_WITH([leveldb], - AS_HELP_STRING([--with-leveldb@<:@=DIR@:>@], - [excludes building and using the bundled LevelDB - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_leveldb=yes], []) - -AC_ARG_WITH([libev], - AS_HELP_STRING([--with-libev@<:@=DIR@:>@], - [excludes building and using the bundled libev - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_libev=yes], []) - -AC_ARG_WITH([libevent], - AS_HELP_STRING([--with-libevent=@<:@=DIR@:>@], - [specify where to locate the libevent library]), - [without_bundled_libevent=yes], []) - -AC_ARG_WITH([libarchive], - AS_HELP_STRING([--with-libarchive=@<:@=DIR@:>@], - [specify where to locate the libarchive library]), - [without_bundled_libarchive=yes], []) - -AC_ARG_WITH([libprocess], - AS_HELP_STRING([--with-libprocess=@<:@=DIR@:>@], - [specify where to locate the libprocess library]), - [], []) - -AC_ARG_WITH([libseccomp], - AS_HELP_STRING([--with-libseccomp=@<:@=DIR@:>@], - [specify where to locate the libseccomp library]), - [without_bundled_libseccomp=yes], []) - -AC_ARG_WITH([network-isolator], - AS_HELP_STRING([--with-network-isolator], - [builds the network isolator]), - [AC_MSG_WARN([--with-network-isolator is being deprecated, please use --enable-port-mapping-isolator instead.]); - enable_port_mapping_isolator=yes], - []) - -AC_ARG_WITH([nvml], - AS_HELP_STRING([--with-nvml@<:@=DIR@:>@], - [excludes building and using the bundled NVML headers - in lieu of an installed version at a location - prefixed by the given path]), - [without_bundled_nvml=yes], []) - -AC_ARG_WITH([picojson], - AS_HELP_STRING([--with-picojson@<:@=DIR@:>@], - [excludes building and using the bundled picojson - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_picojson=yes], []) - -AC_ARG_WITH([rapidjson], - AS_HELP_STRING([--with-rapidjson@<:@=DIR@:>@], - [excludes building and using the bundled rapidjson - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_rapidjson=yes], []) - -AC_ARG_WITH([re2], - AS_HELP_STRING([--with-re2@<:@=DIR@:>@], - [excludes building and using the bundled re2 - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_re2=yes], []) - -AC_ARG_WITH([protobuf], - AS_HELP_STRING([--with-protobuf@<:@=DIR@:>@], - [excludes building and using the bundled protobuf - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_protobuf=yes], []) - -AC_ARG_WITH([sasl], - AS_HELP_STRING([--with-sasl=@<:@=DIR@:>@], - [specify where to locate the sasl2 library]), - [], []) - -AC_ARG_WITH([ssl], - AS_HELP_STRING([--with-ssl=@<:@=DIR@:>@], - [specify where to locate the ssl library]), - [], []) - -AC_ARG_WITH([stout], - AS_HELP_STRING([--with-stout=@<:@=DIR@:>@], - [specify where to locate stout library]), - [], []) - -AC_ARG_WITH([svn], - AS_HELP_STRING([--with-svn=@<:@=DIR@:>@], - [specify where to locate the svn-1 library]), - [], []) - -AC_ARG_WITH([zlib], - AS_HELP_STRING([--with-zlib=@<:@=DIR@:>@], - [specify where to locate the zlib library]), - [], []) - -AC_ARG_WITH([zookeeper], - AS_HELP_STRING([--with-zookeeper@<:@=DIR@:>@], - [excludes building and using the bundled ZooKeeper - package in lieu of an installed version at a - location prefixed by the given path]), - [without_bundled_zookeeper=yes], []) - - -############################################################################### -# Debug/Optimization checks. -############################################################################### - -# Check if we should enable debugging, optimization. Note we only -# update CFLAGS and CXXFLAGS if none are provided. -AM_CONDITIONAL([DEBUG], [test x"$enable_debug" = "xyes"]) -AM_CONDITIONAL([OPTIMIZE], [test x"$enable_optimize" = "xyes"]) - -debug_flags="-g1" -if test "x$enable_debug" = "xyes"; then - debug_flags="-g -fno-omit-frame-pointer" -elif test "x$enable_optimize" = "xyes"; then - debug_flags="" -fi - -if test "x$enable_optimize" = "xyes"; then - optimize_flags="-O2" -else - optimize_flags="-O0" -fi - -AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"], - [CFLAGS="$debug_flags $optimize_flags"]) -AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"], - [CXXFLAGS="$debug_flags $optimize_flags"]) - - -############################################################################### -# Compiler checks. -############################################################################### - -# Check if we should use the LIFO fixed-size semaphore. -AS_IF([test "x$enable_last_in_first_out_fixed_size_semaphore" = "xyes"], - [AC_DEFINE([LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE])]) - -# Check if we should use the lock-free event queue. -AS_IF([test "x$enable_lock_free_event_queue" = "xyes"], - [AC_DEFINE([LOCK_FREE_EVENT_QUEUE])]) - -# Check if we should use the lock-free run queue. -AS_IF([test "x$enable_lock_free_run_queue" = "xyes"], - [AC_DEFINE([LOCK_FREE_RUN_QUEUE])]) - -# Check if we should link the mesos binaries against jemalloc. -AM_CONDITIONAL([ENABLE_JEMALLOC_ALLOCATOR], - [test x"$enable_jemalloc_allocator" = "xyes"]) - -# Check to see if we should harden or not. -AM_CONDITIONAL([ENABLE_HARDENING], [test x"$enable_hardening" = "xyes"]) - -AC_MSG_CHECKING([whether to enable GC of unused sections]) -AC_MSG_RESULT([$enable_gc_unused]) - -AS_IF([test "x$enable_gc_unused" = "xyes"], [ - AC_LANG_PUSH([C++]) - saved_CXXFLAGS="$CXXFLAGS" - saved_LDFLAGS="$LDFLAGS" - - CXXFLAGS="-ffunction-sections -fdata-sections" - LDFLAGS="-Wl,--gc-sections" - AC_LINK_IFELSE( - [ AC_LANG_PROGRAM([], [return 0;]) ], - [], - [ - AC_MSG_ERROR([cannot enable GC of unused sections -------------------------------------------------------------------- -The current toolchain does not support the necessary options to -enable garbage collection of unused sections. -------------------------------------------------------------------- - ]) - ] - ) - - CXXFLAGS="$saved_CXXFLAGS" - LDFLAGS="$saved_LDFLAGS" - AC_LANG_POP() -]) - -AS_IF([test "x${enable_gc_unused}" = "xyes"], [ - CCFLAGS="$CCFLAGS -ffunction-sections -fdata-sections" - CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections" - LDFLAGS="$LDFLAGS -Wl,--gc-sections" -]) - -AS_CASE($ax_cv_cxx_compiler_vendor, - [clang], [ - # Upstream Clang 3.6 emits `-Wunused-local-typedef` warnings when compiling - # Boost so we suppress them here. Apple LLVM based on Clang 3.6 doesn't have - # the same behavior. See: https://reviews.apache.org/r/32749/ - # NOTE(chhsiao): Clang 3.6.0 from the link below seems to compile Boost - # 1.53.0/1.65.0 just fine: http://releases.llvm.org/download.html#3.6.0 - # - # Clang 3.6+ emits `-Winconsistent-missing-override` warnings for most uses - # of the Google Mock `MOCK_METHOD` family of macros so we suppress them - # here. See: https://github.com/google/googletest/issues/533 - AX_APPEND_COMPILE_FLAGS([-Wno-unused-local-typedef \ - -Wno-inconsistent-missing-override], - [CXXFLAGS], [-Werror]) - ], [gnu], [ - # Check for GCC version >= 4.8. - AX_COMPARE_VERSION([$ax_cv_cxx_compiler_version], [ge], [4.8], - [is_ge_gxx48=yes], [is_ge_gxx48=no]) - if test "x$is_ge_gxx48" != "xyes"; then - # GCC < 4.8 is not supported. - AC_MSG_ERROR([GCC 4.8 or higher required (found $ax_cv_cxx_compiler_version)]) - fi - - AC_MSG_NOTICE([Setting up CXXFLAGS for g++ version >= 4.8]) - # Boost fails to compile with GCC 4.8+ without `-Wno-unused-local-typedefs`, - # and automake does not recognize the flag. - # TODO(brenden): Remove this when Boost has a resolution. - CFLAGS="${CFLAGS} -Wno-unused-local-typedefs" - CXXFLAGS="${CXXFLAGS} -Wno-unused-local-typedefs" - - # Disable 'maybe-uninitialized' warning when "-O2" is enabled due - # to MESOS-2690. This is short term fix until the GCC bug is fixed. - case $CXXFLAGS in - *-O2*) CXXFLAGS="${CXXFLAGS} -Wno-maybe-uninitialized" ;; - *) ;; - esac - ], [ - AC_MSG_WARN([$ax_cv_cxx_compiler_vendor is an unsupported compiler]) - ] -) - -# If our compiler supports strong stack protection, use it. -# If not, use a lesser form of stack protection. -AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], - [AC_SUBST(STACK_PROTECTOR, "-fstack-protector-strong")], - [AC_SUBST(STACK_PROTECTOR, "-fstack-protector")]) - -# Ensure that CXX supports C++11 (with "strict" conformance), and set -# "--std=" flag and CXXFLAGS environment variable as appropriate. -AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory]) - -# Blacklist known incompatible C++ standard libraries to reduce chance -# of users accidentally using them. -# - libstdc++ (Pre 4.8.0, version datestamp 20130322) -# - libc++ (Pre 3.5.0, version string 1101) -AC_LANG_PUSH([C++]) -AC_COMPILE_IFELSE( -[AC_LANG_SOURCE([[ -#include - -#ifdef __GLIBCXX__ -#if __GLIBCXX__ < 20130322 -#error Force the compiler to fail and set COMPATIBLE_CXX_STDLIB=no. -#endif -#elif _LIBCPP_VERSION < 1101 -#error Force the compiler to fail and set COMPATIBLE_CXX_STDLIB=no. -#endif -]])], -[COMPATIBLE_CXX_STDLIB=yes], [COMPATIBLE_CXX_STDLIB=no]) -AC_LANG_POP([C++]) - -if test "x$COMPATIBLE_CXX_STDLIB" = "xno"; then - AC_MSG_ERROR([known incompatible C++ Standard library in use -------------------------------------------------------------------- -libstdc++ from GCC 4.8.0+ or libc++ from LLVM/Clang 3.5+ is required. - -If a new enough GCC installed (4.8.0+) it should automatically find -the right libstdc++. If clang is in use, it will automatically find -the newest libstdc++ on the host. - -If you are trying to use a different compiler from (clang, gcc) or a -alternate C++ Standard Library implementation, likely the flags being -passed to the compiler (CXXFLAGS) are not currently correct / being -picked up. -------------------------------------------------------------------- -]) -fi - -case "$host_os" in - darwin* ) - # If we're using clang, we need to pass -stdlib=libc++ too. - if test "x$ax_cv_cxx_compiler_vendor" = "xclang"; then - CXXFLAGS="$CXXFLAGS -stdlib=libc++" - fi - ;; - freebsd* ) - # If we're using clang, we need to pass -stdlib=libc++ too. - if test "x$ax_cv_cxx_compiler_vendor" = "xclang"; then - CXXFLAGS="$CXXFLAGS -stdlib=libc++" - fi - - # FreeBSD needs GTEST_HAS_PTHREAD for this version of gmock/gtest and - # _WITH_GETLINE for getline(). - CXXFLAGS="$CXXFLAGS -DGTEST_HAS_PTHREAD -D_WITH_GETLINE" - - # Add no-sentinal so that stout builds with system clang on 11.0 and later - # (3.8+). - CXXFLAGS="$CXXFLAGS -Wno-sentinel" - ;; -esac - - -############################################################################### -# Miscellaneous flags/library/tool checks. -############################################################################### - -AC_ARG_VAR([JAVA_HOME], [location of Java Development Kit (JDK)]) - -AC_ARG_VAR([JAVA_CPPFLAGS], [preprocessor flags for JNI]) - -AC_ARG_VAR([JAVA_JVM_LIBRARY], [full path to libjvm.so]) - -AC_ARG_VAR([MAVEN_HOME], [looks for mvn at MAVEN_HOME/bin/mvn]) - -AC_ARG_VAR([PROTOBUF_JAR], [full path to protobuf jar on prefixed builds]) - -AC_ARG_VAR([PYTHON], [which Python 2 interpreter to use]) - -AC_ARG_VAR([PYTHON_3], [which Python 3 interpreter to use]) - -AC_ARG_VAR([TEST_DRIVER], [executable and arguments of a test driver]) - -# Check for pthreads (uses m4/ax_pthread.m4). -AX_PTHREAD([], [AC_MSG_ERROR([failed to find pthreads])]) - -if test "x$enable_static_unimplemented" = "xyes"; then - AC_DEFINE([ENABLE_STATIC_UNIMPLEMENTED], [1]) -fi - -# Build libprocess as a static library with position independent code so -# that we can produce a final shared library which includes everything -# necessary (and only install that). -AM_CONDITIONAL([ENABLE_STATIC_LIBPROCESS], [true]) - -AC_MSG_NOTICE([Setting up build environment for ${target_cpu} ${target_os}]) -# Determine the current OS (TODO(benh): Does autotools do this for us?). -case "${host_os}" in - linux*) - OS_NAME=linux - LIBS="$LIBS -lrt" - ;; - darwin*) - OS_NAME=darwin - ;; - freebsd*) - OS_NAME=freebsd - ;; - *) - AC_MSG_ERROR("Mesos is currently unsupported on your platform.") -esac - -AM_CONDITIONAL([DISABLE_LIBTOOL_WRAPPERS], - [test x"$enable_libtool_wrappers" = "xno"]) - -# Used for conditionally including source files. -AM_CONDITIONAL([OS_LINUX], [test "x$OS_NAME" = "xlinux"]) -AM_CONDITIONAL([OS_FREEBSD], [test "x$OS_NAME" = "xfreebsd"]) - -AM_CONDITIONAL([HAS_GPERFTOOLS], [test "x$enable_perftools" = "xyes"]) - -AM_CONDITIONAL([INSTALL_MODULE_DEPENDENCIES], - [test x"$enable_install_module_dependencies" = "xyes"]) -AS_IF([test "x$enable_install_module_dependencies" = "xyes"], - [AC_SUBST(MODULE_CFLAGS, "-I${libdir}/mesos/3rdparty/include") - AC_SUBST(MODULE_LDFLAGS, "-L${libdir}/mesos/3rdparty/lib64 -L${libdir}/mesos/3rdparty/lib")]) - -AM_CONDITIONAL([INSTALL_TESTS], [test x"$enable_tests_install" = "xyes"]) -AS_IF([test x"$enable_tests_install" = "xyes"], - [AC_DEFINE([MESOS_INSTALL_TESTS], [1])]) - -# If we use our own test runner to parallelize gtests we can run -# everything but ROOT tests in parallel. -# We here set up `TEST_DRIVER` to contain an unexpanded automake -# variable name; this allows us to reuse the test runner to run bundled -# 3rdparty checks. The special quoting ensures that this containing a -# space is not expanded by autoconf. -# TODO(bbannier): Make this more readible by using autoconf/m4 magic. -AS_IF([test "x$enable_parallel_test_execution" = "xyes"], - [AC_SUBST([TEST_DRIVER], - '${abs_top_srcdir}/support/mesos-gtest-runner.py'[' --sequential='*ROOT_*'']])) - -# Define `WERROR` if the use of `-Werror` was not disabled, leave -# unset otherwise. An unset variable evaluates to an empty string -# in autoconf's substitution. -AS_IF([test "x$enable_werror" != "xno"], - [AC_SUBST([WERROR], [-Werror])]) - -# Check for libunwind - used by glog for tracebacks - and link it in if -# present. -# `-lgcc_s` is necessary on e.g. ARM64 and IA-64, see -# https://bugzilla.redhat.com/show_bug.cgi?id=480412 -# Notes: -# - Omitting it causes glog to link it anyway, resulting in the same problem. -# - If `-lgcc_s` isn't available, e.g. if compiling with a pure LLVM toolchain, -# then we won't link it here but glog will link it anyway, but it won't suffer -# from the problem which affects only libgcc. -if test "x$OS_NAME" = "xfreebsd"; then - AC_CHECK_LIB(execinfo, backtrace, LIBS="$LIBS -lexecinfo") -else - AC_CHECK_LIB(unwind, backtrace, LIBS="$LIBS -lgcc_s -lunwind") -fi - - -# Check if libssl prefix path was provided, and if so, add it to -# the CPPFLAGS and LDFLAGS with respective /include and /lib path -# suffixes. -if test -z "`echo $with_ssl`" && - test "$OS_NAME" = "darwin" && - test -n "`command -v brew`" && - test -n "`brew list --versions openssl`"; then - with_ssl=`brew --prefix openssl` -fi - -if test -n "`echo $with_ssl`"; then - SSL_CPPFLAGS="-I${with_ssl}/include" - SSL_LINKERFLAGS="-L${with_ssl}/lib" - - CPPFLAGS="$SSL_CPPFLAGS $CPPFLAGS" - LDFLAGS="$SSL_LINKERFLAGS $LDFLAGS" -fi - -AC_CHECK_LIB([crypto], [RAND_poll], [found_crypto=yes]) - -AC_CHECK_HEADERS([openssl/ssl.h], - [AC_CHECK_LIB([ssl], - [SSL_CTX_new], - [found_ssl=yes], - [], - [-lcrypto])]) - -if test "x$enable_ssl" = "xyes"; then - if test "x$found_ssl" != "xyes"; then - AC_MSG_ERROR([cannot find libssl -------------------------------------------------------------------- -libssl is required for an SSL-enabled build. -------------------------------------------------------------------- - ]) - fi - - if test "x$found_crypto" != "xyes"; then - AC_MSG_ERROR([cannot find libcrypto -------------------------------------------------------------------- -libcrypto is required for an SSL-enabled build. -------------------------------------------------------------------- - ]) - fi - - LIBS="-lssl -lcrypto $LIBS" - - AC_DEFINE([USE_SSL_SOCKET], [1]) -fi - -AM_CONDITIONAL([ENABLE_SSL], - [test "x$enable_ssl" = "xyes"]) - -AC_SUBST([SSL_CPPFLAGS]) -AC_SUBST([SSL_LINKERFLAGS]) - - -# Check if gflags are present. If so, make sure we link against them -# when building the Python module. -AC_CHECK_LIB([gflags], - [main], - [found_gflags=yes]) -if test "x$found_gflags" = "xyes"; then - GFLAGS_LIBS="-lgflags" -else - GFLAGS_LIBS="" -fi - -AC_CHECK_TOOL([PATCHCOMMAND_TEST], [patch], [], [$PATH]) -if test -z "`echo $PATCHCOMMAND_TEST`"; then - AC_MSG_ERROR([patch command not found in PATH]) -fi - -# Check if we need to do anything special to use the fts_* -# functions. On some systems (e.g., those that use musl instead of -# glibc), FTS support requires linking against an additional library. -AC_CHECK_HEADERS([fts.h], [], [AC_MSG_ERROR([cannot find fts.h -------------------------------------------------------------------- -Failed to find fts.h. If this header file is not provided by libc -on this system (e.g., musl), a separate FTS package must be installed. -------------------------------------------------------------------- -])]) - -AC_SEARCH_LIBS(fts_close, fts, [], [AC_MSG_ERROR([cannot find libfts -------------------------------------------------------------------- -Failed to find fts_close. If this function is not provided by libc -on this system (e.g., musl), a separate FTS package must be installed. -------------------------------------------------------------------- -])]) - -############################################################################### -# Miscellaneous checks related to (un)bundled software. -############################################################################### - -# Attempt to use preinstalled dependencies instead of the bundled -# versions in cases where the user specified their location -# (--with-XXX=DIR) or asked us to attempt to detect them -# (--disable-bundled). - - -# On OS X, if `--with-apr` was not provided, we try to use an available -# brew installed version. -if test -z "`echo $with_apr`" && - test "$OS_NAME" = "darwin" && - test -n "`command -v brew`" && - test -n "`brew list --versions apr`"; then - with_apr=`brew --prefix apr`/libexec -fi - -# Check if libapr-1 prefix path was provided, and if so, add it to -# the CPPFLAGS and LDFLAGS with respective /include/apr-1 and /lib path -# suffixes. We include /include/apr-1 because we include -# headers directly. -if test -n "`echo $with_apr`" ; then - CPPFLAGS="-I${with_apr}/include/apr-1 \ - -I${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" -fi - -AC_CHECK_HEADERS([apr_pools.h], - [AC_CHECK_LIB([apr-1], [apr_initialize], [], - [AC_MSG_ERROR([cannot find libapr-1 -------------------------------------------------------------------- -libapr-1 is required for mesos to build. -------------------------------------------------------------------- - ])])], [AC_MSG_ERROR([cannot find libapr-1 headers -------------------------------------------------------------------- -libapr-1 is required for mesos to build. -------------------------------------------------------------------- -])]) - -if test -n "`echo $with_boost`"; then - CPPFLAGS="$CPPFLAGS -I${with_boost}/include" -fi - -# Check if user has asked us to use a preinstalled Boost, or if they -# asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_boost" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([boost/version.hpp], [found_boost=yes]) - - if test "x$found_boost" = "xyes"; then - with_bundled_boost=no - else - AC_MSG_ERROR([cannot find Boost -------------------------------------------------------------------- -You have requested the use of a non-bundled Boost but no suitable -Boost could be found. - -You may want specify the location of Boost by providing a prefix -path via --with-boost=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_boost=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_BOOST], [test "x$with_bundled_boost" = "xyes"]) - -if test -n "`echo $with_concurrentqueue`"; then - CPPFLAGS="-I${with_concurrentqueue} $CPPFLAGS" -fi - - -# Check if user has asked us to use a preinstalled concurrentqueue, -# or if they asked us to ignore all bundled libraries while compiling -# and linking. -if test "x$without_bundled_concurrentqueue" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([concurrentqueue.h], [found_concurrentqueue=yes]) - - if test "x$found_concurrentqueue" = "xyes"; then - with_bundled_concurrentqueue=no - else - AC_MSG_ERROR([cannot find concurrentqueue -------------------------------------------------------------------- -You have requested the use of a non-bundled concurrentqueue but no -suitable concurrentqueue could be found. - -You may want specify the location of concurrentqueue by providing a -prefix path via --with-concurrentqueue=DIR, or check that the path -you provided is correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_concurrentqueue=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_CONCURRENTQUEUE], - [test "x$with_bundled_concurrentqueue" = "xyes"]) - - -# Check if Libcurl 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_curl`" ; then - CPPFLAGS="-I${with_curl}/include $CPPFLAGS" - LDFLAGS="-L${with_curl}/lib $LDFLAGS" -fi - -AC_CHECK_LIB([curl], [curl_global_init], [], - [AC_MSG_ERROR([cannot find libcurl -------------------------------------------------------------------- -libcurl is required for mesos to build. -------------------------------------------------------------------- -])]) - - -# If the user has asked not to include the bundled ELFIO headers, -# check to see if the path to the ELFIO headers has been specified. If -# it has, make sure that the path is absolute. If everything is in -# order, add this path to the CPPFLAGS. -if test "x$without_bundled_elfio" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - if test -n "`echo $with_elfio`"; then - 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" - fi - - AC_CHECK_HEADERS([elfio/elfio.hpp], [], - [AC_MSG_ERROR([Cannot find the ELFIO headers -------------------------------------------------------------------- -You have requested the use of a non-bundled ELFIO but no suitable -ELFIO headers could be found. Make sure these headers are either -installed on the system or the path passed via --with-elfio is correct. -------------------------------------------------------------------- - ])]) -else - with_bundled_elfio=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_ELFIO], [test "x$with_bundled_elfio" = "xyes"]) - - -# Check if glog prefix path was supplied and if so, add it to CPPFLAGS -# 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" - LDFLAGS="$LDFLAGS -L${with_glog}/lib" -fi - -# Check if user has asked us to use a preinstalled glog, or if they -# asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_glog" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([glog/logging.h], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], [])], - [TEST_LIBS="$TEST_LIBS -lglog"] [found_glog=yes], - [AC_MSG_WARN([glog is not installed.])])]) - - if test "x$found_glog" = "xyes"; then - with_bundled_glog=no - else - AC_MSG_ERROR([cannot find glog -------------------------------------------------------------------- -You have requested the use of a non-bundled glog but no suitable -glog could be found. - -You may want specify the location of glog by providing a prefix -path via --with-glog=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_glog=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_GLOG], - [test "x$with_bundled_glog" = "xyes"]) - - -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" - -elif test "x$enable_bundled" != "xyes"; then - CPPFLAGS="$CPPFLAGS -I/usr/src/gmock" - # On system installations the deps are handled separately. - # So insert a placeholder for substitution. - GTESTSRC="stdio.h" - check_gtest=yes -fi - -# Check if user has asked us to use a preinstalled gmock, or if they -# asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_gmock" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADER($GMOCKSRC, - [found_gmock=yes], - []) - - if test "x$found_gmock" = "xyes"; then - if test "x$check_gtest" = "xyes"; then - # TODO(jieyu): Symbol _init is not availble for libs on OS X. - AC_CHECK_LIB([gtest], - [_init], - [], - [AC_MSG_ERROR([gtest missing])]) - fi - with_bundled_gmock=no - else - AC_MSG_ERROR([cannot find gmock -------------------------------------------------------------------- -You have requested the use of a non-bundled gmock but no suitable -gmock could be found. - -You may want specify the location of gmock by providing a prefix -path via --with-gmock=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_gmock=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_GMOCK], [test "x$with_bundled_gmock" = "xyes"]) -AM_CONDITIONAL([LINKGTEST], [test "check_gtest" = "xyes"]) -AC_SUBST([GMOCKSRC]) -AC_SUBST([GTESTSRC]) - - -if test -n "`echo $with_http_parser`"; then - CPPFLAGS="$CPPFLAGS -I${with_http_parser}/include" - LDFLAGS="$LDFLAGS -L${with_http_parser}/lib" -fi - -# Check if user has asked us to use a preinstalled http-parser, or if -# they asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_http_parser" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([http_parser.h], - [AC_CHECK_LIB([http_parser], - [http_parser_init], - [found_http_parser=yes])]) - - if test "x$found_http_parser" = "xyes"; then - with_bundled_http_parser=no - else - AC_MSG_ERROR([cannot find http-parser -------------------------------------------------------------------- -You have requested the use of a non-bundled http-parser but no suitable -http-parser could be found. - -You may want specify the location of http-parser by providing a prefix -path via --with-http-parser=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_http_parser=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_HTTP_PARSER], - [test "x$with_bundled_http_parser" = "xyes"]) - - -# NB: Since malloc() and free() are declared in stdlib.h, and the -# jemalloc-specific api is detected at runtime, we dont need any -# jemalloc headers or modify CPPFLAGS here. -if test "x$enable_jemalloc_allocator" = "xyes"; then - if test "x$OS_NAME" != "xlinux"; then - # Building and linking against jemalloc is actually not a problem - # on OSX even now, but to make it actually *useful* we would have - # have to re-route all existing malloc/free calls through jemalloc. - # The recommended way of doing that on Mac seems to be call - # `malloc_default_zone()` and to overwrite the hooks in the - # returned `malloc_zone_t`. - AC_MSG_ERROR([ --------------------------------------------------------------------- -You have requested the default memory allocator to be replaced by -jemalloc, but your operating system was detected to be $OS_NAME. - -This feature is currently only supported on linux. --------------------------------------------------------------------- - ]) - fi - - if test -n "`echo $with_jemalloc`"; then - WITH_JEMALLOC="${with_jemalloc}" - fi - - # Check if the user asked us to use a preinstalled jemalloc, or if - # they asked us to ignore all bundled libraries while compiling and - # linking. - if test "x$without_bundled_jemalloc" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - - # Avoid AC_SEARCH_LIBS here because it would implicitly add jemalloc - # to LIBS, but we dont want to link it against libmesos, only the - # individual binaries - AC_CHECK_LIB([jemalloc], [malloc_stats_print], [found_jemalloc=yes]) - if test "x$found_jemalloc" = "xyes"; then - with_bundled_jemalloc=no - else - AC_MSG_ERROR([cannot find jemalloc -------------------------------------------------------------------- -You have requested the use of a non-bundled jemalloc but no suitable -library could be found. - -You may want specify the location of jemalloc by providing a prefix -path via --with-jemalloc=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- - ]) - fi - else - with_bundled_jemalloc=yes - fi - - AC_DEFINE([ENABLE_JEMALLOC_ALLOCATOR]) -fi - -AC_SUBST(WITH_JEMALLOC) -AM_CONDITIONAL([WITH_BUNDLED_JEMALLOC], - [test "x$with_bundled_jemalloc" = "xyes"]) - -# TODO(benh): Consider using AS_IF instead of just shell 'if' -# statements for better autoconf style (the AS_IF macros also make -# sure variable dependencies are handled appropriately). - -# A helper for checking whether we can compile and link using JNI with -# the current JAVA_CPPFLAGS (and JAVA_TEST_LDFLAGS which we setup -# ourselves below). -# TRY_LINK_JNI([ACTION-SUCCESS], [ACTION-FAILURE]) -AC_DEFUN([TRY_LINK_JNI], [ - cat <<__EOF__ >conftest.cpp [ -#include -int main(int argc, char** argv) -{ - JNIEnv* env; - JavaVM* jvm; - JavaVMInitArgs vmArgs; - return JNI_CreateJavaVM(&jvm, (void**) &env, &vmArgs); -}] -__EOF__ - - # Try to compile and link via libtool (the one we generate). - ./libtool --tag=CXX --mode=link $CXX -Wall -Werror $JAVA_CPPFLAGS \ - -o conftest conftest.cpp $JAVA_TEST_LDFLAGS >&5 - - if test $? != 0; then - rm -f conftest # Cleanup after ourselves. - $2 # Expand failure action. - else - rm -f conftest # Cleanup after ourselves. - $1 # Expand success action. - fi -]) - - -# Perform necessary configuration for building with Java. -if test "x$enable_java" = "xyes"; then - # First let's try and determine JAVA_HOME if it hasn't been set. We - # do this by checking to see if the directory found at the - # 'java.home' system property for the java found on the path - # includes javac. If so, then we'll guess that this is a JDK - # installation rather than a JRE installation. - if test -z "$JAVA_HOME"; then - AC_PATH_PROG([JAVAC], [javac], [$JAVAC]) - AC_PATH_PROG([JAVA], [java], [$JAVA]) - - if test "x$JAVA" = "x" || test "x$JAVAC" = "x"; then - AC_MSG_ERROR([cannot guess JAVA_HOME (no 'java' or 'javac' found)]) - fi - - AC_MSG_CHECKING([value of Java system property 'java.home']) - cat <<__EOF__ >conftest.java [ -public class conftest { - public static void main(String[] args) { - System.out.print(System.getProperty("java.home")); - } -}] -__EOF__ - - # Now build and run the code. - $JAVAC conftest.java && JAVA_DOT_HOME="`$JAVA -cp . conftest`" - - if test $? = 0 && test ! -z "$JAVA_DOT_HOME"; then - AC_MSG_RESULT($JAVA_DOT_HOME) - else - JAVA_DOT_HOME="" - AC_MSG_RESULT([not found]) - fi - - # Clean up after ourselves. - rm -f conftest.java conftest.class - - # Check if 'java.home' looks like a JDK installation, or if - # 'java.home'/.. looks like a JDK installation (e.g., Linux). - if test -f $JAVA_DOT_HOME/bin/javac; then - JAVA_HOME=$JAVA_DOT_HOME - elif test -f `dirname $JAVA_DOT_HOME`/bin/javac; then - JAVA_HOME=`dirname $JAVA_DOT_HOME` - fi - - if test -z "$JAVA_HOME"; then - AC_MSG_ERROR([could not guess JAVA_HOME]) - else - AC_MSG_NOTICE([using JAVA_HOME=$JAVA_HOME]) - fi - fi - - # Determine linker flags for Java if not set. - if test "$OS_NAME" = "darwin"; then - dir="$JAVA_HOME/jre/lib/server" - for dir in "$JAVA_HOME/lib/server" "$JAVA_HOME/jre/lib/server"; do - if test -e "$dir"; then - # Note that these are libtool specific flags. - JAVA_TEST_LDFLAGS="-framework JavaVM" - JAVA_JVM_LIBRARY=$dir/libjvm.dylib - break; - fi - done - elif test "$OS_NAME" = "linux"; then - for dir in \ - "$JAVA_HOME/lib/server" \ - "$JAVA_HOME/jre/lib/"{amd64,i386,arm,aarch64,ppc64,ppc64le,s390,s390x}"/server" - do - if test -e "$dir"; then - # Note that these are libtool specific flags. - JAVA_TEST_LDFLAGS="-L$dir -R$dir -Wl,-ljvm" - JAVA_JVM_LIBRARY=$dir/libjvm.so - break; - fi - done - elif test "$OS_NAME" = "freebsd"; then - for arch in amd64 i386 arm; do - dir="$JAVA_HOME/jre/lib/$arch/server" - if test -e "$dir"; then - # Note that these are libtool specific flags. - JAVA_TEST_LDFLAGS="-L$dir -R$dir -pthread -Wl,-ljvm" - JAVA_JVM_LIBRARY=$dir/libjvm.so - break; - fi - done - fi - - if test -z "$JAVA_TEST_LDFLAGS"; then - AC_MSG_ERROR([failed to determine linker flags for using Java \ -(bad JAVA_HOME or missing support for your architecture?)]) - fi - - # Now try and build with JNI, looping through possible compiler - # flags as necessary (provided JAVA_CPPFLAGS was not set). - AC_MSG_CHECKING([whether or not we can build with JNI]) - if test -z "$JAVA_CPPFLAGS"; then - 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"]], - [JAVA_CPPFLAGS=java_cppflags - TRY_LINK_JNI([break])]) - # Exhausted options. - AC_MSG_ERROR([failed to build with JNI - ------------------------------------------------------------------- - It appears we were unable to compile against the JNI. This is most - likely due to one of the following issues: - 1. You do not have a JDK installed on your system. - 2. All JDKs installed on your system have deprecated JNI headers. - It is advised to install OpenJDK on your system, as the JDK that - ships with OS X has deprecated JNI headers. - ------------------------------------------------------------------- - ]) - done - 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"]], - [JAVA_CPPFLAGS=java_cppflags - TRY_LINK_JNI([break])]) - # Exhausted options. - AC_MSG_ERROR([failed to build with JNI]) - done - fi - else - TRY_LINK_JNI([], [AC_MSG_ERROR([failed to build with JNI])]) - fi - AC_MSG_RESULT([yes]) - - AC_CONFIG_FILES([src/examples/java/test-exception-framework], - [chmod +x src/examples/java/test-exception-framework]) - AC_CONFIG_FILES([src/examples/java/test-executor], - [chmod +x src/examples/java/test-executor]) - AC_CONFIG_FILES([src/examples/java/test-framework], - [chmod +x src/examples/java/test-framework]) - AC_CONFIG_FILES([src/examples/java/test-multiple-executors-framework], - [chmod +x src/examples/java/test-multiple-executors-framework]) - AC_CONFIG_FILES([src/examples/java/test-log], - [chmod +x src/examples/java/test-log]) - AC_CONFIG_FILES([src/examples/java/v1-test-framework], - [chmod +x src/examples/java/v1-test-framework]) - AC_CONFIG_FILES([src/java/mesos.pom]) - - AC_DEFINE([MESOS_HAS_JAVA]) - - has_java=yes - - # Test for Maven so we can build the jar. - if test -z "$MAVEN_HOME"; then - AC_PATH_PROG([MVN], [mvn], [$MVN]) - - if test "x$MVN" = "x"; then - AC_MSG_ERROR([cannot find mvn on your path -------------------------------------------------------------------- -You may want verify that Maven has been correctly installed and -added to your PATH or set the MAVEN_HOME environment variable -to point to your Maven installation. -------------------------------------------------------------------- -]) - fi - else - AC_PATH_PROGS([MVN], [mvn], [$MVN], [$MAVEN_HOME/bin]) - - if test "x$MVN" = "x"; then - AC_MSG_ERROR([cannot find mvn inside $MAVEN_HOME/bin -------------------------------------------------------------------- -You may want verify the MAVEN_HOME validity or check that Maven -has been correctly installed. -------------------------------------------------------------------- -]) - fi - fi -fi - -AM_CONDITIONAL([HAS_JAVA], [test "x$has_java" = "xyes"]) -AC_PATH_PROG([JAVAH], [javah], [$JAVAH], [$JAVA_HOME/bin]) -AM_CONDITIONAL([HAS_JAVAH], [test "x$JAVAH" != "x"]) - - -# Check if LevelDB prefix path was supplied and if so, add it to -# 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" - LDFLAGS="$LDFLAGS -L${with_leveldb}/lib" -fi - -# Check if user has asked us to use a preinstalled LevelDB, or if they -# asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_leveldb" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([leveldb/db.h], - [AC_CHECK_LIB([leveldb], - [leveldb_open], - [found_leveldb=yes])]) - - if test "x$found_leveldb" = "xyes"; then - with_bundled_leveldb=no - else - AC_MSG_ERROR([cannot find LevelDB -------------------------------------------------------------------- -You have requested the use of a non-bundled LevelDB but no suitable -LevelDB could be found. - -You may want specify the location of LevelDB by providing a prefix -path via --with-leveldb=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_leveldb=yes -fi - - -AM_CONDITIONAL([WITH_BUNDLED_LEVELDB], - [test "x$with_bundled_leveldb" = "xyes"]) - - -# Check if we should use containerizer launcher sealing. -AC_MSG_CHECKING([whether to enable launcher sealing]) -AC_MSG_RESULT([$enable_launcher_sealing]) - -AS_IF([test "x$enable_launcher_sealing" = "xyes"], [ - # We only support launcher sealing on Linux. - AS_IF([test "$OS_NAME" = "linux"], - [], - [AC_MSG_ERROR([no launcher sealing support on $OS_NAME -------------------------------------------------------------------- -Launcher sealing is only supported on Linux. -------------------------------------------------------------------- - ])]) - - AC_DEFINE([ENABLE_LAUNCHER_SEALING]) -]) - -AM_CONDITIONAL([ENABLE_LAUNCHER_SEALING], [test "x$enable_launcher_sealing" = "xyes"]) - - -# Check if libevent prefix path was provided, and if so, add it to -# the CPPFLAGS and LDFLAGS with respective /include and /lib path -# suffixes. -if test -z "`echo $with_libevent`" && - test "$OS_NAME" = "darwin" && - test -n "`command -v brew`" && - test -n "`brew list --versions libevent`"; then - with_libevent=`brew --prefix libevent` -fi - -if test -n "`echo $with_libevent`"; then - CPPFLAGS="-I${with_libevent}/include $CPPFLAGS" - LDFLAGS="-L${with_libevent}/lib $LDFLAGS" -fi - -if test "x$enable_libevent" = "xyes"; then - # Check if user has asked us to use a preinstalled libevent, or if they - # asked us to ignore all bundled libraries while compiling and - # linking. - if test "x$without_bundled_libevent" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - MESOS_HAVE_LIBEVENT() - else - with_bundled_libevent=yes - fi - - AC_DEFINE([USE_LIBEVENT], [1]) -fi - -if test "x$enable_ssl" = "xyes"; then - if test "x$enable_libevent" = "xyes"; then - if test "x$with_bundled_libevent" != "xyes"; then - MESOS_HAVE_LIBEVENT_SSL() - fi - fi -fi - -AM_CONDITIONAL([ENABLE_LIBEVENT], - [test "x$enable_libevent" = "xyes"]) -AM_CONDITIONAL([WITH_BUNDLED_LIBEVENT], - [test "x$with_bundled_libevent" = "xyes"]) - - -# Check if user has asked us to use a preinstalled libarchive, or if -# they asked us to ignore all bundled libraries while compiling and -# linking. -if test -n "`echo $with_libarchive`"; then - CPPFLAGS="$CPPFLAGS -I${with_libarchive}/include" - LDFLAGS="$LDFLAGS -L${with_libarchive}/lib" -fi - -if test "x$without_bundled_libarchive" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([archive.h], [found_libarchive=yes]) - - if test "x$found_libarchive" = "xyes"; then - with_bundled_libarchive=no - else - AC_MSG_ERROR([cannot find libarchive -------------------------------------------------------------------- -You have requested the use of a non-bundled libarchive but no suitable -libarchive could be found. - -You may want specify the location of libarchive by providing a prefix -path via --with-libarchive=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi - -else - with_bundled_libarchive=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_LIBARCHIVE], [test "x$with_bundled_libarchive" = "xyes"]) - - -# Check if user has asked us to use a preinstalled libprocess, or if -# they asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_libprocess" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([process/process.hpp], [found_libprocess=yes]) - - if test "x$found_libprocess" = "xyes"; then - with_bundled_libprocess=no - else - AC_MSG_ERROR([cannot find libprocess -------------------------------------------------------------------- -You have requested the use of a non-bundled libprocess but no suitable -libprocess could be found. - -You may want specify the location of libprocess by providing a prefix -path via --with-libprocess=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi - - # TODO(kapil): Check for linkability of libprocess.so. -else - with_bundled_libprocess=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_LIBPROCESS], [test "x$with_bundled_libprocess" = "xyes"]) - - -AC_MSG_CHECKING([whether to enable the Seccomp isolator]) -AS_IF([test "x$enable_seccomp_isolator" = "xyes"], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - -AS_IF([test "x$enable_seccomp_isolator" = "xyes"], [ - # We only support Seccomp on Linux. - AS_IF([test "$OS_NAME" = "linux"], - [], - [AC_MSG_ERROR([no Seccomp support on $OS_NAME -------------------------------------------------------------------- -The Seccomp isolator is only supported on Linux. -------------------------------------------------------------------- - ])]) - - # Check if libseccomp prefix path was supplied and if so, add it to - # CPPFLAGS while extending it by /include and to LDFLAGS while - # extending it by /lib. - if test -n "`echo $with_libseccomp`"; then - CPPFLAGS="$CPPFLAGS -I${with_libseccomp}/include" - LDFLAGS="$LDFLAGS -L${with_libseccomp}/lib" - fi - - # Check if user has asked us to use a bundled libseccomp, or if - # they asked us to ignore all bundled libraries while compiling and - # linking. - if test "x$without_bundled_libseccomp" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([seccomp.h], [found_libseccomp=yes]) - - if test "x$found_libseccomp" = "xyes"; then - with_bundled_libseccomp=no - else - AC_MSG_ERROR([cannot find libseccomp -------------------------------------------------------------------- -You have requested the use of a non-bundled libseccomp but no suitable -libseccomp could be found. - -You may want specify the location of libseccomp by providing a prefix -path via --with-libseccomp=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi - else - with_bundled_libseccomp=yes - fi - - AC_DEFINE([ENABLE_SECCOMP_ISOLATOR]) -]) - -AM_CONDITIONAL([ENABLE_SECCOMP_ISOLATOR], [test "x$enable_seccomp_isolator" = "xyes"]) -AM_CONDITIONAL([WITH_BUNDLED_LIBSECCOMP], [test "x$with_bundled_libseccomp" = "xyes"]) - - -# Perform necessary configuration for port mapping isolator. -if test "x$enable_port_mapping_isolator" = "xyes"; then - # Check for OS support. - AS_IF([test "$OS_NAME" = "linux"], - [], - [AC_MSG_ERROR([cannot build port mapping isolator -------------------------------------------------------------------- -The port mapping isolator is only supported on Linux -------------------------------------------------------------------- - ])]) - - MESOS_HAVE_LIBNL3([], [ - MESOS_MSG_LIBNL3_ERROR([libnl-3 is required for building the port mapping isolator]) - ]) - - AC_DEFINE([ENABLE_PORT_MAPPING_ISOLATOR]) -fi - -AM_CONDITIONAL([ENABLE_PORT_MAPPING_ISOLATOR], - [test "x$enable_port_mapping_isolator" = "xyes"]) - - -if test "x$enable_network_ports_isolator" = "xyes"; then - - AS_IF([test "$OS_NAME" = "linux"], - [], - [AC_MSG_ERROR([cannot build network/ports isolator -------------------------------------------------------------------- -The network/ports isolator is only supported on Linux -------------------------------------------------------------------- - ])]) - - MESOS_HAVE_LIBNL3([], [ - MESOS_MSG_LIBNL3_ERROR([libnl-3 is required for building the network/ports isolator]) - ]) - - AC_DEFINE([ENABLE_NETWORK_PORTS_ISOLATOR]) -fi - -AM_CONDITIONAL([ENABLE_NETWORK_PORTS_ISOLATOR], - [test "x$enable_network_ports_isolator" = "xyes"]) - - -AM_CONDITIONAL( - [ENABLE_LINUX_ROUTING], - [test "x$enable_network_ports_isolator" = "xyes" -o "x$enable_port_mapping_isolator" = "xyes"]) - - -AM_CONDITIONAL( - [ENABLE_NVML], - [test "x$enable_nvml" = "xyes"]) - -AM_COND_IF([ENABLE_NVML], [AC_DEFINE([ENABLE_NVML])]) - -# If the user has asked not to include the bundled NVML headers for -# Nvidia GPU support, check to see if the path to the NVML headers has -# been specified. If it has, make sure that the path is absolute. If -# everything is in order, add this path to the CPPFLAGS. -if test "x$enable_nvml" = "xyes"; then - if test "x$without_bundled_nvml" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - if test -n "`echo $with_nvml`"; then - 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" - fi - - AC_CHECK_HEADERS([nvidia/gdk/nvml.h], [], - [AC_MSG_ERROR([Cannot find the Nvidia NVML headers - ------------------------------------------------------------------- - You have requested the use of a non-bundled NVML but no suitable - NVML headers could be found. Make sure these headers are either - installed on the system or the path passed via --with-nvml is correct. - ------------------------------------------------------------------- - ])]) - else - with_bundled_nvml=yes - fi -fi - -AM_CONDITIONAL([WITH_BUNDLED_NVML], - [test "x$with_bundled_nvml" = "xyes"]) - - -# Check if protobuf prefix path was supplied and if so, add it to -# CPPFLAGS while extending it by /include and to LDFLAGS while -# extending it by /lib. -if test -n "`echo $with_protobuf`"; then - PROTOBUF_CPPFLAGS="-I${with_protobuf}/include" - PROTOBUF_LINKERFLAGS="-L${with_protobuf}/lib" - - CPPFLAGS="$PROTOBUF_CPPFLAGS $CPPFLAGS" - LDFLAGS="$PROTOBUF_LINKERFLAGS $LDFLAGS" -fi - -# Check if user has asked us to use a preinstalled protobuf, or if -# they asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_protobuf" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Use the system default prefix if not specified. - if test -n "`echo $with_protobuf`"; then - PROTOBUFPREFIX="${with_protobuf}" - elif test "x$enable_bundled" != "xyes"; then - PROTOBUFPREFIX="/usr" - fi - - # Check for protobuf. - - AC_CHECK_HEADERS([google/protobuf/map.h], [found_protobuf=yes], - [found_protobuf=no]) - - if test "x$found_protobuf" = "xyes"; then - saved_LIBS="$LIBS" - LIBS="-lprotobuf $LIBS" - AC_LANG_PUSH([C++]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [ google::protobuf::ShutdownProtobufLibrary(); ])], - [ found_protobuf=yes ], - [ found_protobuf=no ]) - AC_LANG_POP() - LIBS="$saved_LIBS" - fi - - if test "x$found_protobuf" = "xyes"; then - with_bundled_protobuf=no - if test -z "`echo $PROTOBUF_JAR`"; then - PROTOBUF_JAR="${PROTOBUFPREFIX}/share/java/protobuf.jar" - fi - - if test "x$enable_java" = "xyes"; then - AC_CHECK_FILE([$PROTOBUF_JAR], - [], - [AC_MSG_ERROR([cannot find PROTOBUF_JAR=$PROTOBUF_JAR])]) - fi - - AC_CHECK_FILE([$PROTOBUFPREFIX/include/google/protobuf/wrappers.proto], - [], - [AC_MSG_ERROR([cannot find protobuf proto files])]) - - PROTOBUF_PROTOCFLAGS="-I${PROTOBUFPREFIX}/include" - - AC_CHECK_TOOL([PROTOCOMPILER_TEST], [protoc], [], [$PROTOBUFPREFIX/bin]) - - if test -z "`echo $PROTOCOMPILER_TEST`"; then - AC_MSG_ERROR([protoc not found in PATH]) - fi - - PROTOCOMPILER="$PROTOBUFPREFIX/bin/protoc" - - if test "x$enable_python" = "xyes"; then - AC_PYTHON_MODULE([google.protobuf], [yes]) - fi - else - AC_MSG_ERROR([cannot find protobuf -------------------------------------------------------------------- -You have requested the use of a non-bundled protobuf but no suitable -protobuf (version 3+) could be found. - -You may want specify the location of protobuf by providing a prefix -path via --with-protobuf=DIR, or check that the path you provided is -correct if youre already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_protobuf=yes - PROTOBUF_JAR="\${MESOS_BUILD_DIR}/src/java/target/protobuf-java-3.5.0.jar" -fi - -AM_CONDITIONAL([WITH_BUNDLED_PROTOBUF], - [test "x$with_bundled_protobuf" = "xyes"]) - -AC_SUBST([PROTOBUF_CPPFLAGS]) -AC_SUBST([PROTOBUF_JAR]) -AC_SUBST([PROTOBUF_LINKERFLAGS]) -AC_SUBST([PROTOBUF_PROTOCFLAGS]) -AC_SUBST([PROTOCOMPILER]) - - -if test -n "`echo $with_libev`"; then - CPPFLAGS="$CPPFLAGS -I${with_libev}/include" - LDFLAGS="$LDFLAGS -L${with_libev}/lib" -fi - -# Check if user has asked us to use a preinstalled libev, or if they -# asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_libev" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([ev.h], [found_libev=yes]) - - if test "x$found_libev" = "xyes"; then - with_bundled_libev=no - AC_MSG_WARN([libev found must have been built with -DEV_CHILD_ENABLE=0]) - else - AC_MSG_ERROR([cannot find libev -------------------------------------------------------------------- -You have requested the use of a non-bundled libev but no suitable -libev could be found. - -You may want specify the location of libev by providing a prefix -path via --with-libev=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_libev=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_LIBEV], [test "x$with_bundled_libev" = "xyes"]) - - -if test -n "`echo $with_picojson`"; then - CPPFLAGS="$CPPFLAGS -I${with_picojson}/include" -fi - -# Check if user has asked us to use a preinstalled picojson, or if -# they asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_picojson" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([picojson.h], [found_picojson=yes]) - - if test "x$found_picojson" = "xyes"; then - with_bundled_picojson=no - else - AC_MSG_ERROR([cannot find picojson -------------------------------------------------------------------- -You have requested the use of a non-bundled picojson but no suitable -picojson could be found. - -You may want specify the location of picojson by providing a prefix -path via --with-picojson=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_picojson=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_PICOJSON], [test "x$with_bundled_picojson" = "xyes"]) - - -if test -n "`echo $with_rapidjson`"; then - CPPFLAGS="$CPPFLAGS -I${with_rapidjson}/include" -fi - -# Check if user has asked us to use a preinstalled rapidjson, or if -# they asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_rapidjson" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([rapidjson/rapidjson.h], [found_rapidjson=yes]) - - if test "x$found_rapidjson" = "xyes"; then - with_bundled_rapidjson=no - else - AC_MSG_ERROR([cannot find rapidjson -------------------------------------------------------------------- -You have requested the use of a non-bundled rapidjson but no suitable -rapidjson could be found. - -You may want specify the location of rapidjson by providing a prefix -path via --with-rapidjson=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_rapidjson=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_RAPIDJSON], [test "x$with_bundled_rapidjson" = "xyes"]) - -# Check if re2 prefix path was supplied and if so, add it to CPPFLAGS -# while extending it by /include and to LDFLAGS while extending it by -# /lib. -if test -n "`echo $with_re2`"; then - CPPFLAGS="$CPPFLAGS -I${with_re2}/include" - LDFLAGS="$LDFLAGS -L${with_re2}/lib" -fi - -# Check if user has asked us to use a preinstalled re2, or if they -# asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_re2" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([re2/re2.h], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], [])], - [TEST_LIBS="$TEST_LIBS -lre2"] [found_re2=yes], - [AC_MSG_WARN([re2 is not installed.])])]) - - if test "x$found_re2" = "xyes"; then - with_bundled_re2=no - else - AC_MSG_ERROR([cannot find re2 -------------------------------------------------------------------- -You have requested the use of a non-bundled re2 but no suitable -re2 could be found. - -You may want specify the location of re2 by providing a prefix -path via --with-re2=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_re2=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_RE2], - [test "x$with_bundled_re2" = "xyes"]) - - - - -# 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" - LDFLAGS="-L${with_sasl}/lib $LDFLAGS" -fi - -AC_CHECK_LIB([sasl2], [sasl_done], [], - [AC_MSG_ERROR([cannot find libsasl2 -------------------------------------------------------------------- -We need libsasl2 for authentication! -------------------------------------------------------------------- -])]) - -AC_MSG_CHECKING([SASL CRAM-MD5 support]) - -# Render a test binary for checking if the SASL client supports CRAM-MD5. -cat <<__EOF__ >crammd5_installed.c [ -#include -#include -#include - -#include -#include -#include - -// We need to disable the deprecation warnings as Apple has decided -// to deprecate all of CyrusSASL's functions with OS 10.11 -// (see MESOS-3030). We are using GCC pragmas also for covering clang. -#ifdef __APPLE__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -static void search_crammd5( - client_sasl_mechanism_t *m, - sasl_info_callback_stage_t stage, - void *rock) -{ - if (stage == SASL_INFO_LIST_START || stage == SASL_INFO_LIST_END) { - return; - } - if (m->plug != NULL) { - if (!strcmp("CRAM-MD5", m->plug->mech_name)) { - printf("found"); - } - } -} - -int main(int argc, char** argv) -{ - int result = sasl_client_init(NULL); - if (result != SASL_OK) { - return 1; - } - sasl_client_plugin_info(NULL, &search_crammd5, NULL); - return 0; -}] - -#ifdef __APPLE__ -#pragma GCC diagnostic pop -#endif -__EOF__ - -# Build the SASL client check test binary. Prevent the use of possibly -# activated debug symbols in executables (cc -g) as those cause a -# distcheck failure on OSX by leaking build artefacts (.dsym). -AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"], - [SASL_TEST_CFLAGS=""], [SASL_TEST_CFLAGS=$CFLAGS]) -$CC crammd5_installed.c $CPPFLAGS $SASL_TEST_CFLAGS $LDFLAGS -lsasl2 \ - -o crammd5_installed 2>&1 >/dev/null - -# Run the test binary and get its output. -crammd5test=`./crammd5_installed 2>&1` - -# Clean up all leftovers from this test. -rm -f crammd5_installed.c crammd5_installed - -AS_IF([test "x$crammd5test" = "xfound"], - [AC_MSG_RESULT([yes])], - [AC_MSG_ERROR([no -------------------------------------------------------------------- -We need CRAM-MD5 support for SASL authentication. --------------------------------------------------------------------])]) - - -# Check if user has asked us to use a preinstalled stout, or if -# they asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_stout" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([stout/try.hpp], [found_stout=yes]) - - if test "x$found_stout" = "xyes"; then - with_bundled_stout=no - else - AC_MSG_ERROR([cannot find stout -------------------------------------------------------------------- -You have requested the use of a non-bundled stout but no suitable -stout could be found. - -You may want specify the location of stout by providing a prefix -path via --with-stout=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi -else - with_bundled_stout=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_STOUT], [test "x$with_bundled_stout" = "xyes"]) - - -# Check if libsvn-1 prefix path was provided, and if so, add it to -# the CPPFLAGS and LDFLAGS with respective /include and /lib path -# suffixes. We include /include/subversion-1 because we include -# directly. -if test -z "`echo $with_svn`" && - test "$OS_NAME" = "darwin" && - test -n "`command -v brew`" && - test -n "`brew list --versions subversion`"; then - with_svn=`brew --prefix subversion` -fi - -if test -n "`echo $with_svn`"; then - CPPFLAGS="-I${with_svn}/include/subversion-1 $CPPFLAGS" - LDFLAGS="-L${with_svn}/lib $LDFLAGS" -else - CPPFLAGS="-I/usr/include/subversion-1 $CPPFLAGS" -fi - -AC_CHECK_HEADERS([svn_version.h], - [AC_CHECK_LIB([svn_subr-1], [svn_stringbuf_create_ensure], [], - [AC_MSG_ERROR([cannot find libsvn_subr-1 -------------------------------------------------------------------- -libsubversion-1 is required for mesos to build. -------------------------------------------------------------------- - ])])], [AC_MSG_ERROR([cannot find libsvn_subr-1 headers -------------------------------------------------------------------- -libsubversion-1 is required for mesos to build. -------------------------------------------------------------------- -])]) - -AC_CHECK_HEADERS([svn_delta.h], - [AC_CHECK_LIB([svn_delta-1], [svn_txdelta], [], - [AC_MSG_ERROR([cannot find libsvn_delta-1 -------------------------------------------------------------------- -libsubversion-1 is required for mesos to build. -------------------------------------------------------------------- - ])])], [AC_MSG_ERROR([cannot find libsvn_delta-1 headers -------------------------------------------------------------------- -libsubversion-1 is required for mesos to build. -------------------------------------------------------------------- -])]) - - -AC_MSG_CHECKING([whether to enable the XFS disk isolator]) -AS_IF([test "x$enable_xfs_disk_isolator" = "xyes"], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - -AS_IF([test "x$enable_xfs_disk_isolator" = "xyes"], [ - # We only support XFS on Linux. - AS_IF([test "$OS_NAME" = "linux"], - [], - [AC_MSG_ERROR([no XFS support on $OS_NAME -------------------------------------------------------------------- -The XFS disk isolator is only supported on Linux. -------------------------------------------------------------------- - ])]) - - # Check for build dependencies for the XFS disk isolator. We only - # enable this if all the needed headers and libraries are present. - AC_CHECK_HEADERS([xfs/xfs.h linux/dqblk_xfs.h linux/quota.h sys/quota.h], - [], [AC_MSG_ERROR([missing XFS quota headers -------------------------------------------------------------------- -Please install the Linux kernel headers and xfsprogs development -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 -isolator support. -------------------------------------------------------------------- - ])]) - - # Note that AC_SEARCH_LIBS causes libblkid to be added to each binary. In - # this case, that is what we want, since the dependency will be in libmesos. - AC_SEARCH_LIBS(blkid_devno_to_devname, blkid, [], [AC_MSG_ERROR([missing libblkid -------------------------------------------------------------------- -Please install the libblkid package for XFS disk isolator support. -------------------------------------------------------------------- - ])]) - - AC_DEFINE([ENABLE_XFS_DISK_ISOLATOR]) -]) - -AM_CONDITIONAL([ENABLE_XFS_DISK_ISOLATOR], [test "x$enable_xfs_disk_isolator" = "xyes"]) - - -AC_MSG_CHECKING([whether to enable the cgroups v2]) -AS_IF([test "x$enable_cgroups_v2" = "xyes"], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - -AS_IF([test "x$enable_cgroups_v2" = "xyes"], [ - # We only support cgroups v2 on Linux. - AS_IF([test "$OS_NAME" = "linux"], - [], - [AC_MSG_ERROR([no cgroups v2 support on $OS_NAME -------------------------------------------------------------------- -cgroups v2 is only supported on Linux. -------------------------------------------------------------------- - ])]) - - # Check for build dependencies for cgroups v2. We only - # enable this if all the needed headers and libraries are present. - AC_CHECK_HEADERS([linux/bpf.h], - [], [AC_MSG_ERROR([missing eBPF headers -------------------------------------------------------------------- -Please install the bpf Linux kernel headers for cgroups v2 support. -------------------------------------------------------------------- - ])]) - - AC_DEFINE([ENABLE_CGROUPS_V2]) -]) - -AM_CONDITIONAL([ENABLE_CGROUPS_V2], [test "x$enable_cgroups_v2" = "xyes"]) - - -# Check if zlib 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_zlib`" ; then - ZLIB_CPPFLAGS="-I${with_zlib}/include" - ZLIB_LINKERFLAGS="-L${with_zlib}/lib" - - CPPFLAGS="$ZLIB_CPPFLAGS $CPPFLAGS" - LDFLAGS="$ZLIB_LINKERFLAGS $LDFLAGS" -fi - -AC_CHECK_HEADERS([zlib.h], - [AC_CHECK_LIB([z], [deflate, gzread, gzwrite, inflate], [], - [AC_MSG_ERROR([cannot find libz -------------------------------------------------------------------- -libz is required for Mesos to build. -------------------------------------------------------------------- - ])])], - [AC_MSG_ERROR([cannot find libz headers -------------------------------------------------------------------- -libz headers are required for Mesos to build. -------------------------------------------------------------------- - ])]) - -AC_SUBST([ZLIB_CPPFLAGS]) -AC_SUBST([ZLIB_LINKERFLAGS]) - - -# Check if grpc prefix path was supplied and if so, add it to the -# CPPFLAGS and LDFLAGS with respective /include and /lib path suffixes. -if test -n "`echo $with_grpc`"; then - if test "x$without_bundled_protobuf" != "xyes"; then - AC_MSG_ERROR([protobuf not specified -------------------------------------------------------------------- -You have requested the use of a non-bundled grpc without specifying -the protobuf library it uses. This is prohibited to avoid using -conflicting versions of protobuf libraries. Please specify the -location of protobuf used by grpc by providing a prefix path via ---with-protobuf=DIR. -------------------------------------------------------------------- - ]) - fi - - CPPFLAGS="$CPPFLAGS -I${with_grpc}/include" - LDFLAGS="$LDFLAGS -L${with_grpc}/lib" -fi - -# Check if user has asked us to use a preinstalled grpc, or if they -# asked us to ignore all bundled libraries while compiling and linking. -if test "x$without_bundled_grpc" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Use the system default prefix if not specified. - if test -n "`echo $with_grpc`"; then - GRPCPREFIX="${with_grpc}" - elif test "x$enable_bundled" != "xyes"; then - GRPCPREFIX="/usr" - fi - - if test "x$enable_ssl" = "xno"; then - GRPC_VARIANT="_unsecure" - fi - - # Check if headers and library were located. - saved_LIBS="$LIBS" - LIBS="-lgrpc++$GRPC_VARIANT -lgrpc$GRPC_VARIANT -lgpr $LIBS" - AC_LANG_PUSH([C++]) - AC_CHECK_HEADERS([grpcpp/grpcpp.h], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ], - [grpc::Version();])], - [found_grpc=yes], - [found_grpc=no])], - [found_grpc=no]) - AC_LANG_POP() - LIBS="$saved_LIBS" - - if test "x$found_grpc" = "xyes"; then - with_bundled_grpc=no - - AC_CHECK_TOOL([GRPC_CXX_PLUGIN_TEST], - [grpc_cpp_plugin], - [], - [$GRPCPREFIX/bin]) - - if test -z "`echo $GRPC_CXX_PLUGIN_TEST`"; then - AC_MSG_ERROR([grpc_cpp_plugin not found in PATH]) - fi - - GRPC_CXX_PLUGIN="$GRPCPREFIX/bin/grpc_cpp_plugin" - - else - AC_MSG_ERROR([cannot find grpc -------------------------------------------------------------------- -You have requested the use of a non-bundled grpc but no suitable -grpc could be found. - -You may want specify the location of grpc by providing a prefix -path via --with-grpc=DIR, or check that the path you provided is -correct if you are already doing this. -------------------------------------------------------------------- - ]) - fi -else - with_bundled_grpc=yes -fi - -AM_CONDITIONAL([WITH_BUNDLED_GRPC], - [test "x$with_bundled_grpc" = "xyes"]) - -AC_SUBST([GRPC_CXX_PLUGIN]) - - -# Check if ZooKeeper prefix path was supplied and if so, add it to -# CPPFLAGS while extending it by /include/zookeeper and to LDFLAGS -# while extending it by /lib. -# NOTE: The reason we append /include/zookeeper is because in mesos, -# we include rather than . -if test -n "`echo $with_zookeeper`"; then - CPPFLAGS="$CPPFLAGS -I${with_zookeeper}/include/zookeeper" - LDFLAGS="$LDFLAGS -L${with_zookeeper}/lib" -elif test "x$enable_bundled" != "xyes"; then - CPPFLAGS="$CPPFLAGS -I/usr/include/zookeeper" -fi - - -# Check if user has asked us to use a preinstalled ZooKeeper or if -# they asked us to ignore all bundled libraries while compiling and -# linking. -if test "x$without_bundled_zookeeper" = "xyes" || \ - test "x$enable_bundled" != "xyes"; then - # Check if headers and library were located. - AC_CHECK_HEADERS([zookeeper.h], - [AC_CHECK_LIB([zookeeper_mt], - [zookeeper_init], - [found_zookeeper=yes])]) - - if test "x$found_zookeeper" = "xyes"; then - with_bundled_zookeeper=no - else - AC_MSG_ERROR([cannot find ZooKeeper -------------------------------------------------------------------- -You have requested the use of a non-bundled ZooKeeper but no suitable -ZooKeeper could be found. - -You may want specify the location of ZooKeeper by providing a prefix -path via --with-zookeeper=DIR, or check that the path you provided is -correct if you're already doing this -------------------------------------------------------------------- -]) - fi -else - with_bundled_zookeeper=yes -fi - - -AM_CONDITIONAL([WITH_BUNDLED_ZOOKEEPER], - [test "x$with_bundled_zookeeper" = "xyes"]) - - -# Once all CXXFLAGS are completely assembled, make sure the we are not -# affected by libcxx undefined behavior, -# https://llvm.org/bugs/show_bug.cgi?id=28469. -AC_MSG_CHECKING([C++ standard library for undefined behaviour with selected optimization level]) -# NOTE: We clear `LIBS` here to prevent linking in libraries unrelated -# to the test. These libraries might not be in the linker lookup paths. -saved_LIBS="$LIBS" -LIBS="" -AC_LANG_PUSH([C++]) -AC_RUN_IFELSE([ - AC_LANG_SOURCE([[ - #include - #include - - struct F { - std::map> m; - F() { m[42] = []() {}; } - }; - - int main() { - F f; - f = F{}; - } - ]])], - [ - AC_MSG_RESULT([no]) - ], [ - AC_MSG_RESULT([yes]) - AC_MSG_ERROR([Mesos cannot be built with optimizations against this version of libcxx (MESOS-5745). - Consider building without optimizations, or changing the used C++ standard library.]) - ] -) -AC_LANG_POP([C++]) -LIBS="$saved_LIBS" - - -# NOTE: Do not update any compiler or linker settings (e.g. CXXFLAGS, -# LDFLAGS, ...) beyond this line. - -# Perform necessary configuration for building with Python. -if test "x$enable_python" = "xyes" || \ - test "x$enable_new_cli" = "xyes"; then - # Ensure PYTHON and PYTHON_VERSION are both set appropriately. We need - # to ensure this either when these variables are passed in the - # environment or when set via AM_PATH_PYTHON. If we don't do this, - # it's possible that a user will specify PYTHON_VERSION which will get - # ignored (and likely replaced) via AM_PATH_PYTHON. - # TODO(benh): Consolidate AM_PATH_PYTHON and AC_PYTHON_DEVEL into a - # single macro that both iterates through potential 'python' options - # looking for an acceptable version (i.e., AM_PATH_PYTHON) and - # checks for Python.h (i.e., AC_PYTHON_DEVEL). - if test -n "$PYTHON" && test -n "$PYTHON_VERSION"; then - AC_MSG_ERROR([only specify one of PYTHON or PYTHON_VERSION]) - fi - - if test -n "$PYTHON_VERSION"; then - # Set $PYTHON using $PYTHON_VERSION - AC_SUBST([PYTHON], [python$PYTHON_VERSION]) - elif test -n "$PYTHON"; then - # Set $PYTHON_VERSION using $PYTHON - PYTHON_VERSION=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"` - else - AM_PATH_PYTHON() - fi -fi - -if test "x$enable_python" = "xyes"; then - # Check if PYTHON is at least 2.6 or try and find one that is if - # PYTHON is not set (necessary to run our examples). - AM_PYTHON_CHECK_VERSION([$PYTHON], [2.6], [], - [AC_MSG_ERROR([Mesos requires Python >= 2.6 -------------------------------------------------------------------- -The detected Python version is $PYTHON_VERSION from $PYTHON. - -If you already have Python 2.6+ installed (and it's the default python -on the path), you might want to check if you have the PYTHON environment -variable set to an older version of Python. -------------------------------------------------------------------- - ])]) - - AM_PYTHON_CHECK_VERSION([$PYTHON], [3.0], - [AC_MSG_ERROR([Mesos requires Python < 3.0 -------------------------------------------------------------------- -The detected Python version is $PYTHON_VERSION from $PYTHON. - -If you already have Python 2.6+ installed (and it's the default python -on the path), you might want to check if you have the PYTHON environment -variable set to a version of Python greater than 3.0. -------------------------------------------------------------------- - ])], []) - - if test "x$enable_new_cli" = "xyes" && test -z "$PYTHON_3"; then - AC_MSG_ERROR([Missing PYTHON_3 environment variable -------------------------------------------------------------------- -The detected Python version is $PYTHON_VERSION from $PYTHON. -Python 3 not detected. - -When building both the Python bindings and the CLI, the detected Python -version is used to build the bindings and PYTHON_3 must be set -explicitely in order to build the CLI. -------------------------------------------------------------------- - ]) - fi -fi - -if test "x$enable_new_cli" = "xyes"; then - if test -z "$PYTHON_3"; then - AC_SUBST([PYTHON_3], [$PYTHON]) - fi - - PYTHON_3_VERSION=`$PYTHON_3 -c 'import sys; print(sys.version[[0:3]])'` - - AM_PYTHON_CHECK_VERSION([$PYTHON_3], [3.6], [], - [AC_MSG_ERROR([The Mesos CLI requires Python >= 3.6 -------------------------------------------------------------------- -The detected Python 3 version is $PYTHON_3_VERSION. - -The new CLI requires Python version 3.6 or newer in order to build. -You may wish to set the PYTHON_3 environment variable to make sure -that the right Python executable is found. -------------------------------------------------------------------- - ])]) - - # Find `tox` for testing `src/python/lib/`. - AC_CHECK_PROGS([tox], [tox]) - if test "x$tox" = "x"; then - AC_MSG_ERROR(['tox' is required in order to run Mesos Python library tests.]) - fi -fi - -if test "x$enable_python" = "xyes"; then - # Next we ensure we have the Python development libraries for Python 2. - AX_PYTHON_DEVEL([>= '2.6']) - - # Ensure that we can build a native Python egg linking against a - # static library that imports from the standard C++ library. - # This was added due to MESOS-799. - AC_MSG_CHECKING([whether we can build usable Python eggs]) - - # Render code that imports from the standard C++ library. - cat <<__EOF__ >testlib.cpp [ -#include -std::string test() -{ - return std::string("42"); -}] -__EOF__ - - # Build a static library from the above code. - $CXX -x c++ -fPIC -c testlib.cpp $CPPFLAGS $CFLAGS $CXXFLAGS \ - $LDFLAGS -o testlib.o - ar rcs libtest.a testlib.o - - # Render a native Python module that imports from that library. - cat <<__EOF__ >testpyegg.cpp [ -#include -#include - -std::string test(); -PyMODINIT_FUNC initminimal(); - -static PyObject *minimal_test(PyObject *self, PyObject* args) -{ - return PyString_FromString(test().c_str()); -} - -static PyMethodDef minimal_methods[] = { - { "test", minimal_test, METH_NOARGS, "Test." }, - { NULL, NULL } -}; - -PyMODINIT_FUNC initminimal() -{ - PyImport_AddModule("minimal"); - Py_InitModule("minimal", minimal_methods); -}] -__EOF__ - - # Render a distutils setup for building the Python egg. - cat <<__EOF__ >setup.py [ -from distutils.core import setup, Extension; -setup(name = 'MinimalTest', - version = '1.0', - description = 'foo', - ext_modules = [ Extension('minimal', - extra_objects = ['libtest.a'], - sources = ['testpyegg.cpp'] ) ] ) -] -__EOF__ - - # Build that Python egg that links against that library. The build - # settings are propagated to distutils. - # NOTE: We need to embed our CXXFLAGS in CFLAGS because distutils - # doesn't pull out CXXFLAGS automagically. - CXX="$CXX" CC="$CC" CFLAGS="$CFLAGS $CXXFLAGS" \ - LDFLAGS="$LDFLAGS" $PYTHON setup.py build_ext --inplace \ - --build-temp ./ 2>&1 >/dev/null - - # Run a test-script that makes use of the Python egg. - pyeggtest=`$PYTHON -c "import minimal; print(minimal.test())" 2>&1` - - # Validate the test-script output. - AS_IF([test "x$pyeggtest" = "x42"], [pyeggbuild=yes]) - - # Clean up all leftovers from this test. - rm -f testlib.cpp testlib.o libtest.a - rm -f testpyegg.cpp testpyegg.o setup.py minimal.so - - AS_IF([test "x$pyeggbuild" = "xyes"], - [AC_MSG_RESULT([yes])], - [AS_IF([test "x$OS_NAME" = "xdarwin"], - [AC_MSG_ERROR([no -------------------------------------------------------------------- -It appears we were unable to build a usable native Python egg. You -might be using the default Mac OS X Python distribution which is -incompatible for building native eggs using this compiler setup. -For more details, see: - https://issues.apache.org/jira/browse/MESOS-799 - -There are two possible workarounds for this issue: - 1. Disable python bindings by configuring with --disable-python. - 2. Use an alternative Python installation that was built using - the same build setup as Mesos. --------------------------------------------------------------------])], - [AC_MSG_ERROR([no -------------------------------------------------------------------- -It appears we were unable to build a usable native Python egg. - -There are two possible workarounds for this issue: - 1. Disable python bindings by configuring with --disable-python. - 2. Use an alternative Python installation that was built using - the same build setup as Mesos. --------------------------------------------------------------------])]) - ]) - - AC_MSG_CHECKING([for an old installation of the Mesos egg (before 0.20.0)]) - - $PYTHON -c "import mesos; mesos._mesos" &> /dev/null - - if test $? = 0; then - pymodulelocation=`$PYTHON -c \ - "import mesos; import os; print os.path.dirname(mesos.__path__[[0]])" \ - 2> /dev/null` - fi - - AS_IF([test -z "$pymodulelocation"], - [AC_MSG_RESULT([no])], - [AC_MSG_ERROR([yes -------------------------------------------------------------------- -It appears that you currently have a native Python egg installed -from a version before 0.20.0. This conflicts with the egg in this -version. - -There are two possible workarounds for this issue: - 1. Disable Python bindings by configuring with --disable-python. - 2. Uninstall the legacy egg from your Python installation. This - might require you doing: - rm -rf $pymodulelocation --------------------------------------------------------------------])]) - - # Determine how the generated Python egg's will get named, used in - # the Makefile to keep the targets from being rerun. - PYTHON_EGG_POSTFIX=`$PYTHON -c \ - 'import sys; \ - from distutils.util import get_platform; \ - print "-py" + sys.version[[0:3]] + "-" + get_platform()'` - - PYTHON_EGG_PUREPY_POSTFIX=`$PYTHON -c \ - 'import sys; \ - from distutils.util import get_platform; \ - print "-py" + sys.version[[0:3]]'` - - PYTHON_WHL_POSTFIX=`$PYTHON -c \ - 'import sys; \ - from distutils.util import get_platform; \ - print "-cp" + sys.version[[0:3]].replace(".", "") + "-none-" \ - + get_platform().replace(".", "_").replace("-", "_")'` - - PYTHON_WHL_PUREPY_POSTFIX=`$PYTHON -c \ - 'import sys; \ - print "-py" + sys.version[[0]] + "-none-any"'` - - AC_CONFIG_FILES([src/examples/python/test-executor], - [chmod +x src/examples/python/test-executor]) - AC_CONFIG_FILES([src/examples/python/test-framework], - [chmod +x src/examples/python/test-framework]) - AC_CONFIG_FILES([src/python/setup.py]) - AC_CONFIG_FILES([src/python/cli/setup.py]) - AC_CONFIG_FILES([src/python/interface/setup.py]) - AC_CONFIG_FILES([src/python/native_common/ext_modules.py]) - AC_CONFIG_FILES([src/python/executor/setup.py]) - AC_CONFIG_FILES([src/python/native/setup.py]) - AC_CONFIG_FILES([src/python/scheduler/setup.py]) - - AC_CONFIG_LINKS([src/python/executor/ext_modules.py:src/python/native_common/ext_modules.py]) - AC_CONFIG_LINKS([src/python/scheduler/ext_modules.py:src/python/native_common/ext_modules.py]) - - # When clang is being used, make sure that the distutils python- - # config cflags extraction does not cause build errors (MESOS-1079). - # TODO(tillt): Remove this once Apple distributed an updated Python. - PYTHON_CPPFLAGS="$CPPFLAGS" - PYTHON_CFLAGS="$CFLAGS $CXXFLAGS" # distutils requires we embed CXXFLAGS. - PYTHON_LDFLAGS="$LDFLAGS $GFLAGS_LIBS" - - AS_IF([test "x$ax_cv_cxx_compiler_vendor" = "xclang"], - [PYTHON_CPPFLAGS="$PYTHON_CPPFLAGS -Qunused-arguments" - PYTHON_CFLAGS="$PYTHON_CFLAGS -Qunused-arguments"]) - - AC_SUBST([PYTHON_CPPFLAGS]) - AC_SUBST([PYTHON_CFLAGS]) - AC_SUBST([PYTHON_EGG_POSTFIX]) - AC_SUBST([PYTHON_EGG_PUREPY_POSTFIX]) - AC_SUBST([PYTHON_WHL_POSTFIX]) - AC_SUBST([PYTHON_WHL_PUREPY_POSTFIX]) - AC_SUBST([PYTHON]) # Used by the example shell scripts and src/Makefile.am. - - AC_DEFINE([MESOS_HAS_PYTHON]) - - # Check if user has asked us to use a preinstalled setuptools, or if - # they asked us to ignore all bundled libraries while compiling and linking. - if test "x$enable_bundled_setuptools" != "xyes" || \ - test "x$enable_bundled" != "xyes"; then - - AC_PYTHON_MODULE([distutils], [no]) - if test "x$HAVE_PYMOD_distutils" = "xno"; then - AC_PYTHON_MODULE([setuptools], [no]) - - if test "x$HAVE_PYMOD_setuptools" = "xyes"; then - found_setuptools=yes - fi - - else - found_setuptools=yes - fi - - if test "x$found_setuptools" = "xyes"; then - with_bundled_setuptools=no - else - AC_MSG_ERROR([cannot find setuptools -------------------------------------------------------------------- -You have requested the use of a non-bundled setuptools but no suitable -setuptools could be found. - -You may want specify the location of setuptools by providing a prefix -path via --with-setuptools=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - fi - else - with_bundled_setuptools=yes - fi - - # Check if user has asked us to use a preinstalled pip, or if - # they asked us to ignore all bundled libraries while compiling and linking. - if test "x$enable_bundled_pip" != "xyes" || \ - test "x$enable_bundled" != "xyes"; then - - AC_PYTHON_MODULE([pip], [no]) - if test "x$HAVE_PYMOD_pip" = "xno"; then - AC_MSG_ERROR([cannot find pip -------------------------------------------------------------------- -You have requested the use of a non-bundled pip but no suitable -pip could be found. - -You may want specify the location of pip by providing a prefix -path via --with-pip=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - else - with_bundled_pip=no - fi - else - with_bundled_pip=yes - fi - - # Check if user has asked us to use a preinstalled wheel, or if - # they asked us to ignore all bundled libraries while compiling and linking. - if test "x$enable_bundled_wheel" != "xyes" || \ - test "x$enable_bundled" != "xyes"; then - - AC_PYTHON_MODULE([wheel], [no]) - if test "x$HAVE_PYMOD_wheel" = "xno"; then - AC_MSG_ERROR([cannot find wheel -------------------------------------------------------------------- -You have requested the use of a non-bundled wheel but no suitable -wheel could be found. - -You may want specify the location of wheel by providing a prefix -path via --with-wheel=DIR, or check that the path you provided is -correct if you're already doing this. -------------------------------------------------------------------- -]) - else - with_bundled_wheel=no - fi - else - with_bundled_wheel=yes - fi - - has_python=yes -fi - -AC_MSG_CHECKING([whether to enable new CLI]) -AS_IF([test "x$enable_new_cli" = "xyes"], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - -AM_CONDITIONAL([ENABLE_NEW_CLI], [test "x$enable_new_cli" = "xyes"]) - -AM_CONDITIONAL([HAS_PYTHON], [test "x$has_python" = "xyes"]) - -AM_CONDITIONAL([WITH_BUNDLED_SETUPTOOLS], - [test "x$with_bundled_setuptools" = "xyes"]) -AM_CONDITIONAL([WITH_BUNDLED_PIP], - [test "x$with_bundled_pip" = "xyes"]) -AM_CONDITIONAL([WITH_BUNDLED_WHEEL], - [test "x$with_bundled_wheel" = "xyes"]) - -AM_CONDITIONAL([ENABLE_PYTHON_DEPENDENCY_INSTALL], - [test "x$enable_python_dependency_install" = "xyes"]) - - -############################################################################### -# Configure args to be passed to 3rdparty libraries. -############################################################################### - -CONFIGURE_ARGS="$CONFIGURE_ARGS CXXFLAGS='$CXXFLAGS'" - - -############################################################################### -# Mesos version definitions. -############################################################################### - -# Provide more granular version numbers based on the version string, -# using the format MAJOR.MINOR.PATCH[-SUFFIX], where SUFFIX can itself -# contain dashes. -# -# NOTE: This definition must not be named such that it conflicts with -# existing definitions, e.g., 'version', 'ver'. -m4_define([major_minor_patch], - m4_split(m4_translit(AC_PACKAGE_VERSION, [-], [.]), [\.])) - -AC_SUBST(MESOS_MAJOR_VERSION, m4_car(major_minor_patch)) -AC_SUBST(MESOS_MINOR_VERSION, m4_car(m4_shift(major_minor_patch))) -AC_SUBST(MESOS_PATCH_VERSION, m4_car(m4_shift2(major_minor_patch))) - - -############################################################################### -# Configure libbuild definitions passed into 'src/common/git_version.hpp'. -############################################################################### - -git_dir="${srcdir}/.git/" -git_config=src/common/git_version.hpp - -# Create 'src/common/git_version.hpp' only if we did not do so before. This -# protects the results from getting overwritten by additional configure runs -# outside the reach of the git repository, as for example done by -# 'support/packaging/centos/build_rpm.sh'. - -AC_MSG_CHECKING([${git_config} presence]) - -AS_IF([test -f ${srcdir}/${git_config} || test -f ${git_config}], [AC_MSG_RESULT([yes])], [ - AC_MSG_RESULT([no]) - - AC_MSG_NOTICE([generating ${git_config}]) - - # When building from a git clone, the definitions BUILD_GIT_SHA, - # BUILD_GIT_BRANCH, and BUILD_GIT_TAG will be emitted. - - AS_IF([test -d ${git_dir}], [ - # Optionally set BUILD_GIT_SHA. - DEFINE_BUILD_GIT_SHA="" - - git_sha=$(git --git-dir=${git_dir} rev-parse HEAD 2>/dev/null) - - AS_IF([test $? = 0], [ - DEFINE_BUILD_GIT_SHA="#define BUILD_GIT_SHA \"${git_sha}\"" - ]) - AC_SUBST([DEFINE_BUILD_GIT_SHA]) - - # Optionally set BUILD_GIT_BRANCH. - DEFINE_BUILD_GIT_BRANCH="" - - git_branch=$(git --git-dir=${git_dir} symbolic-ref HEAD 2>/dev/null) - - AS_IF([test $? = 0], [ - DEFINE_BUILD_GIT_BRANCH="#define BUILD_GIT_BRANCH \"${git_branch}\"" - ]) - AC_SUBST([DEFINE_BUILD_GIT_BRANCH]) - - # Optionally set BUILD_GIT_TAG. - DEFINE_BUILD_GIT_TAG="" - - git_tag=$(git --git-dir=${git_dir} describe --exact --tags 2>/dev/null) - - AS_IF([test $? = 0], [ - DEFINE_BUILD_GIT_TAG="#define BUILD_GIT_TAG \"${git_tag}\"" - ]) - AC_SUBST([DEFINE_BUILD_GIT_TAG]) - ]) - - AC_CONFIG_FILES([${git_config}]) -]) - - -AC_OUTPUT - -AC_MSG_NOTICE([Build option summary: - CXX: $CXX - CXXFLAGS: $CXXFLAGS - CPPFLAGS: $CPPFLAGS - LDFLAGS: $LDFLAGS - LIBS: $LIBS - JAVA_TEST_LDFLAGS: $JAVA_TEST_LDFLAGS - JAVA_JVM_LIBRARY: $JAVA_JVM_LIBRARY -]) diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 6135a286425..00000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,3062 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License - -# Add 'subdir-objects' to build objects in respective subdirectories -# which is necessary for dealing with naming conflicts, i.e,, -# master/http.cpp and slave/http.cpp. -AUTOMAKE_OPTIONS = subdir-objects -MESOS_BUILD_DIR=@abs_top_builddir@ - -include ../3rdparty/versions.am - -# TODO(charles): Move these into an included automakefile and have -# them include $(top_builddir) as appropriate. -BOOST = 3rdparty/boost-$(BOOST_VERSION) -CONCURRENTQUEUE = 3rdparty/concurrentqueue-$(CONCURRENTQUEUE_VERSION) -CSI_V0 = 3rdparty/csi-$(CSI_V0_VERSION) -CSI_V1 = 3rdparty/csi-$(CSI_V1_VERSION) -ELFIO = 3rdparty/elfio-$(ELFIO_VERSION) -GLOG = 3rdparty/glog-$(GLOG_VERSION) -GMOCK = $(GOOGLETEST)/googlemock -GOOGLETEST = 3rdparty/googletest-release-$(GOOGLETEST_VERSION) -GRPC = 3rdparty/grpc-$(GRPC_VERSION) -GTEST = $(GOOGLETEST)/googletest -JEMALLOC = 3rdparty/jemalloc-$(JEMALLOC_VERSION) -LEVELDB = 3rdparty/leveldb-$(LEVELDB_VERSION) -LIBARCHIVE = 3rdparty/libarchive-$(LIBARCHIVE_VERSION) -LIBPROCESS = 3rdparty/libprocess -LIBSECCOMP = 3rdparty/libseccomp-$(LIBSECCOMP_VERSION) -NVML = 3rdparty/nvml-$(NVML_VERSION) -PICOJSON = 3rdparty/picojson-$(PICOJSON_VERSION) -PIP = 3rdparty/pip-$(PIP_VERSION) -PROTOBUF = 3rdparty/protobuf-$(PROTOBUF_VERSION) -RAPIDJSON = 3rdparty/rapidjson-$(RAPIDJSON_VERSION) -RE2 = 3rdparty/re2-$(RE2_VERSION) -SETUPTOOLS = 3rdparty/setuptools-$(SETUPTOOLS_VERSION) -STOUT = 3rdparty/stout -WHEEL = 3rdparty/wheel-$(WHEEL_VERSION) -ZOOKEEPER = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/src/c -ZOOKEEPER_JAR = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/zookeeper-$(ZOOKEEPER_VERSION).jar - - -# Unfortunatley, 'pkglibexecdir' and 'pkgsysconfdir' are not set -# before automake 1.11, so we need to set them manually (until we in -# the future assume an automake version). -pkglibexecdir = $(libexecdir)/$(PACKAGE) -pkgsysconfdir = $(sysconfdir)/$(PACKAGE) - -# Directories to optionally install test binaries and libraries. -testlibexecdir = $(pkglibexecdir)/tests - -# Directory where Mesos modules are installed. -pkgmoduledir = $(pkglibdir)/modules -relative_pkgmoduledir = $(PACKAGE)/modules - -# Initialize variables here so we can use += operator everywhere else. -lib_LTLIBRARIES = -pkgmodule_LTLIBRARIES = -noinst_LTLIBRARIES = -sbin_PROGRAMS = -bin_PROGRAMS = -pkglibexec_PROGRAMS = -dist_bin_SCRIPTS = -dist_pkglibexec_SCRIPTS = -nobase_dist_pkgdata_DATA = -nodist_sbin_SCRIPTS = -pkgsysconf_DATA = -check_PROGRAMS = -dist_check_SCRIPTS = -check_SCRIPTS = -BUILT_SOURCES = -CLEANFILES = -EXTRA_DIST = -PHONY_TARGETS = -LDADD = - -AM_LDFLAGS = - -if DISABLE_LIBTOOL_WRAPPERS -# This is used to force libtool to generate executables instead of wrapper -# scripts. A wrapper script might trigger relinking, which takes quite a while -# on slow machines, thus causing failure of tests. -# NOTE: Disabling libtool wrapper should only be used when building a mesos to -# be tested within the build tree, see `info libtool` for details. -AM_LDFLAGS += -no-install -endif - -# Use -Wl,--as-needed to AM_LDFLAGS since we link against all the -# libraries programs may depend upon, not the exact one. --as-needed -# causes the linker to only link to the ones a program actually uses, -# not the full list on the command line. -if OS_LINUX -AM_LDFLAGS += -Wl,--as-needed -endif - -# Add compiler and linker flags for pthreads. -AM_CXXFLAGS = $(PTHREAD_CFLAGS) - -# Enable common (and some language specific) warnings. -AM_CXXFLAGS += -Wall -# Warn when a comparison is made between signed and unsigned values. -AM_CXXFLAGS += -Wsign-compare -# Warn about use of format functions that can produce security issues. -AM_CXXFLAGS += -Wformat-security - -# We will also have much more hardened/secured binaries and libraries. -if ENABLE_HARDENING -# Produce position independent executables so that we better take advantage of ASLR. -AM_LDFLAGS += -pie -# Protect many of the functions with stack guards -# (either -fstack-protector-strong or -fstack-protector depending on compiler support). -AM_CXXFLAGS += @STACK_PROTECTOR@ -# Produce position independent code when appropriate. -AM_CXXFLAGS += -fPIC -fPIE -endif - -AM_LIBS = $(PTHREAD_LIBS) - -# Setup CPPFLAGS that are used for most source files. -MESOS_CPPFLAGS = $(AM_CPPFLAGS) -MESOS_CPPFLAGS += @WERROR@ -MESOS_CPPFLAGS += -DLIBDIR=\"$(libdir)\" -MESOS_CPPFLAGS += -DPKGLIBEXECDIR=\"$(pkglibexecdir)\" -MESOS_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\" -MESOS_CPPFLAGS += -DPKGMODULEDIR=\"$(pkgmoduledir)\" -MESOS_CPPFLAGS += -I$(top_srcdir)/include -MESOS_CPPFLAGS += -I../include - -# Protobuf headers that depend on mesos.pb.h need this. -MESOS_CPPFLAGS += -I../include/mesos - -# Set up include paths for the protocol buffer compiler. -PROTOCFLAGS = -I$(top_srcdir)/include -I$(srcdir) -I../$(CSI_V0) -I../$(CSI_V1) - -# Header only dependencies will be ignored for --disable-bundled. -# -# For non-convenience libraries we need to link them in to make the shared -# library each time. (Currently, we don't support platforms where this is not -# possible.) - -# NOTE: PicoJson requires __STDC_FORMAT_MACROS to be defined before importing -# 'inttypes.h'. Since other libraries may also import this header, it must -# be globally defined so that PicoJson has access to the macros, regardless -# of the order of inclusion. -MESOS_CPPFLAGS += -D__STDC_FORMAT_MACROS - -if WITH_BUNDLED_BOOST -MESOS_CPPFLAGS += -I../$(BOOST) -endif - -if WITH_BUNDLED_CONCURRENTQUEUE -MESOS_CPPFLAGS += -I../$(CONCURRENTQUEUE) -endif - -if WITH_BUNDLED_ELFIO -MESOS_CPPFLAGS += -I../$(ELFIO) -endif - -if WITH_BUNDLED_GLOG -MESOS_CPPFLAGS += -I../$(GLOG)/src -LIB_GLOG = ../$(GLOG)/libglog.la -else -LIB_GLOG = -lglog -LDADD += -lglog -endif - -if !ENABLE_SSL -GRPC_VARIANT = _unsecure -endif - -if WITH_BUNDLED_GRPC -MESOS_CPPFLAGS += -I../$(GRPC)/include -LIB_GRPC = ../$(GRPC)/libs/opt/libgrpc++$(GRPC_VARIANT).a \ - ../$(GRPC)/libs/opt/libgrpc$(GRPC_VARIANT).a \ - ../$(GRPC)/libs/opt/libgpr.a -GRPC_CPP_PLUGIN = ../$(GRPC)/bins/opt/grpc_cpp_plugin -else -LIB_GRPC = -lgrpc++$(GRPC_VARIANT) -lgrpc$(GRPC_VARIANT) -lgpr -GRPC_CPP_PLUGIN = @GRPC_CXX_PLUGIN@ -endif - -if WITH_BUNDLED_JEMALLOC -# TODO(bennoe): We could call `jemalloc-conf --libs` to get the required -# libs without hardcoding `-ldl`, but then a version bump could introduce -# additional dependencies without us being aware of it. -LIB_JEMALLOC = ../$(JEMALLOC)/lib/libjemalloc_pic.a -ldl -else -LIB_JEMALLOC = $(if $(WITH_JEMALLOC),\ - -L$(WITH_JEMALLOC)/lib -ljemalloc -ldl,\ - -ljemalloc -ldl) -endif - -if WITH_BUNDLED_LEVELDB -MESOS_CPPFLAGS += -I../$(LEVELDB)/include - -# We need to directly include the leveldb library in order to avoid -# the installed libmesos.la file to include leveldb in -# 'dependency_libs' (via '-L../3rdparty/leveldb -lleveldb'). - -LIB_LEVELDB = ../$(LEVELDB)/out-static/libleveldb.a -else -LIB_LEVELDB = -lleveldb -LDADD += -lleveldb -endif - -if WITH_BUNDLED_LIBARCHIVE -MESOS_CPPFLAGS += -I../$(LIBARCHIVE)/libarchive/ -LIB_LIBARCHIVE = ../$(LIBARCHIVE)/.libs/libarchive.la -LDADD += $(LIB_LIBARCHIVE) -else -LIB_LIBARCHIVE = -larchive -LDADD += -larchive -endif - -if WITH_BUNDLED_LIBPROCESS -MESOS_CPPFLAGS += -I$(top_srcdir)/$(LIBPROCESS)/include -LIB_PROCESS = ../$(LIBPROCESS)/libprocess.la -else -LIB_PROCESS = -lprocess -endif - -if ENABLE_SECCOMP_ISOLATOR -if WITH_BUNDLED_LIBSECCOMP -MESOS_CPPFLAGS += -I../$(LIBSECCOMP)/include -LIB_LIBSECCOMP = ../$(LIBSECCOMP)/src/libseccomp.la -else -LIB_LIBSECCOMP = -lseccomp -endif -endif - -if ENABLE_NVML -if WITH_BUNDLED_NVML -MESOS_CPPFLAGS += -I../$(NVML) -endif -endif - -if WITH_BUNDLED_PICOJSON -MESOS_CPPFLAGS += -I../$(PICOJSON) -endif - -if WITH_BUNDLED_PROTOBUF -MESOS_CPPFLAGS += -I../$(PROTOBUF)/src -LIB_PROTOBUF = ../$(PROTOBUF)/src/libprotobuf.la -PROTOC = ../$(PROTOBUF)/src/protoc -PROTOCFLAGS += -I../$(PROTOBUF)/src -else -LIB_PROTOBUF = -lprotobuf -LDADD += -lprotobuf -PROTOC = @PROTOCOMPILER@ -PROTOCFLAGS += @PROTOBUF_PROTOCFLAGS@ -endif - -if WITH_BUNDLED_RAPIDJSON -MESOS_CPPFLAGS += -I../$(RAPIDJSON)/include -endif - -if WITH_BUNDLED_RE2 -MESOS_CPPFLAGS += -I../$(RE2) -LIB_RE2 = ../$(RE2)/obj/libre2.a -else -LIB_RE2 = -lre2 -LDADD += -lre2 -endif - - -if WITH_BUNDLED_STOUT -MESOS_CPPFLAGS += -I$(top_srcdir)/$(STOUT)/include -endif - -if WITH_BUNDLED_ZOOKEEPER -MESOS_CPPFLAGS += -I../$(ZOOKEEPER)/include -MESOS_CPPFLAGS += -I../$(ZOOKEEPER)/generated -LIB_ZOOKEEPER = ../$(ZOOKEEPER)/libzookeeper_mt.la -else -LIB_ZOOKEEPER = -lzookeeper_mt -LDADD += -lzookeeper_mt -endif - -# README: we build the Mesos library out of a collection of -# convenience libraries (that is, libraries that do not get installed -# but we can use as building blocks to vary compile flags as necessary -# and then aggregate into final archives): libmesos_no_3rdparty.la -# libbuild.la, liblog.la, libjava.la. - -# First, let's define necessary protocol buffer files. - -ACLS_PROTO = $(top_srcdir)/include/mesos/authorizer/acls.proto -AGENT_PROTO = $(top_srcdir)/include/mesos/agent/agent.proto -ALLOCATOR_PROTO = $(top_srcdir)/include/mesos/allocator/allocator.proto -APPC_SPEC_PROTO = $(top_srcdir)/include/mesos/appc/spec.proto -AUTHENTICATION_PROTO = $(top_srcdir)/include/mesos/authentication/authentication.proto -AUTHORIZATION_PROTO = $(top_srcdir)/include/mesos/authorizer/authorizer.proto -CONTAINERIZER_PROTO = $(top_srcdir)/include/mesos/slave/containerizer.proto -DOCKER_SPEC_PROTO = $(top_srcdir)/include/mesos/docker/spec.proto -DOCKER_V1_PROTO = $(top_srcdir)/include/mesos/docker/v1.proto -DOCKER_V2_PROTO = $(top_srcdir)/include/mesos/docker/v2.proto -DOCKER_V2_2_PROTO = $(top_srcdir)/include/mesos/docker/v2_2.proto -EXECUTOR_PROTO = $(top_srcdir)/include/mesos/executor/executor.proto -FETCHER_PROTO = $(top_srcdir)/include/mesos/fetcher/fetcher.proto -HOOK_PROTO = $(top_srcdir)/include/mesos/module/hook.proto -MAINTENANCE_PROTO = $(top_srcdir)/include/mesos/maintenance/maintenance.proto -MASTER_PROTO = $(top_srcdir)/include/mesos/master/master.proto -MESOS_PROTO = $(top_srcdir)/include/mesos/mesos.proto -MODULE_PROTO = $(top_srcdir)/include/mesos/module/module.proto -OCI_SPEC_PROTO = $(top_srcdir)/include/mesos/oci/spec.proto -QUOTA_PROTO = $(top_srcdir)/include/mesos/quota/quota.proto -RESOURCE_PROVIDER_PROTO = $(top_srcdir)/include/mesos/resource_provider/resource_provider.proto -SCHEDULER_PROTO = $(top_srcdir)/include/mesos/scheduler/scheduler.proto -SECCOMP_PROTO = $(top_srcdir)/include/mesos/seccomp/seccomp.proto -STATE_PROTO = $(top_srcdir)/include/mesos/state/state.proto -OVERSUBSCRIPTION_PROTO = $(top_srcdir)/include/mesos/slave/oversubscription.proto -URI_PROTO = $(top_srcdir)/include/mesos/uri/uri.proto -V1_AGENT_PROTO = $(top_srcdir)/include/mesos/v1/agent/agent.proto -V1_ALLOCATOR_PROTO = $(top_srcdir)/include/mesos/v1/allocator/allocator.proto -V1_EXECUTOR_PROTO = $(top_srcdir)/include/mesos/v1/executor/executor.proto -V1_MAINTENANCE_PROTO = $(top_srcdir)/include/mesos/v1/maintenance/maintenance.proto -V1_MASTER_PROTO = $(top_srcdir)/include/mesos/v1/master/master.proto -V1_MESOS_PROTO = $(top_srcdir)/include/mesos/v1/mesos.proto -V1_QUOTA_PROTO = $(top_srcdir)/include/mesos/v1/quota/quota.proto -V1_RESOURCE_PROVIDER_PROTO = $(top_srcdir)/include/mesos/v1/resource_provider/resource_provider.proto -V1_SCHEDULER_PROTO = $(top_srcdir)/include/mesos/v1/scheduler/scheduler.proto - - -CXX_PROTOS = \ - ../include/mesos/mesos.pb.cc \ - ../include/mesos/mesos.pb.h \ - ../include/mesos/agent/agent.pb.cc \ - ../include/mesos/agent/agent.pb.h \ - ../include/mesos/allocator/allocator.pb.cc \ - ../include/mesos/allocator/allocator.pb.h \ - ../include/mesos/appc/spec.pb.cc \ - ../include/mesos/appc/spec.pb.h \ - ../include/mesos/authentication/authentication.pb.cc \ - ../include/mesos/authentication/authentication.pb.h \ - ../include/mesos/authorizer/acls.pb.cc \ - ../include/mesos/authorizer/acls.pb.h \ - ../include/mesos/authorizer/authorizer.pb.cc \ - ../include/mesos/authorizer/authorizer.pb.h \ - ../include/mesos/docker/spec.pb.cc \ - ../include/mesos/docker/spec.pb.h \ - ../include/mesos/docker/v1.pb.cc \ - ../include/mesos/docker/v1.pb.h \ - ../include/mesos/docker/v2.pb.cc \ - ../include/mesos/docker/v2.pb.h \ - ../include/mesos/docker/v2_2.pb.cc \ - ../include/mesos/docker/v2_2.pb.h \ - ../include/mesos/executor/executor.pb.cc \ - ../include/mesos/executor/executor.pb.h \ - ../include/mesos/fetcher/fetcher.pb.cc \ - ../include/mesos/fetcher/fetcher.pb.h \ - ../include/mesos/maintenance/maintenance.pb.cc \ - ../include/mesos/maintenance/maintenance.pb.h \ - ../include/mesos/master/master.pb.cc \ - ../include/mesos/master/master.pb.h \ - ../include/mesos/module/hook.pb.cc \ - ../include/mesos/module/hook.pb.h \ - ../include/mesos/module/module.pb.cc \ - ../include/mesos/module/module.pb.h \ - ../include/mesos/oci/spec.pb.cc \ - ../include/mesos/oci/spec.pb.h \ - ../include/mesos/quota/quota.pb.cc \ - ../include/mesos/quota/quota.pb.h \ - ../include/mesos/resource_provider/resource_provider.pb.cc \ - ../include/mesos/resource_provider/resource_provider.pb.h \ - ../include/mesos/scheduler/scheduler.pb.cc \ - ../include/mesos/scheduler/scheduler.pb.h \ - ../include/mesos/seccomp/seccomp.pb.cc \ - ../include/mesos/seccomp/seccomp.pb.h \ - ../include/mesos/slave/containerizer.pb.cc \ - ../include/mesos/slave/containerizer.pb.h \ - ../include/mesos/slave/oversubscription.pb.cc \ - ../include/mesos/slave/oversubscription.pb.h \ - ../include/mesos/state/state.pb.cc \ - ../include/mesos/state/state.pb.h \ - ../include/mesos/uri/uri.pb.cc \ - ../include/mesos/uri/uri.pb.h \ - ../include/mesos/v1/mesos.pb.cc \ - ../include/mesos/v1/mesos.pb.h \ - ../include/mesos/v1/agent/agent.pb.cc \ - ../include/mesos/v1/agent/agent.pb.h \ - ../include/mesos/v1/allocator/allocator.pb.cc \ - ../include/mesos/v1/allocator/allocator.pb.h \ - ../include/mesos/v1/executor/executor.pb.cc \ - ../include/mesos/v1/executor/executor.pb.h \ - ../include/mesos/v1/maintenance/maintenance.pb.cc \ - ../include/mesos/v1/maintenance/maintenance.pb.h \ - ../include/mesos/v1/master/master.pb.cc \ - ../include/mesos/v1/master/master.pb.h \ - ../include/mesos/v1/quota/quota.pb.cc \ - ../include/mesos/v1/quota/quota.pb.h \ - ../include/mesos/v1/resource_provider/resource_provider.pb.cc \ - ../include/mesos/v1/resource_provider/resource_provider.pb.h \ - ../include/mesos/v1/scheduler/scheduler.pb.cc \ - ../include/mesos/v1/scheduler/scheduler.pb.h - -CXX_PROTOS += \ - master/registry.pb.cc \ - master/registry.pb.h \ - messages/flags.pb.cc \ - messages/flags.pb.h \ - messages/messages.pb.cc \ - messages/messages.pb.h \ - resource_provider/registry.pb.cc \ - resource_provider/registry.pb.h \ - resource_provider/state.pb.cc \ - resource_provider/state.pb.h \ - slave/state.pb.cc \ - slave/state.pb.h \ - slave/containerizer/mesos/provisioner/docker/message.pb.cc \ - slave/containerizer/mesos/provisioner/docker/message.pb.h \ - slave/containerizer/mesos/isolators/docker/volume/state.pb.cc \ - slave/containerizer/mesos/isolators/docker/volume/state.pb.h \ - slave/containerizer/mesos/isolators/network/cni/spec.pb.cc \ - slave/containerizer/mesos/isolators/network/cni/spec.pb.h \ - slave/containerizer/mesos/isolators/volume/csi/state.pb.cc \ - slave/containerizer/mesos/isolators/volume/csi/state.pb.h \ - slave/volume_gid_manager/state.pb.cc \ - slave/volume_gid_manager/state.pb.h - -CXX_PROTOS += \ - resource_provider/storage/disk_profile.pb.cc \ - resource_provider/storage/disk_profile.pb.h - -CXX_CSI_PROTOS = \ - ../include/csi/v0/csi.grpc.pb.cc \ - ../include/csi/v0/csi.grpc.pb.h \ - ../include/csi/v0/csi.pb.cc \ - ../include/csi/v0/csi.pb.h \ - ../include/csi/v1/csi.grpc.pb.cc \ - ../include/csi/v1/csi.grpc.pb.h \ - ../include/csi/v1/csi.pb.cc \ - ../include/csi/v1/csi.pb.h \ - csi/state.pb.cc \ - csi/state.pb.h - -CXX_LOG_PROTOS = \ - messages/log.pb.cc \ - messages/log.pb.h - -CXX_STATE_PROTOS = \ - messages/state.pb.cc \ - messages/state.pb.h - -JAVA_PROTOS = \ - java/generated/org/apache/mesos/Protos.java \ - java/generated/org/apache/mesos/executor/Protos.java \ - java/generated/org/apache/mesos/scheduler/Protos.java - -PYTHON_PROTOS = \ - python/interface/src/mesos/interface/mesos_pb2.py - -V1_JAVA_PROTOS = \ - java/generated/org/apache/mesos/v1/Protos.java \ - java/generated/org/apache/mesos/v1/agent/Protos.java \ - java/generated/org/apache/mesos/v1/allocator/Protos.java \ - java/generated/org/apache/mesos/v1/executor/Protos.java \ - java/generated/org/apache/mesos/v1/maintenance/Protos.java \ - java/generated/org/apache/mesos/v1/master/Protos.java \ - java/generated/org/apache/mesos/v1/quota/Protos.java \ - java/generated/org/apache/mesos/v1/resource_provider/Protos.java \ - java/generated/org/apache/mesos/v1/scheduler/Protos.java - -V1_PYTHON_PROTOS = \ - python/interface/src/mesos/v1/interface/agent_pb2.py \ - python/interface/src/mesos/v1/interface/allocator_pb2.py \ - python/interface/src/mesos/v1/interface/executor_pb2.py \ - python/interface/src/mesos/v1/interface/maintenance_pb2.py \ - python/interface/src/mesos/v1/interface/master_pb2.py \ - python/interface/src/mesos/v1/interface/mesos_pb2.py \ - python/interface/src/mesos/v1/interface/quota_pb2.py \ - python/interface/src/mesos/v1/interface/resource_provider_pb2.py \ - python/interface/src/mesos/v1/interface/scheduler_pb2.py - -BUILT_SOURCES += \ - $(CXX_CSI_PROTOS) \ - $(CXX_LOG_PROTOS) \ - $(CXX_PROTOS) \ - $(CXX_STATE_PROTOS) \ - $(JAVA_PROTOS) \ - $(PYTHON_PROTOS) \ - $(V1_JAVA_PROTOS) \ - $(V1_PYTHON_PROTOS) - -CLEANFILES += \ - $(CXX_CSI_PROTOS) \ - $(CXX_LOG_PROTOS) \ - $(CXX_PROTOS) \ - $(CXX_STATE_PROTOS) \ - $(JAVA_PROTOS) \ - $(PYTHON_PROTOS) \ - $(V1_JAVA_PROTOS) \ - $(V1_PYTHON_PROTOS) - - -# Targets for generating C++ protocol buffer and gRPC code. -../include/mesos/%.pb.cc ../include/mesos/%.pb.h: $(top_srcdir)/include/mesos/%.proto - $(PROTOC) $(PROTOCFLAGS) --cpp_out=../include $^ - -%.pb.cc %.pb.h: %.proto - $(PROTOC) $(PROTOCFLAGS) --cpp_out=. $^ - -../include/%.grpc.pb.cc ../include/%.grpc.pb.h ../include/%.pb.cc ../include/%.pb.h: ../$(CSI_V0)/%.proto - $(PROTOC) $(PROTOCFLAGS) --cpp_out=../include --grpc_out=../include \ - --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN) $^ - -../include/%.grpc.pb.cc ../include/%.grpc.pb.h ../include/%.pb.cc ../include/%.pb.h: ../$(CSI_V1)/%.proto - $(PROTOC) $(PROTOCFLAGS) --cpp_out=../include --grpc_out=../include \ - --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN) $^ - -# Targets for generating Java protocol buffer code. -java/generated/org/apache/mesos/executor/Protos.java: $(EXECUTOR_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/fetcher/Protos.java: $(FETCHER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/Protos.java: $(MESOS_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/scheduler/Protos.java: $(SCHEDULER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/agent/Protos.java: $(V1_AGENT_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/allocator/Protos.java: $(V1_ALLOCATOR_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/executor/Protos.java: $(V1_EXECUTOR_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/maintenance/Protos.java: $(V1_MAINTENANCE_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/master/Protos.java: $(V1_MASTER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/Protos.java: $(V1_MESOS_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/quota/Protos.java: $(V1_QUOTA_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/resource_provider/Protos.java: $(V1_RESOURCE_PROVIDER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - -java/generated/org/apache/mesos/v1/scheduler/Protos.java: $(V1_SCHEDULER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) $(PROTOCFLAGS) --java_out=java/generated $^ - - -# Targets for generating Python protocol buffer code. -# NOTE: All python protocol buffer code that imports from mesos.proto -# has to get patched using sed, removing the leading 'mesos.' -# namespace qualifier due to the flat hierachy in the resulting -# mesos.interface egg. See MESOS-1750 for more. -python/interface/src/mesos/interface/executor_pb2.py: $(EXECUTOR_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/executor $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/interface/mesos_pb2.py: $(MESOS_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/interface $^ - -python/interface/src/mesos/interface/scheduler_pb2.py: $(SCHEDULER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/scheduler $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/v1/interface/agent_pb2.py: $(V1_AGENT_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1/agent $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/v1/interface/allocator_pb2.py: $(V1_ALLOCATOR_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1/allocator $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/v1/interface/executor_pb2.py: $(V1_EXECUTOR_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1/executor $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/v1/interface/maintenance_pb2.py: $(V1_MAINTENANCE_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1/maintenance $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/v1/interface/master_pb2.py: $(V1_MASTER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1/master $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/v1/interface/mesos_pb2.py: $(V1_MESOS_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1 $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - -python/interface/src/mesos/v1/interface/quota_pb2.py: $(V1_QUOTA_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1/quota $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/v1/interface/resource_provider_pb2.py: $(V1_RESOURCE_PROVIDER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1/resource_provider $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - -python/interface/src/mesos/v1/interface/scheduler_pb2.py: $(V1_SCHEDULER_PROTO) - $(MKDIR_P) $(@D) - $(PROTOC) -I$(top_srcdir)/include/mesos/v1/scheduler $(PROTOCFLAGS) \ - --python_out=python/interface/src/mesos/v1/interface $^ - $(SED) -i.bak 's/mesos\.mesos_pb2/mesos_pb2/' $@ && rm $@.bak - - -pkginclude_HEADERS = \ - $(top_srcdir)/include/mesos/attributes.hpp \ - $(top_srcdir)/include/mesos/executor.hpp \ - $(top_srcdir)/include/mesos/hook.hpp \ - $(top_srcdir)/include/mesos/http.hpp \ - $(top_srcdir)/include/mesos/mesos.hpp \ - $(top_srcdir)/include/mesos/mesos.proto \ - $(top_srcdir)/include/mesos/module.hpp \ - $(top_srcdir)/include/mesos/resources.hpp \ - $(top_srcdir)/include/mesos/resource_quantities.hpp \ - $(top_srcdir)/include/mesos/roles.hpp \ - $(top_srcdir)/include/mesos/scheduler.hpp \ - $(top_srcdir)/include/mesos/type_utils.hpp \ - $(top_srcdir)/include/mesos/values.hpp - -nodist_pkginclude_HEADERS = \ - ../include/mesos/version.hpp \ - ../include/mesos/mesos.pb.h - -allocatordir = $(pkgincludedir)/allocator - -allocator_HEADERS = \ - $(top_srcdir)/include/mesos/allocator/allocator.hpp \ - $(top_srcdir)/include/mesos/allocator/allocator.proto - -nodist_allocator_HEADERS = \ - ../include/mesos/allocator/allocator.pb.h - -appcdir = $(pkgincludedir)/appc - -appc_HEADERS = \ - $(top_srcdir)/include/mesos/appc/spec.hpp \ - $(top_srcdir)/include/mesos/appc/spec.proto - -nodist_appc_HEADERS = \ - ../include/mesos/appc/spec.pb.h - -authenticationdir = $(pkgincludedir)/authentication - -authentication_HEADERS = \ - $(top_srcdir)/include/mesos/authentication/authenticatee.hpp \ - $(top_srcdir)/include/mesos/authentication/authentication.hpp \ - $(top_srcdir)/include/mesos/authentication/authentication.proto \ - $(top_srcdir)/include/mesos/authentication/authenticator.hpp \ - $(top_srcdir)/include/mesos/authentication/secret_generator.hpp - -nodist_authentication_HEADERS = \ - ../include/mesos/authentication/authentication.pb.h - -httpauthenticationdir = $(pkgincludedir)/authentication/http - -httpauthentication_HEADERS = \ - $(top_srcdir)/include/mesos/authentication/http/authenticatee.hpp \ - $(top_srcdir)/include/mesos/authentication/http/basic_authenticator_factory.hpp \ - $(top_srcdir)/include/mesos/authentication/http/combined_authenticator.hpp - -authorizerdir = $(pkgincludedir)/authorizer - -authorizer_HEADERS = \ - $(top_srcdir)/include/mesos/authorizer/acls.hpp \ - $(top_srcdir)/include/mesos/authorizer/acls.proto \ - $(top_srcdir)/include/mesos/authorizer/authorizer.hpp \ - $(top_srcdir)/include/mesos/authorizer/authorizer.proto - -nodist_authorizer_HEADERS = \ - ../include/mesos/authorizer/acls.pb.h \ - ../include/mesos/authorizer/authorizer.pb.h - -csidir = $(pkgincludedir)/csi - -csi_HEADERS = \ - $(top_srcdir)/include/mesos/csi/v0.hpp \ - $(top_srcdir)/include/mesos/csi/v1.hpp - -# Install the generated CSI headers into $PREFIX/include. -csi_v0dir = $(includedir)/csi/v0 - -nodist_csi_v0_HEADERS = \ - ../include/csi/v0/csi.grpc.pb.h \ - ../include/csi/v0/csi.pb.h - -csi_v1dir = $(includedir)/csi/v1 - -nodist_csi_v1_HEADERS = \ - ../include/csi/v1/csi.grpc.pb.h \ - ../include/csi/v1/csi.pb.h - -dockerdir = $(pkgincludedir)/docker - -docker_HEADERS = \ - $(top_srcdir)/include/mesos/docker/spec.hpp \ - $(top_srcdir)/include/mesos/docker/spec.proto \ - $(top_srcdir)/include/mesos/docker/v1.hpp \ - $(top_srcdir)/include/mesos/docker/v1.proto \ - $(top_srcdir)/include/mesos/docker/v2.hpp \ - $(top_srcdir)/include/mesos/docker/v2.proto \ - $(top_srcdir)/include/mesos/docker/v2_2.hpp \ - $(top_srcdir)/include/mesos/docker/v2_2.proto - -nodist_docker_HEADERS = \ - ../include/mesos/docker/spec.pb.h \ - ../include/mesos/docker/v1.pb.h \ - ../include/mesos/docker/v2.pb.h \ - ../include/mesos/docker/v2_2.pb.h - -executordir = $(pkgincludedir)/executor - -executor_HEADERS = \ - $(top_srcdir)/include/mesos/executor/executor.hpp \ - $(top_srcdir)/include/mesos/executor/executor.proto - -nodist_executor_HEADERS = \ - ../include/mesos/executor/executor.pb.h - -fetcherdir = $(pkgincludedir)/fetcher - -fetcher_HEADERS = \ - $(top_srcdir)/include/mesos/fetcher/fetcher.hpp \ - $(top_srcdir)/include/mesos/fetcher/fetcher.proto - -nodist_fetcher_HEADERS = \ - ../include/mesos/fetcher/fetcher.pb.h - -logdir = $(pkgincludedir)/log - -log_HEADERS = \ - $(top_srcdir)/include/mesos/log/log.hpp - -maintenancedir = $(pkgincludedir)/maintenance - -maintenance_HEADERS = \ - $(top_srcdir)/include/mesos/maintenance/maintenance.hpp \ - $(top_srcdir)/include/mesos/maintenance/maintenance.proto - -nodist_maintenance_HEADERS = \ - ../include/mesos/maintenance/maintenance.pb.h - -masterdir = $(pkgincludedir)/master - -master_HEADERS = \ - $(top_srcdir)/include/mesos/master/contender.hpp \ - $(top_srcdir)/include/mesos/master/detector.hpp \ - $(top_srcdir)/include/mesos/master/master.hpp \ - $(top_srcdir)/include/mesos/master/master.proto - -nodist_master_HEADERS = \ - ../include/mesos/master/master.pb.h - -moduledir = $(pkgincludedir)/module - -module_HEADERS = \ - $(top_srcdir)/include/mesos/module/allocator.hpp \ - $(top_srcdir)/include/mesos/module/anonymous.hpp \ - $(top_srcdir)/include/mesos/module/authenticatee.hpp \ - $(top_srcdir)/include/mesos/module/authenticator.hpp \ - $(top_srcdir)/include/mesos/module/authorizer.hpp \ - $(top_srcdir)/include/mesos/module/container_logger.hpp \ - $(top_srcdir)/include/mesos/module/contender.hpp \ - $(top_srcdir)/include/mesos/module/detector.hpp \ - $(top_srcdir)/include/mesos/module/disk_profile_adaptor.hpp \ - $(top_srcdir)/include/mesos/module/hook.hpp \ - $(top_srcdir)/include/mesos/module/hook.proto \ - $(top_srcdir)/include/mesos/module/http_authenticatee.hpp \ - $(top_srcdir)/include/mesos/module/http_authenticator.hpp \ - $(top_srcdir)/include/mesos/module/isolator.hpp \ - $(top_srcdir)/include/mesos/module/module.hpp \ - $(top_srcdir)/include/mesos/module/module.proto \ - $(top_srcdir)/include/mesos/module/qos_controller.hpp \ - $(top_srcdir)/include/mesos/module/resource_estimator.hpp \ - $(top_srcdir)/include/mesos/module/secret_generator.hpp \ - $(top_srcdir)/include/mesos/module/secret_resolver.hpp - -nodist_module_HEADERS = \ - ../include/mesos/module/hook.pb.h \ - ../include/mesos/module/module.pb.h - -ocidir = $(pkgincludedir)/oci - -oci_HEADERS = \ - $(top_srcdir)/include/mesos/oci/spec.hpp \ - $(top_srcdir)/include/mesos/oci/spec.proto - -nodist_oci_HEADERS = \ - ../include/mesos/oci/spec.pb.h - -quotadir = $(pkgincludedir)/quota - -quota_HEADERS = \ - $(top_srcdir)/include/mesos/quota/quota.hpp \ - $(top_srcdir)/include/mesos/quota/quota.proto - -nodist_quota_HEADERS = \ - ../include/mesos/quota/quota.pb.h - -resourceproviderdir = $(pkgincludedir)/resource_provider - -resourceprovider_HEADERS = \ - $(top_srcdir)/include/mesos/resource_provider/resource_provider.hpp \ - $(top_srcdir)/include/mesos/resource_provider/resource_provider.proto - -nodist_resourceprovider_HEADERS = \ - ../include/mesos/resource_provider/resource_provider.pb.h - -resourceprovider_storagedir = $(pkgincludedir)/resource_provider/storage - -resourceprovider_storage_HEADERS = \ - $(top_srcdir)/include/mesos/resource_provider/storage/disk_profile_adaptor.hpp - -schedulerdir = $(pkgincludedir)/scheduler - -scheduler_HEADERS = \ - $(top_srcdir)/include/mesos/scheduler/scheduler.hpp \ - $(top_srcdir)/include/mesos/scheduler/scheduler.proto - -nodist_scheduler_HEADERS = \ - ../include/mesos/scheduler/scheduler.pb.h - -seccompdir = $(pkgincludedir)/seccomp - -seccomp_HEADERS = \ - $(top_srcdir)/include/mesos/seccomp/seccomp.hpp \ - $(top_srcdir)/include/mesos/seccomp/seccomp.proto - -nodist_seccomp_HEADERS = \ - ../include/mesos/seccomp/seccomp.pb.h - -agentdir = $(pkgincludedir)/agent - -agent_HEADERS = \ - $(top_srcdir)/include/mesos/agent/agent.hpp \ - $(top_srcdir)/include/mesos/agent/agent.proto \ - $(top_srcdir)/include/mesos/slave/container_logger.hpp \ - $(top_srcdir)/include/mesos/slave/containerizer.hpp \ - $(top_srcdir)/include/mesos/slave/isolator.hpp \ - $(top_srcdir)/include/mesos/slave/oversubscription.hpp \ - $(top_srcdir)/include/mesos/slave/oversubscription.proto \ - $(top_srcdir)/include/mesos/slave/qos_controller.hpp \ - $(top_srcdir)/include/mesos/slave/resource_estimator.hpp - -nodist_agent_HEADERS = \ - ../include/mesos/agent/agent.pb.h \ - ../include/mesos/slave/containerizer.pb.h \ - ../include/mesos/slave/oversubscription.pb.h - -secretdir = $(pkgincludedir)/secret - -secret_HEADERS = \ - $(top_srcdir)/include/mesos/secret/resolver.hpp - -statedir = $(pkgincludedir)/state - -state_HEADERS = \ - $(top_srcdir)/include/mesos/state/in_memory.hpp \ - $(top_srcdir)/include/mesos/state/leveldb.hpp \ - $(top_srcdir)/include/mesos/state/log.hpp \ - $(top_srcdir)/include/mesos/state/protobuf.hpp \ - $(top_srcdir)/include/mesos/state/state.hpp \ - $(top_srcdir)/include/mesos/state/state.proto \ - $(top_srcdir)/include/mesos/state/storage.hpp \ - $(top_srcdir)/include/mesos/state/zookeeper.hpp - -nodist_state_HEADERS = \ - ../include/mesos/state/state.pb.h - -uridir = $(pkgincludedir)/uri - -uri_HEADERS = \ - $(top_srcdir)/include/mesos/uri/fetcher.hpp \ - $(top_srcdir)/include/mesos/uri/uri.hpp \ - $(top_srcdir)/include/mesos/uri/uri.proto - -nodist_uri_HEADERS = \ - ../include/mesos/uri/uri.pb.h - -v1dir = $(pkgincludedir)/v1 - -v1_HEADERS = \ - $(top_srcdir)/include/mesos/v1/attributes.hpp \ - $(top_srcdir)/include/mesos/v1/executor.hpp \ - $(top_srcdir)/include/mesos/v1/mesos.hpp \ - $(top_srcdir)/include/mesos/v1/mesos.proto \ - $(top_srcdir)/include/mesos/v1/resources.hpp \ - $(top_srcdir)/include/mesos/v1/resource_provider.hpp \ - $(top_srcdir)/include/mesos/v1/scheduler.hpp \ - $(top_srcdir)/include/mesos/v1/values.hpp - -nodist_v1_HEADERS = \ - ../include/mesos/v1/mesos.pb.h - -v1agentdir = $(pkgincludedir)/v1/agent - -v1agent_HEADERS = \ - $(top_srcdir)/include/mesos/v1/agent/agent.hpp \ - $(top_srcdir)/include/mesos/v1/agent/agent.proto - -nodist_v1agent_HEADERS = \ - ../include/mesos/v1/agent/agent.pb.h - -v1allocatordir = $(pkgincludedir)/v1/allocator - -v1allocator_HEADERS = \ - $(top_srcdir)/include/mesos/v1/allocator/allocator.proto - -nodist_v1allocator_HEADERS = \ - ../include/mesos/v1/allocator/allocator.pb.h - -v1executordir = $(pkgincludedir)/v1/executor - -v1executor_HEADERS = \ - $(top_srcdir)/include/mesos/v1/executor/executor.hpp \ - $(top_srcdir)/include/mesos/v1/executor/executor.proto - -nodist_v1executor_HEADERS = \ - ../include/mesos/v1/executor/executor.pb.h - -v1maintenancedir = $(pkgincludedir)/v1/maintenance - -v1maintenance_HEADERS = \ - $(top_srcdir)/include/mesos/v1/maintenance/maintenance.hpp \ - $(top_srcdir)/include/mesos/v1/maintenance/maintenance.proto - -nodist_v1maintenance_HEADERS = \ - ../include/mesos/v1/maintenance/maintenance.pb.h - -v1masterdir = $(pkgincludedir)/v1/master - -v1master_HEADERS = \ - $(top_srcdir)/include/mesos/v1/master/master.hpp \ - $(top_srcdir)/include/mesos/v1/master/master.proto - -nodist_v1master_HEADERS = \ - ../include/mesos/v1/master/master.pb.h - -v1quotadir = $(pkgincludedir)/v1/quota - -v1quota_HEADERS = \ - $(top_srcdir)/include/mesos/v1/quota/quota.proto - -nodist_v1quota_HEADERS = \ - ../include/mesos/v1/quota/quota.pb.h - -v1resourceproviderdir = $(pkgincludedir)/v1/resource_provider - -v1resourceprovider_HEADERS = \ - $(top_srcdir)/include/mesos/v1/resource_provider/resource_provider.hpp \ - $(top_srcdir)/include/mesos/v1/resource_provider/resource_provider.proto - -nodist_v1resourceprovider_HEADERS = \ - ../include/mesos/v1/resource_provider/resource_provider.pb.h - -v1schedulerdir = $(pkgincludedir)/v1/scheduler - -v1scheduler_HEADERS = \ - $(top_srcdir)/include/mesos/v1/scheduler/scheduler.hpp \ - $(top_srcdir)/include/mesos/v1/scheduler/scheduler.proto - -nodist_v1scheduler_HEADERS = \ - ../include/mesos/v1/scheduler/scheduler.pb.h - -zookeeperdir = $(pkgincludedir)/zookeeper - -zookeeper_HEADERS = \ - $(top_srcdir)/include/mesos/zookeeper/authentication.hpp \ - $(top_srcdir)/include/mesos/zookeeper/contender.hpp \ - $(top_srcdir)/include/mesos/zookeeper/detector.hpp \ - $(top_srcdir)/include/mesos/zookeeper/group.hpp \ - $(top_srcdir)/include/mesos/zookeeper/url.hpp \ - $(top_srcdir)/include/mesos/zookeeper/watcher.hpp \ - $(top_srcdir)/include/mesos/zookeeper/zookeeper.hpp - - -# We even use a convenience library for most of Mesos so that we can -# exclude third party libraries so setuptools can build a -# self-contained Python library and statically link in the third party -# libraries themselves. -noinst_LTLIBRARIES += libmesos_no_3rdparty.la - -nodist_libmesos_no_3rdparty_la_SOURCES = $(CXX_PROTOS) - - -libmesos_no_3rdparty_la_SOURCES = \ - master/registry.proto \ - messages/flags.proto \ - messages/messages.proto \ - resource_provider/registry.proto \ - resource_provider/state.proto \ - slave/state.proto \ - slave/containerizer/mesos/provisioner/docker/message.proto \ - slave/containerizer/mesos/isolators/docker/volume/state.proto \ - slave/containerizer/mesos/isolators/network/cni/spec.proto \ - slave/containerizer/mesos/isolators/volume/csi/state.proto \ - slave/volume_gid_manager/state.proto - -# TODO(tillt): Remove authentication/cram_md5/* which will enable us to -# lose the immediate cyrus-sasl2 dependency. -libmesos_no_3rdparty_la_SOURCES += \ - appc/spec.cpp \ - authentication/cram_md5/authenticatee.cpp \ - authentication/cram_md5/authenticatee.hpp \ - authentication/cram_md5/authenticator.cpp \ - authentication/cram_md5/authenticator.hpp \ - authentication/cram_md5/auxprop.cpp \ - authentication/cram_md5/auxprop.hpp \ - authentication/http/basic_authenticatee.cpp \ - authentication/http/basic_authenticatee.hpp \ - authentication/http/basic_authenticator_factory.cpp \ - authentication/http/combined_authenticator.cpp \ - authorizer/acls.cpp \ - authorizer/authorizer.cpp \ - authorizer/local/authorizer.cpp \ - authorizer/local/authorizer.hpp \ - checks/checker.cpp \ - checks/checker.hpp \ - checks/checker_process.cpp \ - checks/checker_process.hpp \ - checks/checks_runtime.hpp \ - checks/checks_types.hpp \ - checks/health_checker.cpp \ - checks/health_checker.hpp \ - common/attributes.cpp \ - common/authorization.cpp \ - common/authorization.hpp \ - common/build.hpp \ - common/command_utils.cpp \ - common/command_utils.hpp \ - common/domain_sockets.hpp \ - common/future_tracker.hpp \ - common/heartbeater.hpp \ - common/http.cpp \ - common/http.hpp \ - common/kernel_version.cpp \ - common/kernel_version.hpp \ - common/parse.hpp \ - common/protobuf_utils.cpp \ - common/protobuf_utils.hpp \ - common/recordio.hpp \ - common/resources.cpp \ - common/resource_quantities.cpp \ - common/resources_utils.cpp \ - common/resources_utils.hpp \ - common/roles.cpp \ - common/status_utils.hpp \ - common/type_utils_differencers.hpp \ - common/type_utils.cpp \ - common/validation.cpp \ - common/validation.hpp \ - common/values.cpp \ - common/values.hpp \ - credentials/credentials.hpp \ - docker/docker.cpp \ - docker/docker.hpp \ - docker/executor.hpp \ - docker/executor.cpp \ - docker/spec.cpp \ - examples/flags.hpp \ - examples/test_anonymous_module.hpp \ - examples/test_module.hpp \ - examples/utils.hpp \ - exec/exec.cpp \ - executor/executor.cpp \ - executor/v0_v1executor.cpp \ - executor/v0_v1executor.hpp \ - files/files.cpp \ - files/files.hpp \ - hdfs/hdfs.cpp \ - hdfs/hdfs.hpp \ - hook/manager.cpp \ - hook/manager.hpp \ - internal/devolve.cpp \ - internal/devolve.hpp \ - internal/evolve.cpp \ - internal/evolve.hpp \ - local/flags.hpp \ - local/local.cpp \ - local/local.hpp \ - logging/flags.cpp \ - logging/flags.hpp \ - logging/logging.cpp \ - logging/logging.hpp \ - master/allocator/allocator.cpp \ - master/allocator/mesos/allocator.hpp \ - master/allocator/mesos/hierarchical.cpp \ - master/allocator/mesos/hierarchical.hpp \ - master/allocator/mesos/metrics.cpp \ - master/allocator/mesos/metrics.hpp \ - master/allocator/mesos/offer_constraints_filter.cpp \ - master/allocator/mesos/sorter/drf/metrics.cpp \ - master/allocator/mesos/sorter/drf/metrics.hpp \ - master/allocator/mesos/sorter/drf/sorter.cpp \ - master/allocator/mesos/sorter/drf/sorter.hpp \ - master/allocator/mesos/sorter/random/sorter.cpp \ - master/allocator/mesos/sorter/random/sorter.hpp \ - master/allocator/mesos/sorter/random/utils.hpp \ - master/allocator/mesos/sorter/sorter.hpp \ - master/authorization.cpp \ - master/authorization.hpp \ - master/constants.cpp \ - master/constants.hpp \ - master/contender/contender.cpp \ - master/contender/standalone.cpp \ - master/contender/standalone.hpp \ - master/contender/zookeeper.cpp \ - master/contender/zookeeper.hpp \ - master/detector/detector.cpp \ - master/detector/standalone.cpp \ - master/detector/standalone.hpp \ - master/detector/zookeeper.cpp \ - master/detector/zookeeper.hpp \ - master/flags.cpp \ - master/flags.hpp \ - master/framework.cpp \ - master/http.cpp \ - master/machine.hpp \ - master/maintenance.cpp \ - master/maintenance.hpp \ - master/master.cpp \ - master/master.hpp \ - master/metrics.cpp \ - master/metrics.hpp \ - master/quota.cpp \ - master/quota.hpp \ - master/quota_handler.cpp \ - master/readonly_handler.cpp \ - master/registrar.cpp \ - master/registrar.hpp \ - master/registry.hpp \ - master/registry_operations.cpp \ - master/registry_operations.hpp \ - master/validation.cpp \ - master/validation.hpp \ - master/weights.cpp \ - master/weights.hpp \ - master/weights_handler.cpp \ - messages/flags.hpp \ - messages/messages.cpp \ - messages/messages.hpp \ - module/manager.cpp \ - module/manager.hpp \ - oci/spec.cpp \ - posix/rlimits.cpp \ - posix/rlimits.hpp \ - resource_provider/constants.hpp \ - resource_provider/daemon.cpp \ - resource_provider/daemon.hpp \ - resource_provider/detector.cpp \ - resource_provider/detector.hpp \ - resource_provider/driver.cpp \ - resource_provider/http_connection.hpp \ - resource_provider/local.cpp \ - resource_provider/local.hpp \ - resource_provider/manager.cpp \ - resource_provider/manager.hpp \ - resource_provider/message.hpp \ - resource_provider/registrar.cpp \ - resource_provider/registrar.hpp \ - resource_provider/registry.hpp \ - resource_provider/state.hpp \ - resource_provider/validation.cpp \ - resource_provider/validation.hpp \ - sched/constants.hpp \ - sched/flags.hpp \ - sched/sched.cpp \ - scheduler/constants.hpp \ - scheduler/flags.hpp \ - scheduler/scheduler.cpp \ - secret/resolver.cpp \ - slave/compatibility.cpp \ - slave/compatibility.hpp \ - slave/constants.cpp \ - slave/constants.hpp \ - slave/container_daemon.cpp \ - slave/container_daemon.hpp \ - slave/container_daemon_process.hpp \ - slave/container_logger.cpp \ - slave/csi_server.cpp \ - slave/csi_server.hpp \ - slave/container_loggers/sandbox.cpp \ - slave/container_loggers/sandbox.hpp \ - slave/containerizer/composing.cpp \ - slave/containerizer/composing.hpp \ - slave/containerizer/containerizer.cpp \ - slave/containerizer/containerizer.hpp \ - slave/containerizer/docker.cpp \ - slave/containerizer/docker.hpp \ - slave/containerizer/fetcher.cpp \ - slave/containerizer/fetcher.hpp \ - slave/containerizer/fetcher_process.hpp \ - slave/containerizer/mesos/constants.hpp \ - slave/containerizer/mesos/containerizer.cpp \ - slave/containerizer/mesos/containerizer.hpp \ - slave/containerizer/mesos/io/switchboard.cpp \ - slave/containerizer/mesos/io/switchboard.hpp \ - slave/containerizer/mesos/isolator.cpp \ - slave/containerizer/mesos/isolator.hpp \ - slave/containerizer/mesos/isolator_tracker.cpp \ - slave/containerizer/mesos/isolator_tracker.hpp \ - slave/containerizer/mesos/isolators/docker/volume/driver.cpp \ - slave/containerizer/mesos/isolators/docker/volume/driver.hpp \ - slave/containerizer/mesos/isolators/docker/volume/paths.cpp \ - slave/containerizer/mesos/isolators/docker/volume/paths.hpp \ - slave/containerizer/mesos/isolators/docker/volume/state.hpp \ - slave/containerizer/mesos/isolators/environment_secret.cpp \ - slave/containerizer/mesos/isolators/environment_secret.hpp \ - slave/containerizer/mesos/isolators/filesystem/posix.cpp \ - slave/containerizer/mesos/isolators/filesystem/posix.hpp \ - slave/containerizer/mesos/isolators/filesystem/windows.hpp \ - slave/containerizer/mesos/isolators/network/cni/paths.cpp \ - slave/containerizer/mesos/isolators/network/cni/paths.hpp \ - slave/containerizer/mesos/isolators/network/cni/spec.cpp \ - slave/containerizer/mesos/isolators/network/cni/spec.hpp \ - slave/containerizer/mesos/isolators/posix.hpp \ - slave/containerizer/mesos/isolators/posix/disk.cpp \ - slave/containerizer/mesos/isolators/posix/disk.hpp \ - slave/containerizer/mesos/isolators/posix/rlimits.cpp \ - slave/containerizer/mesos/isolators/posix/rlimits.hpp \ - slave/containerizer/mesos/isolators/volume/sandbox_path.cpp \ - slave/containerizer/mesos/isolators/volume/sandbox_path.hpp \ - slave/containerizer/mesos/isolators/volume/csi/paths.cpp \ - slave/containerizer/mesos/isolators/volume/csi/paths.hpp \ - slave/containerizer/mesos/isolators/volume/csi/state.hpp \ - slave/containerizer/mesos/isolators/windows/cpu.hpp \ - slave/containerizer/mesos/isolators/windows/mem.hpp \ - slave/containerizer/mesos/launch.cpp \ - slave/containerizer/mesos/launch.hpp \ - slave/containerizer/mesos/launcher.cpp \ - slave/containerizer/mesos/launcher.hpp \ - slave/containerizer/mesos/launcher_tracker.cpp \ - slave/containerizer/mesos/launcher_tracker.hpp \ - slave/containerizer/mesos/mount.cpp \ - slave/containerizer/mesos/mount.hpp \ - slave/containerizer/mesos/paths.cpp \ - slave/containerizer/mesos/paths.hpp \ - slave/containerizer/mesos/provisioner/appc/cache.cpp \ - slave/containerizer/mesos/provisioner/appc/cache.hpp \ - slave/containerizer/mesos/provisioner/appc/fetcher.cpp \ - slave/containerizer/mesos/provisioner/appc/fetcher.hpp \ - slave/containerizer/mesos/provisioner/appc/paths.cpp \ - slave/containerizer/mesos/provisioner/appc/paths.hpp \ - slave/containerizer/mesos/provisioner/appc/store.cpp \ - slave/containerizer/mesos/provisioner/appc/store.hpp \ - slave/containerizer/mesos/provisioner/backend.cpp \ - slave/containerizer/mesos/provisioner/backend.hpp \ - slave/containerizer/mesos/provisioner/backends/copy.cpp \ - slave/containerizer/mesos/provisioner/backends/copy.hpp \ - slave/containerizer/mesos/provisioner/constants.hpp \ - slave/containerizer/mesos/provisioner/docker/image_tar_puller.cpp \ - slave/containerizer/mesos/provisioner/docker/image_tar_puller.hpp \ - slave/containerizer/mesos/provisioner/docker/message.hpp \ - slave/containerizer/mesos/provisioner/docker/metadata_manager.cpp \ - slave/containerizer/mesos/provisioner/docker/metadata_manager.hpp \ - slave/containerizer/mesos/provisioner/docker/paths.cpp \ - slave/containerizer/mesos/provisioner/docker/paths.hpp \ - slave/containerizer/mesos/provisioner/docker/puller.cpp \ - slave/containerizer/mesos/provisioner/docker/puller.hpp \ - slave/containerizer/mesos/provisioner/docker/registry_puller.cpp \ - slave/containerizer/mesos/provisioner/docker/registry_puller.hpp \ - slave/containerizer/mesos/provisioner/docker/store.cpp \ - slave/containerizer/mesos/provisioner/docker/store.hpp \ - slave/containerizer/mesos/provisioner/paths.cpp \ - slave/containerizer/mesos/provisioner/paths.hpp \ - slave/containerizer/mesos/provisioner/provisioner.cpp \ - slave/containerizer/mesos/provisioner/provisioner.hpp \ - slave/containerizer/mesos/provisioner/store.cpp \ - slave/containerizer/mesos/provisioner/store.hpp \ - slave/containerizer/mesos/provisioner/utils.cpp \ - slave/containerizer/mesos/provisioner/utils.hpp \ - slave/containerizer/mesos/utils.cpp \ - slave/containerizer/mesos/utils.hpp \ - slave/flags.cpp \ - slave/flags.hpp \ - slave/gc.cpp \ - slave/gc.hpp \ - slave/gc_process.hpp \ - slave/http.cpp \ - slave/http.hpp \ - slave/metrics.cpp \ - slave/metrics.hpp \ - slave/paths.cpp \ - slave/paths.hpp \ - slave/posix_signalhandler.hpp \ - slave/qos_controller.cpp \ - slave/qos_controllers/noop.cpp \ - slave/qos_controllers/noop.hpp \ - slave/resource_estimator.cpp \ - slave/resource_estimators/noop.cpp \ - slave/resource_estimators/noop.hpp \ - slave/slave.cpp \ - slave/slave.hpp \ - slave/state.cpp \ - slave/state.hpp \ - slave/task_status_update_manager.cpp \ - slave/task_status_update_manager.hpp \ - slave/validation.cpp \ - slave/validation.hpp \ - slave/volume_gid_manager/state.hpp \ - slave/volume_gid_manager/volume_gid_manager.cpp \ - slave/volume_gid_manager/volume_gid_manager.hpp \ - slave/windows_ctrlhandler.hpp \ - status_update_manager/operation.cpp \ - status_update_manager/operation.hpp \ - status_update_manager/status_update_manager_process.hpp \ - uri/fetcher.cpp \ - uri/fetcher.hpp \ - uri/fetchers/copy.cpp \ - uri/fetchers/copy.hpp \ - uri/fetchers/curl.cpp \ - uri/fetchers/curl.hpp \ - uri/fetchers/docker.cpp \ - uri/fetchers/docker.hpp \ - uri/fetchers/hadoop.cpp \ - uri/fetchers/hadoop.hpp \ - uri/schemes/docker.hpp \ - uri/schemes/file.hpp \ - uri/schemes/hdfs.hpp \ - uri/schemes/http.hpp \ - uri/utils.cpp \ - uri/utils.hpp \ - usage/usage.cpp \ - usage/usage.hpp \ - v1/attributes.cpp \ - v1/mesos.cpp \ - v1/parse.hpp \ - v1/resources.cpp \ - v1/values.cpp \ - version/version.cpp \ - version/version.hpp \ - watcher/whitelist_watcher.cpp \ - watcher/whitelist_watcher.hpp \ - zookeeper/authentication.cpp \ - zookeeper/contender.cpp \ - zookeeper/detector.cpp \ - zookeeper/group.cpp \ - zookeeper/zookeeper.cpp - -MESOS_LINUX_FILES = \ - linux/capabilities.cpp \ - linux/capabilities.hpp \ - linux/cgroups.cpp \ - linux/cgroups.hpp \ - linux/fs.cpp \ - linux/fs.hpp \ - linux/ldcache.cpp \ - linux/ldcache.hpp \ - linux/ldd.cpp \ - linux/ldd.hpp \ - linux/ns.cpp \ - linux/ns.hpp \ - linux/perf.cpp \ - linux/perf.hpp \ - linux/sched.hpp \ - linux/systemd.cpp \ - linux/systemd.hpp \ - slave/containerizer/mesos/linux_launcher.cpp \ - slave/containerizer/mesos/linux_launcher.hpp \ - slave/containerizer/mesos/isolators/appc/runtime.cpp \ - slave/containerizer/mesos/isolators/appc/runtime.hpp \ - slave/containerizer/mesos/isolators/cgroups/cgroups.cpp \ - slave/containerizer/mesos/isolators/cgroups/cgroups.hpp \ - slave/containerizer/mesos/isolators/cgroups/constants.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystem.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystem.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/blkio.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/cpu.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/cpu.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/cpuacct.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/cpuacct.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/cpuset.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/devices.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/hugetlb.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/memory.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/net_cls.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/net_cls.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/net_prio.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/perf_event.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/perf_event.hpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/pids.cpp \ - slave/containerizer/mesos/isolators/cgroups/subsystems/pids.hpp \ - slave/containerizer/mesos/isolators/docker/runtime.cpp \ - slave/containerizer/mesos/isolators/docker/runtime.hpp \ - slave/containerizer/mesos/isolators/docker/volume/isolator.cpp \ - slave/containerizer/mesos/isolators/docker/volume/isolator.hpp \ - slave/containerizer/mesos/isolators/filesystem/linux.cpp \ - slave/containerizer/mesos/isolators/filesystem/linux.hpp \ - slave/containerizer/mesos/isolators/filesystem/shared.cpp \ - slave/containerizer/mesos/isolators/filesystem/shared.hpp \ - slave/containerizer/mesos/isolators/gpu/allocator.cpp \ - slave/containerizer/mesos/isolators/gpu/allocator.hpp \ - slave/containerizer/mesos/isolators/gpu/components.hpp \ - slave/containerizer/mesos/isolators/gpu/isolator.cpp \ - slave/containerizer/mesos/isolators/gpu/isolator.hpp \ - slave/containerizer/mesos/isolators/gpu/nvidia.hpp \ - slave/containerizer/mesos/isolators/gpu/nvml.cpp \ - slave/containerizer/mesos/isolators/gpu/nvml.hpp \ - slave/containerizer/mesos/isolators/gpu/volume.cpp \ - slave/containerizer/mesos/isolators/gpu/volume.hpp \ - slave/containerizer/mesos/isolators/linux/capabilities.cpp \ - slave/containerizer/mesos/isolators/linux/capabilities.hpp \ - slave/containerizer/mesos/isolators/linux/devices.cpp \ - slave/containerizer/mesos/isolators/linux/devices.hpp \ - slave/containerizer/mesos/isolators/linux/nnp.hpp \ - slave/containerizer/mesos/isolators/linux/nnp.cpp \ - slave/containerizer/mesos/isolators/namespaces/ipc.cpp \ - slave/containerizer/mesos/isolators/namespaces/ipc.hpp \ - slave/containerizer/mesos/isolators/namespaces/pid.cpp \ - slave/containerizer/mesos/isolators/namespaces/pid.hpp \ - slave/containerizer/mesos/isolators/network/cni/cni.cpp \ - slave/containerizer/mesos/isolators/network/cni/cni.hpp \ - slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.cpp \ - slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.hpp \ - slave/containerizer/mesos/isolators/volume/host_path.cpp \ - slave/containerizer/mesos/isolators/volume/host_path.hpp \ - slave/containerizer/mesos/isolators/volume/image.cpp \ - slave/containerizer/mesos/isolators/volume/image.hpp \ - slave/containerizer/mesos/isolators/volume/secret.cpp \ - slave/containerizer/mesos/isolators/volume/secret.hpp \ - slave/containerizer/mesos/isolators/volume/utils.cpp \ - slave/containerizer/mesos/isolators/volume/utils.hpp \ - slave/containerizer/mesos/isolators/volume/csi/isolator.cpp \ - slave/containerizer/mesos/isolators/volume/csi/isolator.hpp \ - slave/containerizer/mesos/provisioner/backends/aufs.cpp \ - slave/containerizer/mesos/provisioner/backends/aufs.hpp \ - slave/containerizer/mesos/provisioner/backends/bind.cpp \ - slave/containerizer/mesos/provisioner/backends/bind.hpp \ - slave/containerizer/mesos/provisioner/backends/overlay.cpp \ - slave/containerizer/mesos/provisioner/backends/overlay.hpp - -if ENABLE_XFS_DISK_ISOLATOR -MESOS_LINUX_FILES += \ - slave/containerizer/mesos/isolators/xfs/utils.cpp \ - slave/containerizer/mesos/isolators/xfs/utils.hpp \ - slave/containerizer/mesos/isolators/xfs/disk.cpp \ - slave/containerizer/mesos/isolators/xfs/disk.hpp -endif - -if ENABLE_CGROUPS_V2 -MESOS_LINUX_FILES += \ - linux/cgroups2.cpp \ - linux/cgroups2.hpp \ - linux/ebpf.cpp \ - linux/ebpf.hpp -endif - -if ENABLE_SECCOMP_ISOLATOR -MESOS_LINUX_FILES += \ - linux/seccomp/seccomp.cpp \ - linux/seccomp/seccomp.hpp \ - linux/seccomp/seccomp_parser.cpp \ - linux/seccomp/seccomp_parser.hpp \ - slave/containerizer/mesos/isolators/linux/seccomp.cpp \ - slave/containerizer/mesos/isolators/linux/seccomp.hpp -endif - -if ENABLE_LAUNCHER_SEALING -MESOS_LINUX_FILES += \ - linux/memfd.cpp \ - linux/memfd.hpp -endif - -if ENABLE_LINUX_ROUTING -MESOS_LINUX_FILES += \ - linux/routing/handle.cpp \ - linux/routing/handle.hpp \ - linux/routing/internal.hpp \ - linux/routing/route.cpp \ - linux/routing/route.hpp \ - linux/routing/utils.cpp \ - linux/routing/utils.hpp \ - linux/routing/diagnosis/diagnosis.cpp \ - linux/routing/diagnosis/diagnosis.hpp \ - linux/routing/filter/action.hpp \ - linux/routing/filter/basic.cpp \ - linux/routing/filter/basic.hpp \ - linux/routing/filter/filter.hpp \ - linux/routing/filter/handle.hpp \ - linux/routing/filter/icmp.cpp \ - linux/routing/filter/icmp.hpp \ - linux/routing/filter/internal.hpp \ - linux/routing/filter/ip.cpp \ - linux/routing/filter/ip.hpp \ - linux/routing/filter/priority.hpp \ - linux/routing/link/internal.hpp \ - linux/routing/link/link.cpp \ - linux/routing/link/link.hpp \ - linux/routing/link/veth.cpp \ - linux/routing/link/veth.hpp \ - linux/routing/queueing/discipline.hpp \ - linux/routing/queueing/fq_codel.cpp \ - linux/routing/queueing/fq_codel.hpp \ - linux/routing/queueing/htb.cpp \ - linux/routing/queueing/htb.hpp \ - linux/routing/queueing/ingress.cpp \ - linux/routing/queueing/ingress.hpp \ - linux/routing/queueing/internal.hpp \ - linux/routing/queueing/statistics.hpp -endif - -if ENABLE_NETWORK_PORTS_ISOLATOR -MESOS_LINUX_FILES += \ - slave/containerizer/mesos/isolators/network/ports.cpp \ - slave/containerizer/mesos/isolators/network/ports.hpp -endif - -if ENABLE_PORT_MAPPING_ISOLATOR -MESOS_LINUX_FILES += \ - slave/containerizer/mesos/isolators/network/port_mapping.hpp \ - slave/containerizer/mesos/isolators/network/port_mapping.cpp -endif - -if OS_LINUX -libmesos_no_3rdparty_la_SOURCES += $(MESOS_LINUX_FILES) -else -EXTRA_DIST += $(MESOS_LINUX_FILES) -endif - -if ENABLE_SSL -libmesos_no_3rdparty_la_SOURCES += \ - authentication/executor/jwt_secret_generator.cpp \ - authentication/executor/jwt_secret_generator.hpp -endif - -libmesos_no_3rdparty_la_SOURCES += \ - resource_provider/storage/disk_profile_adaptor.cpp \ - resource_provider/storage/disk_profile.proto \ - resource_provider/storage/disk_profile_utils.cpp \ - resource_provider/storage/disk_profile_utils.hpp \ - resource_provider/storage/provider.cpp \ - resource_provider/storage/provider.hpp - -libmesos_no_3rdparty_la_CPPFLAGS = $(MESOS_CPPFLAGS) - -libmesos_no_3rdparty_la_LIBADD = # Initialized to enable using +=. - -# Convenience library that *always* gets rebuilt to ensure accurate info. -noinst_LTLIBRARIES += libbuild.la -libbuild_la_SOURCES = \ - common/build.cpp \ - common/git_version.hpp -libbuild_la_CPPFLAGS = $(AM_CPPFLAGS) -libbuild_la_CPPFLAGS += $(MESOS_CPPFLAGS) -libbuild_la_CPPFLAGS += -DBUILD_DATE="\"$$(date '+%Y-%m-%d %H:%M:%S')\"" -libbuild_la_CPPFLAGS += -DBUILD_TIME="\"$$(date '+%s')\"" -libbuild_la_CPPFLAGS += -DBUILD_USER="\"$$USER\"" -libbuild_la_CPPFLAGS += -DBUILD_JAVA_JVM_LIBRARY=\"$(JAVA_JVM_LIBRARY)\" - -# We need to escape the build flags properly. -BUILD_FLAGS = $(echo $(MESOS_CPPFLAGS) $(CPPFLAGS) | $(SED) 's/\"/\\\"/g') \ - $(echo $(AM_CFLAGS) $(CFLAGS) | $(SED) 's/\"/\\\"/g') \ - $(echo $(AM_CXXFLAGS) $(CXXFLAGS) | $(SED) 's/\"/\\\"/g') - -EXTRA_DIST += common/git_version.hpp.in - -# TODO(benh): Provide other build flags. - -libbuild_la_CPPFLAGS += -DBUILD_FLAGS="\"$$BUILD_FLAGS\"" - -libmesos_no_3rdparty_la_LIBADD += libbuild.la - - -# Convenience library for build the CSI client. -noinst_LTLIBRARIES += libcsi.la -libcsi_la_SOURCES = \ - csi/constants.hpp \ - csi/metrics.cpp \ - csi/metrics.hpp \ - csi/paths.cpp \ - csi/paths.hpp \ - csi/service_manager.cpp \ - csi/service_manager.hpp \ - csi/state.hpp \ - csi/state.proto \ - csi/v0.cpp \ - csi/v0_client.cpp \ - csi/v0_client.hpp \ - csi/v0_utils.cpp \ - csi/v0_utils.hpp \ - csi/v0_volume_manager.cpp \ - csi/v0_volume_manager.hpp \ - csi/v0_volume_manager_process.hpp \ - csi/v1.cpp \ - csi/v1_client.cpp \ - csi/v1_client.hpp \ - csi/v1_utils.cpp \ - csi/v1_utils.hpp \ - csi/v1_volume_manager.cpp \ - csi/v1_volume_manager.hpp \ - csi/v1_volume_manager_process.hpp \ - csi/volume_manager.cpp \ - csi/volume_manager.hpp - -nodist_libcsi_la_SOURCES = $(CXX_CSI_PROTOS) -libcsi_la_CPPFLAGS = $(MESOS_CPPFLAGS) - -libmesos_no_3rdparty_la_LIBADD += libcsi.la - - -# Convenience library for building the replicated log in order to -# include the leveldb headers. -noinst_LTLIBRARIES += liblog.la -liblog_la_SOURCES = \ - log/catchup.cpp \ - log/catchup.hpp \ - log/consensus.cpp \ - log/consensus.hpp \ - log/coordinator.cpp \ - log/coordinator.hpp \ - log/leveldb.cpp \ - log/leveldb.hpp \ - log/log.cpp \ - log/log.hpp \ - log/metrics.cpp \ - log/metrics.hpp \ - log/network.hpp \ - log/recover.cpp \ - log/recover.hpp \ - log/replica.cpp \ - log/replica.hpp \ - log/storage.hpp \ - log/tool/benchmark.cpp \ - log/tool/benchmark.hpp \ - log/tool.hpp \ - log/tool/initialize.cpp \ - log/tool/initialize.hpp \ - log/tool/read.cpp \ - log/tool/read.hpp \ - log/tool/replica.cpp \ - log/tool/replica.hpp \ - messages/log.hpp \ - messages/log.proto - -nodist_liblog_la_SOURCES = $(CXX_LOG_PROTOS) -liblog_la_CPPFLAGS = $(MESOS_CPPFLAGS) - -libmesos_no_3rdparty_la_LIBADD += liblog.la - - -# Convenience library for building "state" abstraction in order to -# include the leveldb headers. -noinst_LTLIBRARIES += libstate.la -libstate_la_SOURCES = \ - messages/state.hpp \ - messages/state.proto \ - state/in_memory.cpp \ - state/leveldb.cpp \ - state/log.cpp \ - state/zookeeper.cpp - -nodist_libstate_la_SOURCES = $(CXX_STATE_PROTOS) -libstate_la_CPPFLAGS = $(MESOS_CPPFLAGS) - -libmesos_no_3rdparty_la_LIBADD += libstate.la - - -# The final result! -lib_LTLIBRARIES += libmesos.la - -# Include as part of the distribution. -libmesos_la_SOURCES = \ - $(ACLS_PROTO) \ - $(AGENT_PROTO) \ - $(ALLOCATOR_PROTO) \ - $(APPC_SPEC_PROTO) \ - $(AUTHENTICATION_PROTO) \ - $(AUTHORIZATION_PROTO) \ - $(CONTAINERIZER_PROTO) \ - $(EXECUTOR_PROTO) \ - $(DOCKER_SPEC_PROTO) \ - $(DOCKER_V1_PROTO) \ - $(DOCKER_V2_PROTO) \ - $(DOCKER_V2_2_PROTO) \ - $(FETCHER_PROTO) \ - $(HOOK_PROTO) \ - $(MAINTENANCE_PROTO) \ - $(MASTER_PROTO) \ - $(MESOS_PROTO) \ - $(MODULE_PROTO) \ - $(OCI_SPEC_PROTO) \ - $(OVERSUBSCRIPTION_PROTO) \ - $(QUOTA_PROTO) \ - $(RESOURCE_PROVIDER_PROTO) \ - $(SCHEDULER_PROTO) \ - $(SECCOMP_PROTO) \ - $(STATE_PROTO) \ - $(URI_PROTO) \ - $(V1_AGENT_PROTO) \ - $(V1_ALLOCATOR_PROTO) \ - $(V1_EXECUTOR_PROTO) \ - $(V1_MAINTENANCE_PROTO) \ - $(V1_MASTER_PROTO) \ - $(V1_MESOS_PROTO) \ - $(V1_QUOTA_PROTO) \ - $(V1_RESOURCE_PROVIDER_PROTO) \ - $(V1_SCHEDULER_PROTO) - -libmesos_la_LDFLAGS = -release $(PACKAGE_VERSION) - -# Since we just include the convenience library (and no sources), we -# need to tell libtool to build this as a C++ library. -libmesos_la_LIBTOOLFLAGS = --tag=CXX - -# Add the convenience library. -libmesos_la_LIBADD = \ - libmesos_no_3rdparty.la \ - $(LIB_GLOG) \ - $(LIB_GRPC) \ - $(LIB_LEVELDB) \ - $(LIB_LIBARCHIVE) \ - $(LIB_PROCESS) \ - $(LIB_PROTOBUF) \ - $(LIB_LIBSECCOMP) \ - $(LIB_RE2) \ - $(LIB_ZOOKEEPER) \ - -lsvn_subr-1 \ - -lsvn_delta-1 \ - -lapr-1 - - -# Binaries. -sbin_PROGRAMS += mesos-agent -mesos_agent_SOURCES = slave/main.cpp -mesos_agent_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_agent_LDADD = libmesos.la $(LDADD) - -sbin_PROGRAMS += mesos-master -mesos_master_SOURCES = master/main.cpp -mesos_master_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_master_LDADD = libmesos.la $(LDADD) - -bin_PROGRAMS += mesos-local -mesos_local_SOURCES = local/main.cpp -mesos_local_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_local_LDADD = libmesos.la $(LDADD) - -if ENABLE_JEMALLOC_ALLOCATOR -mesos_agent_LDADD += $(LIB_JEMALLOC) -mesos_master_LDADD += $(LIB_JEMALLOC) -endif - -pkglibexec_PROGRAMS += mesos-fetcher -mesos_fetcher_SOURCES = launcher/fetcher.cpp -mesos_fetcher_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_fetcher_LDADD = libmesos.la $(LDADD) - -pkglibexec_PROGRAMS += mesos-executor -mesos_executor_SOURCES = launcher/executor.cpp -mesos_executor_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_executor_LDADD = libmesos.la $(LDADD) - -pkglibexec_PROGRAMS += mesos-default-executor -mesos_default_executor_SOURCES = \ - launcher/default_executor.cpp -mesos_default_executor_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_default_executor_LDADD = libmesos.la $(LDADD) - -pkglibexec_PROGRAMS += mesos-containerizer -mesos_containerizer_SOURCES = slave/containerizer/mesos/main.cpp -mesos_containerizer_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_containerizer_LDADD = libmesos.la $(LDADD) - -if OS_LINUX -pkglibexec_PROGRAMS += mesos-cni-port-mapper -mesos_cni_port_mapper_SOURCES = \ - slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/main.cpp -mesos_cni_port_mapper_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_cni_port_mapper_LDADD = libmesos.la $(LDADD) -endif - -pkglibexec_PROGRAMS += mesos-logrotate-logger -mesos_logrotate_logger_SOURCES = \ - slave/container_loggers/logrotate.hpp \ - slave/container_loggers/logrotate.cpp -mesos_logrotate_logger_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_logrotate_logger_LDADD = libmesos.la $(LDADD) - -pkglibexec_PROGRAMS += mesos-io-switchboard -mesos_io_switchboard_SOURCES = \ - slave/containerizer/mesos/io/switchboard_main.cpp -mesos_io_switchboard_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_io_switchboard_LDADD = libmesos.la $(LDADD) - -if ENABLE_PORT_MAPPING_ISOLATOR -pkglibexec_PROGRAMS += mesos-network-helper -mesos_network_helper_SOURCES = slave/containerizer/mesos/isolators/network/helper.cpp -mesos_network_helper_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_network_helper_LDADD = libmesos.la $(LDADD) -endif - -pkglibexec_PROGRAMS += mesos-usage -mesos_usage_SOURCES = usage/main.cpp -mesos_usage_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_usage_LDADD = libmesos.la $(LDADD) - -pkglibexec_PROGRAMS += mesos-docker-executor -mesos_docker_executor_SOURCES = launcher/docker_executor.cpp -mesos_docker_executor_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_docker_executor_LDADD = libmesos.la $(LDADD) - -pkglibexec_PROGRAMS += mesos-tcp-connect -mesos_tcp_connect_SOURCES = checks/tcp_connect.cpp -mesos_tcp_connect_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_tcp_connect_LDADD = libmesos.la $(LDADD) - -bin_PROGRAMS += mesos-log -mesos_log_SOURCES = log/main.cpp -mesos_log_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_log_LDADD = libmesos.la $(LDADD) - -bin_PROGRAMS += mesos-execute -mesos_execute_SOURCES = cli/execute.cpp -mesos_execute_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_execute_LDADD = libmesos.la $(LDADD) - -bin_PROGRAMS += mesos-resolve -mesos_resolve_SOURCES = cli/resolve.cpp -mesos_resolve_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_resolve_LDADD = libmesos.la $(LDADD) - -bin_PROGRAMS += mesos - -NEW_CLI_PLUGINS = \ - python/cli_new/lib/cli/plugins/agent/__init__.py \ - python/cli_new/lib/cli/plugins/agent/main.py \ - python/cli_new/lib/cli/plugins/config/__init__.py \ - python/cli_new/lib/cli/plugins/config/main.py \ - python/cli_new/lib/cli/plugins/task/__init__.py \ - python/cli_new/lib/cli/plugins/task/main.py \ - python/cli_new/lib/cli/plugins/__init__.py \ - python/cli_new/lib/cli/plugins/base.py - -NEW_CLI = \ - python/cli_new/bin/main.py \ - python/cli_new/bin/mesos \ - python/cli_new/bin/mesos-cli-tests \ - python/cli_new/bin/settings.py \ - python/cli_new/activate \ - python/cli_new/deactivate \ - python/cli_new/lib/cli/__init__.py \ - python/cli_new/lib/cli/constants.py \ - python/cli_new/lib/cli/tests/tests.py \ - python/cli_new/lib/cli/tests/__init__.py \ - python/cli_new/lib/cli/tests/agent.py \ - python/cli_new/lib/cli/tests/base.py \ - python/cli_new/lib/cli/tests/constants.py \ - python/cli_new/lib/cli/tests/data/lorem-ipsum.txt \ - python/cli_new/lib/cli/tests/task.py \ - python/cli_new/lib/cli/config.py \ - python/cli_new/lib/cli/docopt.py \ - python/cli_new/lib/cli/exceptions.py \ - python/cli_new/lib/cli/http.py \ - python/cli_new/lib/cli/mesos.py \ - python/cli_new/lib/cli/util.py \ - python/cli_new/mesos.bash_completion \ - python/cli_new/tests/default_config.toml \ - python/cli_new/tests/CMakeLists.txt \ - python/cli_new/tests/__init__.py \ - python/cli_new/tests/main.py \ - python/cli_new/CMakeLists.txt \ - python/cli_new/README.md \ - python/cli_new/bootstrap \ - python/cli_new/pip-requirements.txt - -if ENABLE_NEW_CLI -MESOS_CLI_SRCDIR = $(srcdir)/python/cli_new -MESOS_CLI_BUILDDIR = $(builddir)/cli - -mesos: $(shell git ls-files $(MESOS_CLI_SRCDIR)) - @echo "Building the CLI ..." - VIRTUALENV_DIRECTORY=$(builddir)/.virtualenv \ - PYTHON=$(PYTHON_3) \ - $(MESOS_CLI_SRCDIR)/bootstrap && \ - echo "VERSION = \"$(PACKAGE_VERSION)\"" \ - > $(MESOS_CLI_BUILDDIR)/version.py && \ - source $(builddir)/.virtualenv/bin/activate && \ - pyinstaller -p $(MESOS_CLI_SRCDIR)/lib \ - $(NEW_CLI_PLUGINS) \ - --specpath $(MESOS_CLI_BUILDDIR) \ - --workpath $(MESOS_CLI_BUILDDIR)/work \ - --distpath $(builddir) \ - --name $(@) \ - --noconfirm \ - --onefile \ - $(MESOS_CLI_SRCDIR)/bin/main.py -check_PROGRAMS += mesos - -EXTRA_DIST += cli/mesos.cpp - -else -mesos_SOURCES = cli/mesos.cpp -mesos_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_LDADD = libmesos.la $(LDADD) - -# Need to distribute and install mesos-*. -dist_bin_SCRIPTS += \ - cli/mesos-cat \ - cli/mesos-ps \ - cli/mesos-scp \ - cli/mesos-tail -endif - -EXTRA_DIST += \ - $(NEW_CLI) \ - $(NEW_CLI_PLUGINS) \ - python/lib/mesos/__init__.py \ - python/lib/mesos/exceptions.py \ - python/lib/mesos/http.py \ - python/lib/mesos/recordio.py \ - python/lib/tests/__init__.py \ - python/lib/tests/conftest.py \ - python/lib/tests/test_exceptions.py \ - python/lib/tests/test_http.py \ - python/lib/tests/test_mesos.py \ - python/lib/tests/test_recordio.py \ - python/lib/requirements.in \ - python/lib/setup.py - -# Need to distribute/install webui javascript. We use 'pkgdatadir' -# instead of 'datadir' as the install directory so we get the -# package name (i.e., 'mesos') as part of the path (i.e., -# /path/to/mesos/webui versus something like /path/to/webui). Note -# that 'datadir' (e.g., /usr/local/share) is for read-only "data" and -# 'sysconfdir' (e.g., /usr/local/var) is for modifiable "data". -nobase_dist_pkgdata_DATA += \ - webui/app/app.js \ - webui/app/controllers.js \ - webui/app/services.js - -# Need to distribute/install webui CSS. -nobase_dist_pkgdata_DATA += \ - webui/assets/css/bootstrap-3.3.6.min.css \ - webui/assets/css/bootstrap-table-1.11.1.min.css\ - webui/assets/css/mesos.css - -# Need to distribute/install webui HTML. -nobase_dist_pkgdata_DATA += \ - webui/index.html \ - webui/app/home.html \ - webui/app/agents/agent.html \ - webui/app/agents/agent-browse.html \ - webui/app/agents/agent-executor.html \ - webui/app/agents/agent-framework.html \ - webui/app/agents/agents.html \ - webui/app/frameworks/framework.html \ - webui/app/frameworks/frameworks.html \ - webui/app/frameworks/roles.html \ - webui/app/frameworks/roles-tree.html \ - webui/app/frameworks/roles-tree-root.html \ - webui/app/maintenance/maintenance.html \ - webui/app/offers/offers.html \ - webui/app/roles/roles.html \ - webui/app/shared/pagination.html \ - webui/app/shared/pailer.html \ - webui/app/shared/table-header.html \ - webui/app/shared/timestamp.html - -# Need to distribute/install webui images. -nobase_dist_pkgdata_DATA += \ - webui/assets/ico/favicon.ico \ - webui/assets/img/loading.gif \ - webui/assets/img/mesos-logo.png - -# Need to distribute/install webui fonts. -nobase_dist_pkgdata_DATA += \ - webui/assets/fonts/glyphicons-halflings-regular.eot \ - webui/assets/fonts/glyphicons-halflings-regular.svg \ - webui/assets/fonts/glyphicons-halflings-regular.ttf \ - webui/assets/fonts/glyphicons-halflings-regular.woff \ - webui/assets/fonts/glyphicons-halflings-regular.woff2 - -# Need to distribute/install third-party javascript. -nobase_dist_pkgdata_DATA += \ - webui/assets/libs/angular-1.2.32.min.js \ - webui/assets/libs/angular-route-1.2.32.min.js \ - webui/assets/libs/bootstrap-table-1.11.1.min.js \ - webui/assets/libs/clipboard-1.5.16.min.js \ - webui/assets/libs/jquery-3.6.0.min.js \ - webui/assets/libs/jquery.pailer.js \ - webui/assets/libs/relative-date.js \ - webui/assets/libs/ui-bootstrap-tpls-0.9.0.min.js \ - webui/assets/libs/underscore-1.4.3.min.js - -# And the deploy related stuff. -nodist_sbin_SCRIPTS += \ - deploy/mesos-daemon.sh \ - deploy/mesos-start-agents.sh \ - deploy/mesos-start-cluster.sh \ - deploy/mesos-start-masters.sh \ - deploy/mesos-start-slaves.sh \ - deploy/mesos-stop-agents.sh \ - deploy/mesos-stop-cluster.sh \ - deploy/mesos-stop-masters.sh \ - deploy/mesos-stop-slaves.sh - -pkgsysconf_DATA += \ - deploy/mesos-agent-env.sh.template \ - deploy/mesos-deploy-env.sh.template \ - deploy/mesos-master-env.sh.template - -# Need to explicitly add this because by default DATA files are not -# included in distributions. -EXTRA_DIST += \ - deploy/mesos-agent-env.sh.template \ - deploy/mesos-deploy-env.sh.template \ - deploy/mesos-master-env.sh.template - -# Java related files are listed outside if HAS_JAVA so we can add them -# to EXTRA_DIST unconditionally. - -# Mesos JAR. -MESOS_JAR = java/target/mesos-$(PACKAGE_VERSION).jar -MESOS_JAR_SOURCE = \ - $(srcdir)/java/src/org/apache/mesos/ExecutorDriver.java \ - $(srcdir)/java/src/org/apache/mesos/Executor.java \ - $(srcdir)/java/src/org/apache/mesos/Log.java \ - $(srcdir)/java/src/org/apache/mesos/MesosExecutorDriver.java \ - $(srcdir)/java/src/org/apache/mesos/MesosSchedulerDriver.java \ - $(srcdir)/java/src/org/apache/mesos/SchedulerDriver.java \ - $(srcdir)/java/src/org/apache/mesos/Scheduler.java \ - $(srcdir)/java/src/org/apache/mesos/state/AbstractState.java \ - $(srcdir)/java/src/org/apache/mesos/state/InMemoryState.java \ - $(srcdir)/java/src/org/apache/mesos/state/LevelDBState.java \ - $(srcdir)/java/src/org/apache/mesos/state/LogState.java \ - $(srcdir)/java/src/org/apache/mesos/state/State.java \ - $(srcdir)/java/src/org/apache/mesos/state/Variable.java \ - $(srcdir)/java/src/org/apache/mesos/state/ZooKeeperState.java \ - $(srcdir)/java/src/org/apache/mesos/v1/scheduler/V1Mesos.java \ - $(srcdir)/java/src/org/apache/mesos/v1/scheduler/Mesos.java \ - $(srcdir)/java/src/org/apache/mesos/v1/scheduler/Scheduler.java \ - $(srcdir)/java/src/org/apache/mesos/v1/scheduler/V0Mesos.java -MESOS_JAR_GENERATED = $(JAVA_PROTOS) $(V1_JAVA_PROTOS) \ - java/generated/org/apache/mesos/MesosNativeLibrary.java -EXTRA_DIST += $(MESOS_JAR_SOURCE) \ - $(srcdir)/java/generated/org/apache/mesos/MesosNativeLibrary.java.in - -# We build all the Java examples into their own JAR. -EXAMPLES_JAR = examples.jar -EXAMPLES_SOURCE = \ - $(srcdir)/examples/java/TestExceptionFramework.java \ - $(srcdir)/examples/java/TestExecutor.java \ - $(srcdir)/examples/java/TestFramework.java \ - $(srcdir)/examples/java/TestLog.java \ - $(srcdir)/examples/java/TestMultipleExecutorsFramework.java \ - $(srcdir)/examples/java/V1TestFramework.java -EXTRA_DIST += $(EXAMPLES_SOURCE) - - -if HAS_JAVA - -$(MESOS_JAR): $(MESOS_JAR_SOURCE) $(MESOS_JAR_GENERATED) java/mesos.pom - @echo "Building mesos-$(PACKAGE_VERSION).jar ..." - @cd $(abs_top_builddir)/src/java && \ - env JAVA_HOME=$(JAVA_HOME) $(MVN) -B -q -f mesos.pom clean package - -# Convenience library for JNI bindings. -# TODO(Charles Reiss): We really should be building the Java library -# with -module, which means it should be a different library than the -# main libmesos.so. -noinst_LTLIBRARIES += libjava.la - -libjava_la_SOURCES = \ - java/jni/convert.cpp \ - java/jni/convert.hpp \ - java/jni/construct.cpp \ - java/jni/construct.hpp \ - java/jni/org_apache_mesos_Log.cpp \ - java/jni/org_apache_mesos_MesosExecutorDriver.cpp \ - java/jni/org_apache_mesos_MesosNativeLibrary.cpp \ - java/jni/org_apache_mesos_MesosSchedulerDriver.cpp \ - java/jni/org_apache_mesos_state_AbstractState.cpp \ - java/jni/org_apache_mesos_state_LevelDBState.cpp \ - java/jni/org_apache_mesos_state_LogState.cpp \ - java/jni/org_apache_mesos_state_Variable.cpp \ - java/jni/org_apache_mesos_state_ZooKeeperState.cpp \ - java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp \ - java/jni/org_apache_mesos_v1_scheduler_V0Mesos.cpp \ - jvm/jvm.cpp \ - jvm/jvm.hpp \ - jvm/java/io.hpp \ - jvm/java/lang.hpp \ - jvm/java/net.hpp \ - jvm/org/apache/log4j.cpp \ - jvm/org/apache/log4j.hpp \ - jvm/org/apache/zookeeper.cpp \ - jvm/org/apache/zookeeper.hpp - -libjava_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libjava_la_CPPFLAGS += $(JAVA_CPPFLAGS) -libjava_la_CPPFLAGS += -I$(srcdir)/java/jni -Ijava/jni - -libjava_la_DEPENDENCIES = \ - $(MESOS_PROTO) \ - $(V1_AGENT_PROTO) \ - $(V1_ALLOCATOR_PROTO) \ - $(V1_EXECUTOR_PROTO) \ - $(V1_MAINTENANCE_PROTO) \ - $(V1_MASTER_PROTO) \ - $(V1_MESOS_PROTO) \ - $(V1_QUOTA_PROTO) \ - $(V1_RESOURCE_PROVIDER_PROTO) \ - $(V1_SCHEDULER_PROTO) - -# We don't add libjava.la to libmesos_no_3rdparty.la so we don't -# include the JNI bindings in the Python egg (but we might want to -# reconsider this in the future). -libmesos_la_LIBADD += libjava.la - -# We need to generate the JNI header files before we build the sources -# and the easiest way to do that with autotools is with the -# BUILT_SOURCES mechanism. The downside of this is that a user cannot -# run 'make libjava.la' (or any target that uses BUILT_SOURCES) but -# that should not matter as libjava.la is just a convenience library -# and should not get exposed. - -nodist_libjava_la_SOURCES = \ - java/jni/org_apache_mesos_Log.h \ - java/jni/org_apache_mesos_MesosExecutorDriver.h \ - java/jni/org_apache_mesos_MesosSchedulerDriver.h \ - java/jni/org_apache_mesos_state_AbstractState.h \ - java/jni/org_apache_mesos_state_LevelDBState.h \ - java/jni/org_apache_mesos_state_LogState.h \ - java/jni/org_apache_mesos_state_Variable.h \ - java/jni/org_apache_mesos_state_ZooKeeperState.h \ - java/jni/org_apache_mesos_v1_scheduler_V1Mesos.h \ - java/jni/org_apache_mesos_v1_scheduler_V0Mesos.h - -BUILT_SOURCES += $(nodist_libjava_la_SOURCES) - -# The automatic variable '$(*F)' captures the matching stem (whatever matches -# the '%') of the target (e.g., 'org_apache_mesos_Log'). -# * For 'javah' recipe, we then substitute '_' with '.' to get the class name -# (e.g., org.apache.mesos.Log). -# * For 'javac -h' recipe, we substitute '_' with '/' to compute the source path -# of the java file. Unlike 'javah', 'javac -h' requires java sources to -# generate headers. -# -# NOTE: javah has a race between concurrent runs trying to create -# the same output directory: -# http://hg.openjdk.java.net/jdk8/jdk8/langtools/file/1ff9d5118aae/src/share/classes/com/sun/tools/javah/JavahTask.java#l475 -# Thus, we have to create the output directory here. -# -# TODO(asekretenko): Replace `javah` (deprecated as of JDK 9+) -# with `javac` when switching to a newer JDK. -java/jni/%.h: $(MESOS_JAR) - mkdir -p java/jni -if HAS_JAVAH - $(JAVA_HOME)/bin/javah -d java/jni \ - -classpath $(MESOS_JAR):@PROTOBUF_JAR@ \ - $(subst _,.,$(*F)) -else - $(JAVA_HOME)/bin/javac -h java/jni \ - -classpath $(MESOS_JAR):@PROTOBUF_JAR@ \ - $(srcdir)/java/src/$(subst _,/,$(*F)).java -endif - -$(EXAMPLES_JAR): $(EXAMPLES_SOURCE) - @echo "Building examples.jar ..." - $(MKDIR_P) examples/java - $(JAVA_HOME)/bin/javac -source 1.6 -target 1.6 \ - -cp ../$(ZOOKEEPER_JAR):@PROTOBUF_JAR@:$(MESOS_JAR):$(srcdir)/examples/java \ - -sourcepath $(srcdir)/examples/java -d examples/java \ - $(srcdir)/examples/java/*.java - $(JAVA_HOME)/bin/jar cf $@ -C examples/java . - -CLEANFILES += $(EXAMPLES_JAR) - -maven-install: $(MESOS_JAR) java/mesos.pom - env JAVA_HOME=$(JAVA_HOME) $(MVN) -B -q -f java/mesos.pom install - -PHONY_TARGETS += maven-install -endif # HAS_JAVA - -clean-java: - -rm -rf java/target - -rm -f examples/java/*.class - -rm -f java/jni/org_apache_mesos*.h - -PHONY_TARGETS += clean-java - - -# Python files listed outside HAS_PYTHON so they are included with the -# distribution unconditionally. -PYTHON_SOURCE = \ - python/cli/src/mesos/__init__.py \ - python/cli/src/mesos/cli.py \ - python/cli/src/mesos/futures.py \ - python/cli/src/mesos/http.py \ - python/interface/src/mesos/__init__.py \ - python/interface/src/mesos/interface/__init__.py \ - python/interface/src/mesos/v1/__init__.py \ - python/interface/src/mesos/v1/interface/__init__.py \ - python/native_common/common.hpp \ - python/native/src/mesos/__init__.py \ - python/native/src/mesos/native/__init__.py \ - python/executor/src/mesos/__init__.py \ - python/executor/src/mesos/executor/__init__.py \ - python/executor/src/mesos/executor/mesos_executor_driver_impl.cpp \ - python/executor/src/mesos/executor/mesos_executor_driver_impl.hpp \ - python/executor/src/mesos/executor/module.cpp \ - python/executor/src/mesos/executor/proxy_executor.cpp \ - python/executor/src/mesos/executor/proxy_executor.hpp \ - python/scheduler/src/mesos/__init__.py \ - python/scheduler/src/mesos/scheduler/__init__.py \ - python/scheduler/src/mesos/scheduler/mesos_scheduler_driver_impl.cpp \ - python/scheduler/src/mesos/scheduler/mesos_scheduler_driver_impl.hpp \ - python/scheduler/src/mesos/scheduler/module.cpp \ - python/scheduler/src/mesos/scheduler/proxy_scheduler.cpp \ - python/scheduler/src/mesos/scheduler/proxy_scheduler.hpp \ - python/src/mesos/__init__.py - -EXTRA_DIST += $(PYTHON_SOURCE) - -if HAS_PYTHON - -if WITH_BUNDLED_PROTOBUF -# Build a protobuf Python egg. -PROTOBUF_EGG_SUFFIX = $(PROTOBUF_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg -PROTOBUF_EGG = ../$(PROTOBUF)/python/dist/protobuf-$(PROTOBUF_EGG_SUFFIX) - -$(PROTOBUF_EGG): - @echo "Building protobuf Python egg ..." - cd ../$(PROTOBUF)/python && \ - CC="$(CC)" \ - CXX="$(CXX)" \ - CFLAGS="$(CFLAGS)" \ - CXXFLAGS="$(CXXFLAGS)" \ - PYTHONPATH=$(abs_top_builddir)/$(SETUPTOOLS) \ - $(PYTHON) setup.py build bdist_egg - -CLEANFILES += $(PROTOBUF_EGG) -endif - -# This builds the mesos.native egg against libmesos_no_3rdparty.a that is -# self-contained. It currently depends on the libraries in 3rdparty -# being built as .a's. (If this is changed, the setup.py will need to -# be edited). - -# TODO(Charles Reiss): Figure out how to do a proper out-of-source -# build of these Python eggs. Right now we copy the entire source -# directories into the build directory. - -# TODO(Charles Reiss): Additionally support building and installing -# Python libraries that link against the system libmesos.so. This -# should be the default mode if we eventually are able to rely on -# system versions of our dependencies (since we won't be able to -# create a standalone egg anyways). - -PHONY_TARGETS += $(PYTHON_SOURCE) - -$(PYTHON_SOURCE): - test "$(top_srcdir)" = "$(top_builddir)" || \ - ($(MKDIR_P) $(@D) && cp -pf $(srcdir)/$@ $@) - -# We currently require both eggs and wheels to be built. Eggs can be added to -# the PYTHONPATH and imported. These end up being used for the tests. Wheels -# can be easily uninstalled. They end up being what gets installed/uninstalled. -MESOS_EGGS = \ - python/dist/mesos-$(PACKAGE_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg \ - python/dist/mesos.cli-$(PACKAGE_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg \ - python/dist/mesos.executor-$(PACKAGE_VERSION)$(PYTHON_EGG_POSTFIX).egg \ - python/dist/mesos.interface-$(PACKAGE_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg \ - python/dist/mesos.native-$(PACKAGE_VERSION)$(PYTHON_EGG_PUREPY_POSTFIX).egg \ - python/dist/mesos.scheduler-$(PACKAGE_VERSION)$(PYTHON_EGG_POSTFIX).egg - -MESOS_WHLS = \ - python/dist/mesos-$(PACKAGE_VERSION)$(PYTHON_WHL_PUREPY_POSTFIX).whl \ - python/dist/mesos.cli-$(PACKAGE_VERSION)$(PYTHON_WHL_PUREPY_POSTFIX).whl \ - python/dist/mesos.executor-$(PACKAGE_VERSION)$(PYTHON_WHL_POSTFIX).whl \ - python/dist/mesos.interface-$(PACKAGE_VERSION)$(PYTHON_WHL_PUREPY_POSTFIX).whl \ - python/dist/mesos.native-$(PACKAGE_VERSION)$(PYTHON_WHL_PUREPY_POSTFIX).whl \ - python/dist/mesos.scheduler-$(PACKAGE_VERSION)$(PYTHON_WHL_POSTFIX).whl - -# The python source is in directories of the form: python/interface. The make -# target is of the form: python/dist/mesos.interface-0.20.0-py2.7.egg. To build -# this, we must first cd into it. The first line of this takes the make target -# and converts it into the correct directory path. -$(MESOS_EGGS) $(MESOS_WHLS): \ - $(PYTHON_PROTOS) \ - $(V1_PYTHON_PROTOS) \ - $(PYTHON_SOURCE) \ - libmesos_no_3rdparty.la \ - $(PROTOBUF_EGG) - @cd python/`echo $@ | awk -F"mesos[.]?" '{print $$2}' | cut -d- -f1` && \ - LIBS="$(LIBS)" CC="$(CC)" CXX="$(CXX)" \ - CFLAGS="$(PYTHON_CFLAGS)" CPPFLAGS="$(PYTHON_CPPFLAGS)" \ - LDFLAGS="$(PYTHON_LDFLAGS)" \ - PYTHONPATH=$(abs_top_builddir)/$(SETUPTOOLS):$(abs_top_builddir)/$(WHEEL) \ - $(PYTHON) setup.py bdist_egg --dist-dir=$(abs_top_builddir)/src/python/dist \ - bdist_wheel --dist-dir=$(abs_top_builddir)/src/python/dist - -CLEANFILES += $(MESOS_EGGS) $(MESOS_WHLS) python/*/build python/*/dist $(PYTHON_SOURCE) - -pippythonpath = $(DESTDIR)$(pythondir):$(abs_top_builddir)/$(SETUPTOOLS):$(abs_top_builddir)/$(PIP):$(abs_top_builddir)/$(WHEEL) - -# Some python installations create their own distutils.cfg (homebrew, redhat). -# This includes `prefix=` which overrides anything set via. pip during install. -# The file is required to ensure the python packages get installed to the right -# location. It only affects files installed from the python/dist directory. -python/dist/setup.cfg: - printf "[install]\nprefix=\n" > $@ - -# See the comment next to AM_DISTCHECK_CONFIGURE_FLAGS in the top level -# Makefile.am for an explanation of this variable. -pipinstallargs= - -if !ENABLE_PYTHON_DEPENDENCY_INSTALL -pipinstallargs += --no-deps -endif - -# We are using the 3rdparty bundled pip instead of relying on what might exist -# on the system. Because the actual pip scripts have not been created, we just -# use the standard entry point. -install-exec-local: - cd python/dist && \ - for whl in $(MESOS_WHLS); do \ - PYTHONPATH=$(pippythonpath) \ - PYTHONUSERBASE=$(DESTDIR)$(prefix) \ - $(PYTHON) -c "import pip; pip.main()" install \ - --user $(pipinstallargs) \ - --ignore-installed \ - --find-links=file://$(abs_top_builddir)/src/python/dist \ - $(abs_top_builddir)/src/$$whl; \ - done - -uninstall-local: - for whl in $(MESOS_WHLS); do \ - PYTHONPATH=$(DESTDIR)$(pythondir):$(pippythonpath) \ - $(PYTHON) -c "import pip; pip.main()" uninstall \ - --yes $$(echo $$whl | cut -d/ -f3 | cut -d- -f1); \ - done - -# Make sure the egg gets built via 'make all'. -all-local: $(MESOS_EGGS) -endif # HAS_PYTHON - -clean-python: - -find python \( -name "build" -o -name "dist" -o -name "*.pyc" \ - -o -name "*.egg-info" \) -exec rm -rf '{}' \+ - -PHONY_TARGETS += clean-python - -# Test (make check) binaries. -check_PROGRAMS += dynamic-reservation-framework -dynamic_reservation_framework_SOURCES = examples/dynamic_reservation_framework.cpp -dynamic_reservation_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -dynamic_reservation_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += test-http-framework -test_http_framework_SOURCES = examples/test_http_framework.cpp -test_http_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -test_http_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += test-csi-user-framework -test_csi_user_framework_SOURCES = examples/test_csi_user_framework.cpp -test_csi_user_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -test_csi_user_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += test-framework -test_framework_SOURCES = examples/test_framework.cpp -test_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -test_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += test-executor -test_executor_SOURCES = examples/test_executor.cpp -test_executor_CPPFLAGS = $(MESOS_CPPFLAGS) -test_executor_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += test-http-executor -test_http_executor_SOURCES = examples/test_http_executor.cpp -test_http_executor_CPPFLAGS = $(MESOS_CPPFLAGS) -test_http_executor_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += operation-feedback-framework -operation_feedback_framework_SOURCES = examples/operation_feedback_framework.cpp -operation_feedback_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -operation_feedback_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += long-lived-framework -long_lived_framework_SOURCES = examples/long_lived_framework.cpp -long_lived_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -long_lived_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += long-lived-executor -long_lived_executor_SOURCES = examples/long_lived_executor.cpp -long_lived_executor_CPPFLAGS = $(MESOS_CPPFLAGS) -long_lived_executor_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += no-executor-framework -no_executor_framework_SOURCES = examples/no_executor_framework.cpp -no_executor_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -no_executor_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += docker-no-executor-framework -docker_no_executor_framework_SOURCES = examples/docker_no_executor_framework.cpp -docker_no_executor_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -docker_no_executor_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += balloon-framework -balloon_framework_SOURCES = examples/balloon_framework.cpp -balloon_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -balloon_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += balloon-executor -balloon_executor_SOURCES = examples/balloon_executor.cpp -balloon_executor_CPPFLAGS = $(MESOS_CPPFLAGS) -balloon_executor_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += inverse-offer-framework -inverse_offer_framework_SOURCES = examples/inverse_offer_framework.cpp -inverse_offer_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -inverse_offer_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += load-generator-framework -load_generator_framework_SOURCES = examples/load_generator_framework.cpp -load_generator_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -load_generator_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += persistent-volume-framework -persistent_volume_framework_SOURCES = examples/persistent_volume_framework.cpp -persistent_volume_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -persistent_volume_framework_LDADD = libmesos.la $(LDADD) - -check_PROGRAMS += disk-full-framework -disk_full_framework_SOURCES = examples/disk_full_framework.cpp -disk_full_framework_CPPFLAGS = $(MESOS_CPPFLAGS) -disk_full_framework_LDADD = libmesos.la $(LDADD) - -if OS_LINUX -check_PROGRAMS += test-csi-plugin -test_csi_plugin_SOURCES = examples/test_csi_plugin.cpp -test_csi_plugin_CPPFLAGS = $(MESOS_CPPFLAGS) -test_csi_plugin_LDADD = libmesos.la $(LIB_PROTOBUF) $(LIB_GRPC) $(LDADD) -endif - -check_PROGRAMS += test-helper -test_helper_SOURCES = \ - tests/active_user_test_helper.cpp \ - tests/flags.cpp \ - tests/http_server_test_helper.cpp \ - tests/kill_policy_test_helper.cpp \ - tests/resources_utils.cpp \ - tests/test_helper_main.cpp \ - tests/utils.cpp \ - tests/containerizer/memory_test_helper.cpp -if OS_LINUX -test_helper_SOURCES += \ - tests/containerizer/capabilities_test_helper.cpp \ - tests/containerizer/setns_test_helper.cpp -endif -test_helper_CPPFLAGS = $(mesos_tests_CPPFLAGS) -test_helper_LDADD = libmesos.la $(mesos_tests_LDADD) - -check_PROGRAMS += mesos-tests - -# LDFLAGS to be used for the module libraries. -MESOS_MODULE_LDFLAGS = -release $(PACKAGE_VERSION) -shared - -# Library containing the logrotate container logger. -pkgmodule_LTLIBRARIES += liblogrotate_container_logger.la -liblogrotate_container_logger_la_SOURCES = \ - slave/container_loggers/logrotate.hpp \ - slave/container_loggers/lib_logrotate.hpp \ - slave/container_loggers/lib_logrotate.cpp -liblogrotate_container_logger_la_CPPFLAGS = $(MESOS_CPPFLAGS) -liblogrotate_container_logger_la_LDFLAGS = $(MESOS_MODULE_LDFLAGS) - -# Library containing the fixed resource estimator. -pkgmodule_LTLIBRARIES += libfixed_resource_estimator.la -libfixed_resource_estimator_la_SOURCES = slave/resource_estimators/fixed.cpp -libfixed_resource_estimator_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libfixed_resource_estimator_la_LDFLAGS = $(MESOS_MODULE_LDFLAGS) - -# Library containing the load qos controller. -pkgmodule_LTLIBRARIES += libload_qos_controller.la -libload_qos_controller_la_SOURCES = slave/qos_controllers/load.hpp -libload_qos_controller_la_SOURCES += slave/qos_controllers/load.cpp -libload_qos_controller_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libload_qos_controller_la_LDFLAGS = $(MESOS_MODULE_LDFLAGS) - -# Library containing the URI disk profile adaptor module. -pkgmodule_LTLIBRARIES += liburi_disk_profile_adaptor.la -liburi_disk_profile_adaptor_la_SOURCES = \ - resource_provider/storage/uri_disk_profile_adaptor.cpp \ - resource_provider/storage/uri_disk_profile_adaptor.hpp \ - resource_provider/storage/disk_profile_utils.hpp -liburi_disk_profile_adaptor_la_CPPFLAGS = $(MESOS_CPPFLAGS) -liburi_disk_profile_adaptor_la_LDFLAGS = $(MESOS_MODULE_LDFLAGS) - -MESOS_TEST_MODULE_LDFLAGS = $(MESOS_MODULE_LDFLAGS) - -# Even if we are not installing the test suite, we still need to build -# the test module libraries as shared libraries for running the test suite. -# When we use the 'noinst_' prefix to ensure these libraries are not -# installed, automake skips building the shared libraries. The workaround is -# to use '-rpath /nowhere' to force libtool to always build shared libraries. -if !INSTALL_TESTS -MESOS_TEST_MODULE_LDFLAGS += -rpath /nowhere -endif - -MESOS_TEST_MODULES = \ - libexamplemodule.la \ - libtestallocator.la \ - libtestanonymous.la \ - libtestauthentication.la \ - libtestauthorizer.la \ - libtestcontainer_logger.la \ - libtesthook.la \ - libtesthttpauthenticator.la \ - libtestisolator.la \ - libtestmastercontender.la \ - libtestmasterdetector.la \ - libtestqos_controller.la \ - libtestresource_estimator.la - -# Library containing an example module. -libexamplemodule_la_SOURCES = examples/example_module_impl.cpp -libexamplemodule_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libexamplemodule_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing the test anonymous modules. -libtestanonymous_la_SOURCES = examples/test_anonymous_module.cpp -libtestanonymous_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestanonymous_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing the test CRAM-MD5 authentication modules. -# TODO(tillt): Add cyrus-sasl2 dependency while removing it from libmesos. -# TODO(tillt): Enable optional building of this module library. -libtestauthentication_la_SOURCES = examples/test_authentication_modules.cpp -libtestauthentication_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestauthentication_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing the test authorizer module. -libtestauthorizer_la_SOURCES = examples/test_authorizer_module.cpp -libtestauthorizer_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestauthorizer_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing the test http authenticator module. -libtesthttpauthenticator_la_SOURCES = examples/test_http_authenticator_module.cpp -libtesthttpauthenticator_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtesthttpauthenticator_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing the test DRF allocator module. -libtestallocator_la_SOURCES = examples/test_allocator_module.cpp -libtestallocator_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestallocator_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing example test sandbox container logger module. -libtestcontainer_logger_la_SOURCES = \ - examples/test_container_logger_module.cpp -libtestcontainer_logger_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestcontainer_logger_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing the test contender module. -libtestmastercontender_la_SOURCES = examples/test_master_contender_module.cpp -libtestmastercontender_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestmastercontender_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing the test detector module. -libtestmasterdetector_la_SOURCES = examples/test_master_detector_module.cpp -libtestmasterdetector_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestmasterdetector_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing test Hook module. -libtesthook_la_SOURCES = examples/test_hook_module.cpp -libtesthook_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtesthook_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing test CPU and memory isolator modules. -libtestisolator_la_SOURCES = examples/test_isolator_module.cpp -libtestisolator_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestisolator_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing example test noop resource estimator module. -libtestresource_estimator_la_SOURCES = \ - examples/test_resource_estimator_module.cpp -libtestresource_estimator_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestresource_estimator_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -# Library containing example test noop qos controller module. -libtestqos_controller_la_SOURCES = \ - examples/test_qos_controller_module.cpp -libtestqos_controller_la_CPPFLAGS = $(MESOS_CPPFLAGS) -libtestqos_controller_la_LDFLAGS = $(MESOS_TEST_MODULE_LDFLAGS) - -if INSTALL_TESTS -pkgmodule_LTLIBRARIES += $(MESOS_TEST_MODULES) -else -noinst_LTLIBRARIES += $(MESOS_TEST_MODULES) -endif - -mesos_tests_SOURCES = \ - slave/qos_controllers/load.cpp \ - tests/active_user_test_helper.cpp \ - tests/active_user_test_helper.hpp \ - tests/agent_container_api_tests.cpp \ - tests/agent_operation_feedback_tests.cpp \ - tests/allocator.cpp \ - tests/allocator.hpp \ - tests/anonymous_tests.cpp \ - tests/api_tests.cpp \ - tests/attributes_tests.cpp \ - tests/authentication_tests.cpp \ - tests/authorization_tests.cpp \ - tests/check_tests.cpp \ - tests/cluster.cpp \ - tests/cluster.hpp \ - tests/command_executor_tests.cpp \ - tests/common_validation_tests.cpp \ - tests/consumption_metrics_tests.cpp \ - tests/container_daemon_tests.cpp \ - tests/container_logger_tests.cpp \ - tests/containerizer.cpp \ - tests/containerizer.hpp \ - tests/cram_md5_authentication_tests.cpp \ - tests/credentials_tests.cpp \ - tests/csi_client_tests.cpp \ - tests/csi_utils_tests.cpp \ - tests/default_executor_tests.cpp \ - tests/disk_profile_adaptor_tests.cpp \ - tests/disk_profile_server.hpp \ - tests/disk_quota_tests.cpp \ - tests/dynamic_weights_tests.cpp \ - tests/environment.cpp \ - tests/environment.hpp \ - tests/examples_tests.cpp \ - tests/exception_tests.cpp \ - tests/executor_http_api_tests.cpp \ - tests/fault_tolerance_tests.cpp \ - tests/fetcher_cache_tests.cpp \ - tests/fetcher_tests.cpp \ - tests/files_tests.cpp \ - tests/flags.cpp \ - tests/flags.hpp \ - tests/gc_tests.cpp \ - tests/hdfs_tests.cpp \ - tests/health_check_tests.cpp \ - tests/hierarchical_allocator_benchmarks.cpp \ - tests/hierarchical_allocator_tests.cpp \ - tests/hook_tests.cpp \ - tests/http_authentication_tests.cpp \ - tests/http_fault_tolerance_tests.cpp \ - tests/http_server_test_helper.cpp \ - tests/http_server_test_helper.hpp \ - tests/kill_policy_test_helper.cpp \ - tests/kill_policy_test_helper.hpp \ - tests/limiter.hpp \ - tests/log_tests.cpp \ - tests/logging_tests.cpp \ - tests/main.cpp \ - tests/master_allocator_tests.cpp \ - tests/master_authorization_tests.cpp \ - tests/master_benchmarks.cpp \ - tests/master_contender_detector_tests.cpp \ - tests/master_draining_tests.cpp \ - tests/master_load_tests.cpp \ - tests/master_maintenance_tests.cpp \ - tests/master_quota_tests.cpp \ - tests/master_slave_reconciliation_tests.cpp \ - tests/master_tests.cpp \ - tests/master/mock_master_api_subscriber.cpp \ - tests/master/mock_master_api_subscriber.hpp \ - tests/master/offer_constraints_filter_tests.cpp \ - tests/master/update_framework_tests.cpp \ - tests/master_validation_tests.cpp \ - tests/mesos.cpp \ - tests/mesos.hpp \ - tests/metrics_tests.cpp \ - tests/mock_csi_plugin.cpp \ - tests/mock_csi_plugin.hpp \ - tests/mock_docker.cpp \ - tests/mock_docker.hpp \ - tests/mock_fetcher.cpp \ - tests/mock_fetcher.hpp \ - tests/mock_registrar.cpp \ - tests/mock_registrar.hpp \ - tests/mock_slave.cpp \ - tests/mock_slave.hpp \ - tests/module.cpp \ - tests/module.hpp \ - tests/module_tests.cpp \ - tests/operation_reconciliation_tests.cpp \ - tests/operation_status_update_manager_tests.cpp \ - tests/oversubscription_tests.cpp \ - tests/partition_tests.cpp \ - tests/paths_tests.cpp \ - tests/persistent_volume_endpoints_tests.cpp \ - tests/persistent_volume_tests.cpp \ - tests/protobuf_io_tests.cpp \ - tests/protobuf_utils_tests.cpp \ - tests/rate_limiting_tests.cpp \ - tests/reconciliation_tests.cpp \ - tests/registrar_tests.cpp \ - tests/reservation_endpoints_tests.cpp \ - tests/reservation_tests.cpp \ - tests/resource_offers_tests.cpp \ - tests/resource_provider_manager_tests.cpp \ - tests/resource_provider_validation_tests.cpp \ - tests/resource_quantities_tests.cpp \ - tests/resources_tests.cpp \ - tests/resources_utils.cpp \ - tests/resources_utils.hpp \ - tests/role_tests.cpp \ - tests/scheduler_driver_tests.cpp \ - tests/scheduler_event_call_tests.cpp \ - tests/scheduler_http_api_tests.cpp \ - tests/scheduler_tests.cpp \ - tests/script.cpp \ - tests/script.hpp \ - tests/slave_authorization_tests.cpp \ - tests/slave_compatibility_tests.cpp \ - tests/slave_recovery_tests.cpp \ - tests/slave_tests.cpp \ - tests/slave_validation_tests.cpp \ - tests/sorter_tests.cpp \ - tests/state_tests.cpp \ - tests/task_status_update_manager_tests.cpp \ - tests/teardown_tests.cpp \ - tests/upgrade_tests.cpp \ - tests/uri_fetcher_tests.cpp \ - tests/uri_tests.cpp \ - tests/utils.cpp \ - tests/utils.hpp \ - tests/values_tests.cpp \ - tests/volume_gid_manager_tests.cpp \ - tests/zookeeper.hpp \ - tests/zookeeper_test_server.hpp \ - tests/zookeeper_url_tests.cpp \ - tests/common/command_utils_tests.cpp \ - tests/common/future_tracker_tests.cpp \ - tests/common/http_tests.cpp \ - tests/common/http_tests.pb.cc \ - tests/common/http_tests.pb.h \ - tests/common/http_tests.proto \ - tests/common/recordio_tests.cpp \ - tests/common/type_utils_tests.cpp \ - tests/containerizer/appc_spec_tests.cpp \ - tests/containerizer/capabilities_test_helper.hpp \ - tests/containerizer/composing_containerizer_tests.cpp \ - tests/containerizer/containerizer_tests.cpp \ - tests/containerizer/cpu_isolator_tests.cpp \ - tests/containerizer/docker_archive.hpp \ - tests/containerizer/docker_common.hpp \ - tests/containerizer/docker_containerizer_tests.cpp \ - tests/containerizer/docker_spec_tests.cpp \ - tests/containerizer/docker_tests.cpp \ - tests/containerizer/environment_secret_isolator_tests.cpp \ - tests/containerizer/io_switchboard_tests.cpp \ - tests/containerizer/isolator.hpp \ - tests/containerizer/isolator_tests.cpp \ - tests/containerizer/launcher.cpp \ - tests/containerizer/launcher.hpp \ - tests/containerizer/memory_isolator_tests.cpp \ - tests/containerizer/memory_test_helper.cpp \ - tests/containerizer/memory_test_helper.hpp \ - tests/containerizer/mesos_containerizer_paths_tests.cpp \ - tests/containerizer/mesos_containerizer_tests.cpp \ - tests/containerizer/mock_containerizer.hpp \ - tests/containerizer/oci_spec_tests.cpp \ - tests/containerizer/posix_rlimits_isolator_tests.cpp \ - tests/containerizer/provisioner_appc_tests.cpp \ - tests/containerizer/provisioner_backend_tests.cpp \ - tests/containerizer/provisioner_docker_tests.cpp \ - tests/containerizer/provisioner_paths_tests.cpp \ - tests/containerizer/rootfs.hpp \ - tests/containerizer/setns_test_helper.hpp \ - tests/containerizer/volume_sandbox_path_isolator_tests.cpp - -if ENABLE_XFS_DISK_ISOLATOR -mesos_tests_SOURCES += \ - tests/containerizer/xfs_quota_tests.cpp -endif - -if ENABLE_CGROUPS_V2 -mesos_tests_SOURCES += \ - tests/containerizer/cgroups2_tests.cpp -endif - -if ENABLE_SECCOMP_ISOLATOR -mesos_tests_SOURCES += \ - tests/containerizer/linux_seccomp_parser_tests.cpp \ - tests/containerizer/linux_seccomp_isolator_tests.cpp -endif - -mesos_tests_CPPFLAGS = $(MESOS_CPPFLAGS) -mesos_tests_CPPFLAGS += -DSOURCE_DIR=\"$(abs_top_srcdir)\" -mesos_tests_CPPFLAGS += -DBUILD_DIR=\"$(abs_top_builddir)\" -mesos_tests_CPPFLAGS += -I../$(GTEST)/include -mesos_tests_CPPFLAGS += -I../$(GMOCK)/include -mesos_tests_CPPFLAGS += -DTESTLIBEXECDIR=\"$(testlibexecdir)\" -mesos_tests_CPPFLAGS += -DSBINDIR=\"$(sbindir)\" - -mesos_tests_LDADD = \ - ../3rdparty/libgmock.la \ - libmesos.la \ - liburi_disk_profile_adaptor.la \ - $(LIB_GRPC) \ - $(LDADD) - -if !OS_FREEBSD - mesos_tests_LDADD += -ldl # FreeBSD includes dynamic lib utils in libc. -endif - -mesos_tests_DEPENDENCIES = \ - ../3rdparty/libgmock.la \ - libmesos.la \ - liburi_disk_profile_adaptor.la \ - $(MESOS_TEST_MODULES) - -if OS_LINUX -mesos_tests_SOURCES += \ - tests/agent_resource_provider_config_api_tests.cpp \ - tests/ldcache_tests.cpp \ - tests/ldd_tests.cpp \ - tests/storage_local_resource_provider_tests.cpp \ - tests/containerizer/linux_capabilities_isolator_tests.cpp \ - tests/containerizer/capabilities_tests.cpp \ - tests/containerizer/capabilities_test_helper.cpp \ - tests/containerizer/cgroups_isolator_tests.cpp \ - tests/containerizer/cgroups_tests.cpp \ - tests/containerizer/cni_isolator_tests.cpp \ - tests/containerizer/docker_volume_isolator_tests.cpp \ - tests/containerizer/linux_devices_isolator_tests.cpp \ - tests/containerizer/linux_filesystem_isolator_tests.cpp \ - tests/containerizer/linux_nnp_isolator_tests.cpp \ - tests/containerizer/fs_tests.cpp \ - tests/containerizer/memory_pressure_tests.cpp \ - tests/containerizer/nested_mesos_containerizer_tests.cpp \ - tests/containerizer/ns_tests.cpp \ - tests/containerizer/nvidia_gpu_isolator_tests.cpp \ - tests/containerizer/perf_tests.cpp \ - tests/containerizer/rootfs.cpp \ - tests/containerizer/runtime_isolator_tests.cpp \ - tests/containerizer/sched_tests.cpp \ - tests/containerizer/setns_test_helper.cpp \ - tests/containerizer/volume_csi_isolator_tests.cpp \ - tests/containerizer/volume_host_path_isolator_tests.cpp \ - tests/containerizer/volume_image_isolator_tests.cpp \ - tests/containerizer/volume_secret_isolator_tests.cpp -endif - -if ENABLE_LAUNCHER_SEALING -mesos_tests_SOURCES += \ - tests/containerizer/linux_memfd_tests.cpp -endif - -if ENABLE_LINUX_ROUTING -mesos_tests_SOURCES += \ - tests/containerizer/routing_tests.cpp -endif - -if ENABLE_NETWORK_PORTS_ISOLATOR -mesos_tests_SOURCES += \ - tests/containerizer/ports_isolator_tests.cpp -endif - -if ENABLE_PORT_MAPPING_ISOLATOR -mesos_tests_SOURCES += \ - tests/containerizer/port_mapping_tests.cpp -endif - -if ENABLE_SSL -mesos_tests_SOURCES += \ - tests/secret_generator_tests.cpp -endif - -if HAS_JAVA -mesos_tests_SOURCES += \ - tests/group_tests.cpp \ - tests/registrar_zookeeper_tests.cpp \ - tests/zookeeper.cpp \ - tests/zookeeper_test_server.cpp \ - tests/zookeeper_tests.cpp - -mesos_tests_CPPFLAGS += $(JAVA_CPPFLAGS) -mesos_tests_CPPFLAGS += -DZOOKEEPER_VERSION=\"$(ZOOKEEPER_VERSION)\" -mesos_tests_DEPENDENCIES += $(EXAMPLES_JAR) - -EXAMPLESCRIPTSJAVA = \ - examples/java/test-executor \ - examples/java/test-exception-framework \ - examples/java/test-framework \ - examples/java/test-log \ - examples/java/test-multiple-executors-framework \ - examples/java/v1-test-framework - -check_SCRIPTS += $(EXAMPLESCRIPTSJAVA) -mesos_tests_DEPENDENCIES += $(EXAMPLESCRIPTSJAVA) -endif - -if HAS_PYTHON -mesos_tests_DEPENDENCIES += $(MESOS_EGG) - -EXAMPLESCRIPTSPYTHON = \ - examples/python/test_executor.py \ - examples/python/test-executor \ - examples/python/test_framework.py \ - examples/python/test-framework - -check_SCRIPTS += $(EXAMPLESCRIPTSPYTHON) -mesos_tests_DEPENDENCIES += $(EXAMPLESCRIPTSPYTHON) -endif - -EXTRA_DIST += \ - examples/python/test_executor.py \ - examples/python/test_framework.py - - -dist_check_SCRIPTS += \ - tests/balloon_framework_test.sh \ - tests/disk_full_framework_test.sh \ - tests/dynamic_reservation_framework_test.sh \ - tests/java_exception_test.sh \ - tests/java_framework_test.sh \ - tests/java_log_test.sh \ - tests/java_v0_framework_test.sh \ - tests/java_v1_framework_test.sh \ - tests/no_executor_framework_test.sh \ - tests/operation_feedback_framework_test.sh \ - tests/persistent_volume_framework_test.sh \ - tests/python_framework_test.sh \ - tests/test_http_framework_test.sh \ - tests/test_framework_test.sh - -../3rdparty/libgmock.la: - @cd ../3rdparty && $(MAKE) $(AM_MAKEFLAGS) libgmock.la - -if INSTALL_TESTS -testlibexec_PROGRAMS = $(check_PROGRAMS) -dist_testlibexec_SCRIPTS = \ - tests/balloon_framework_test.sh \ - tests/disk_full_framework_test.sh \ - tests/java_exception_test.sh \ - tests/java_framework_test.sh \ - tests/java_log_test.sh \ - tests/no_executor_framework_test.sh \ - tests/persistent_volume_framework_test.sh \ - tests/python_framework_test.sh \ - tests/test_http_framework_test.sh \ - tests/test_framework_test.sh - -endif - -# This target will do the following two things: -# 1. Copy mesos-agent-env.sh.template to mesos-slave-env.sh.template. -# 2. Create "slave->agent" symlink in the agent headers installation -# path. -# -# TODO(tomxing): Remove this target once the -# slave->agent rename is complete (MESOS-3782 & MESOS-5230). -copy-template-and-create-symlink: - cd $(DESTDIR)/$(pkgsysconfdir) && \ - $(LN_S) mesos-agent-env.sh.template mesos-slave-env.sh.template - cd $(DESTDIR)/$(includedir)/mesos && $(LN_S) agent slave - -PHONY_TARGETS += copy-template-and-create-symlink - -# Install compatibility symlinks for modules that used to be in $(LIBDIR) -# but are now in $(PKGMODULEDIR). We use install-data-hook because it -# runs late in the install process after the target directories have -# been created. -install-data-hook: copy-template-and-create-symlink - cd $(DESTDIR)/$(libdir) && \ - for name in libfixed_resource_estimator \ - libload_qos_controller \ - liblogrotate_container_logger; do \ - for lib in `cd $(DESTDIR)/$(pkgmoduledir) && ls $${name}*`; do \ - rm -f $$lib; \ - $(LN_S) $(relative_pkgmoduledir)/$$lib $$lib; \ - done; \ - done - -install-exec-hook: - cd $(DESTDIR)/$(sbindir) && $(LN_S) mesos-agent mesos-slave - -# TODO(tomxing): Remove this hook once the -# slave->agent rename is complete(MESOS-3782 & MESOS 5230). -uninstall-hook: - rm -f $(DESTDIR)/$(pkgsysconfdir)/mesos-slave-env.sh.template - rm -f $(DESTDIR)/$(includedir)/mesos/slave - rm -f $(DESTDIR)/$(sbindir)/mesos-slave - -# We use a check-local target for now to avoid the parallel test -# runner that ships with newer versions of autotools. -# See the following discussion for the workaround: -# http://lists.gnu.org/archive/html/automake/2013-01/msg00051.html -check-local: tests - $(TEST_DRIVER) ./mesos-tests - -if ENABLE_NEW_CLI - source $(builddir)/.virtualenv/bin/activate; \ - source $(builddir)/.virtualenv/bin/postactivate; \ - PATH=$(builddir):$$PATH mesos-cli-tests - - tox -c $(srcdir)/python/lib/tox.ini -endif - -if INSTALL_TESTS -# If we enabled test installation, we can run the tests from the -# installation tree. -installcheck-local: - $(testlibexecdir)/mesos-tests --build_dir=/nowhere --source_dir=/nowhere -endif - -clean-local: clean-java clean-python - -tests: all $(check_PROGRAMS) mesos-tests - -.PHONY: $(PHONY_TARGETS) diff --git a/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp new file mode 100644 index 00000000000..2e8a80a5128 --- /dev/null +++ b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.cpp @@ -0,0 +1,65 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "slave/containerizer/mesos/isolators/cgroups2/cgroups2.hpp" + +#include + +#include + +using mesos::slave::Isolator; + +using process::Owned; + +using std::string; + +namespace mesos { +namespace internal { +namespace slave { + +Cgroups2IsolatorProcess::Cgroups2IsolatorProcess( + const hashmap>& _subsystems) + : ProcessBase(process::ID::generate("cgroups2-isolator")), + subsystems(_subsystems) {} + + +Cgroups2IsolatorProcess::~Cgroups2IsolatorProcess() {} + + +Try Cgroups2IsolatorProcess::create(const Flags& flags) +{ + hashmap> subsystems; + + Owned process(new Cgroups2IsolatorProcess(subsystems)); + return new MesosIsolator(process); +} + + +bool Cgroups2IsolatorProcess::supportsNesting() +{ + // TODO(dleamy): Update this once cgroups v2 supports nested containers. + return false; +} + + +bool Cgroups2IsolatorProcess::supportsStandalone() +{ + return true; +} + +} // namespace slave { +} // namespace internal { +} // namespace mesos { diff --git a/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.hpp b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.hpp new file mode 100644 index 00000000000..54d18a484d6 --- /dev/null +++ b/src/slave/containerizer/mesos/isolators/cgroups2/cgroups2.hpp @@ -0,0 +1,59 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef __CGROUPS_V2_ISOLATOR_HPP__ +#define __CGROUPS_V2_ISOLATOR_HPP__ + +#include + +#include + +#include +#include +#include + +#include "slave/containerizer/mesos/isolator.hpp" +#include "slave/containerizer/mesos/isolators/cgroups/subsystem.hpp" +#include "slave/flags.hpp" + +namespace mesos { +namespace internal { +namespace slave { + +class Cgroups2IsolatorProcess : public MesosIsolatorProcess +{ +public: + static Try create(const Flags& flags); + + ~Cgroups2IsolatorProcess() override; + + bool supportsNesting() override; + + bool supportsStandalone() override; + +private: + Cgroups2IsolatorProcess( + const hashmap>& _subsystems); + + // Maps each subsystems to the `Subsystem` isolator that manages it. + const hashmap> subsystems; +}; + +} // namespace slave { +} // namespace internal { +} // namespace mesos { + +#endif diff --git a/support/mesos-tidy/Dockerfile b/support/mesos-tidy/Dockerfile deleted file mode 100644 index db66a8575ba..00000000000 --- a/support/mesos-tidy/Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM ubuntu:xenial -MAINTAINER The Apache Mesos Developers - -WORKDIR /tmp/build - -# Build Mesos-flavored `clang-tidy`. -RUN apt-get update && \ - apt-get install -qy --no-install-recommends \ - build-essential \ - ca-certificates \ - curl \ - git \ - python-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Mesos requires at least cmake-3.7.0 on Linux and cmake-3.8.0 on Windows. -# -# TODO(abudnik): Skip this step when a newer version of CMake package is -# available in OS repository. -RUN curl -sSL https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.sh \ - -o /tmp/install-cmake.sh && \ - sh /tmp/install-cmake.sh --skip-license --prefix=/usr/local - -RUN \ - git clone --depth 1 -b release/9.x http://github.com/llvm/llvm-project.git /tmp/llvm-project && \ - git clone --depth 1 -b mesos_90 http://github.com/mesos/clang.git /tmp/llvm-project/llvm/tools/clang && \ - git clone --depth 1 -b mesos_90 http://github.com/mesos/clang-tools-extra.git /tmp/llvm-project/llvm/tools/clang/tools/extra && \ - \ - cmake /tmp/llvm-project/llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt && \ - cmake --build tools/clang/lib/Headers --target install -- -j $(nproc) && \ - cmake --build tools/clang/tools/extra/clang-tidy --target install -- -j $(nproc) && \ - \ - cd / && \ - rm -rf /tmp/llvm && \ - rm -rf /tmp/build - -ENV PATH /opt/bin:$PATH - -# Install Mesos dependencies -# TODO(mpark): Remove `libssl-dev` from this list once `MESOS-6942` is resolved. -RUN apt-get update && \ - apt-get install -qy \ - autoconf \ - libapr1-dev \ - libcurl4-nss-dev \ - libsasl2-dev \ - libsasl2-modules \ - libssl-dev \ - libsvn-dev \ - libtool \ - zlib1g-dev && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Install `jq` and `parallel` for `clang-tidy` invocation. -RUN apt-get update && \ - apt-get install -qy \ - jq \ - parallel && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Wire up the script which performs the actual work. -WORKDIR /BUILD -ADD ["entrypoint.sh", "entrypoint.sh"] -CMD exec ./entrypoint.sh diff --git a/support/mesos-tidy/README.md b/support/mesos-tidy/README.md deleted file mode 100644 index 043d2204417..00000000000 --- a/support/mesos-tidy/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# `clang-tidy` docker image for Mesos - -This directory contains tooling to build a docker image to run `clang-tidy` -checks over a Mesos repository. It uses a -[customized version of `clang-tidy`][custom-clang-tidy] which is augmented with -Mesos-specific checks. - -__IMPORTANT__: This directory is intended for maintainers of `mesos-tidy` -checks. Users should reach for `support/mesos-tidy.sh`. - -## Building the docker image - -Building the image involves compiling a Mesos-flavored version of -`clang-tidy`, installing Mesos dependencies, and installation of tools -to drive check invocations. - -The image can be built with: -```bash -$ docker build -t mesos-tidy . -``` - -On an M1 Mac, you may need to pass `--platform` to avoid an error with -`qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory`: -```bash -$ docker build -t mesos-tidy --platform linux/amd64 . -``` - -A pre-built image is available via Docker Hub as `mesos/mesos-tidy`. - -## Running checks - -To run checks over a Mesos checkout invoke - -```bash -$ docker run \ - --platform linux/amd64 \ - --rm \ - -v :/SRC \ - [-e CHECKS=] \ - [-e CMAKE_ARGS=] \ - mesos-tidy -``` - -If running on macOS, it will run out of memory by default and you need -to constrain the JOB count, for example: - -```bash -docker run --rm -v :/SRC --platform linux/amd64 --env JOBS=4 --memory 32GB mesos-tidy -``` - -Here `MESOS_CHECKOUT` points to a git checkout of the Mesos source tree. - -Additional configure parameters can be passed to the `cmake` invocation of Mesos -via `CMAKE_ARGS`. By default, `cmake` will be invoked with -`-DCMAKE_BUILD_TYPE=Release` and `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`. - -Optionally, the set of checks to perform can be specified in a -`clang-tidy` check regex via `CHECKS`. - -Results from 3rdparty external dependencies are filtered from the result set. - - -[custom-clang-tidy]: https://github.com/mesos/clang-tools-extra/tree/mesos_50 diff --git a/support/mesos-tidy/entrypoint.sh b/support/mesos-tidy/entrypoint.sh deleted file mode 100755 index 70e6c31331d..00000000000 --- a/support/mesos-tidy/entrypoint.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e -set -o pipefail - -SRCDIR=/tmp/SRC - -# Prepare sources -git clone --depth 1 file:///SRC "${SRCDIR}" - -# Populate the `.clang-tidy` at the top-level. -cp "${SRCDIR}"/support/clang-tidy "${SRCDIR}"/.clang-tidy - -# Configure sources -cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - ${CMAKE_ARGS} \ - "${SRCDIR}" - -# Specify CMake parallelism instead of relying on the default parallelism of -# the particular build tool. -export CMAKE_BUILD_PARALLEL_LEVEL="${JOBS}" - -# Build the external dependencies. -# TODO(mpark): Use an external dependencies target once MESOS-6924 is resolved. -cmake --build 3rdparty --target boost-1.81.0 -cmake --build 3rdparty --target elfio-3.2 -cmake --build 3rdparty --target glog-0.4.0 -cmake --build 3rdparty --target googletest-1.8.0 -cmake --build 3rdparty --target grpc-1.11.1 -cmake --build 3rdparty --target http_parser-2.6.2 - -# TODO(mpark): The `|| true` is a hack to try both `libev` and `libevent` and -# use whichever one happens to be configured. This would also go -# away with MESOS-6924. -cmake --build 3rdparty --target libev-4.22 || true -cmake --build 3rdparty --target libevent-2.1.5-beta || true - -cmake --build 3rdparty --target leveldb-1.19 -cmake --build 3rdparty --target nvml-352.79 -cmake --build 3rdparty --target picojson-1.3.0 -cmake --build 3rdparty --target protobuf-3.5.0 -cmake --build 3rdparty --target re2-2020-07-06 -cmake --build 3rdparty --target zookeeper-3.4.8 - -# Generate the protobuf definitions. -# TODO(mpark): Use a protobuf generation target once MESOS-6925 is resolved. -cmake --build . --target mesos-protobufs - -# For protobuf definitions in stout (`protobuf-test.pb.h`) or -# libprocess (`grpc_tests.pb.h`, `grpc_tests.grpc.pb.h` and `benchmarks.pb.h`) -# no explict targets exists; we instead build the executable targets to produce -# them as a side-effect. This is pretty hacky for what we want to do, but it's -# okay for now. -cmake --build 3rdparty/stout/tests --target stout-tests -cmake --build 3rdparty/libprocess/src/tests --target libprocess-tests -cmake --build 3rdparty/libprocess/src/tests --target benchmarks - -# TODO(bbannier): Use a less restrictive `grep` pattern and `header-filter` -# once MESOS-6115 is fixed. -cat compile_commands.json \ - | jq '.[].file' \ - | sed 's/"//g' \ - | sed 's/^\ //g' \ - | grep "^${SRCDIR}/.*\.cpp$" \ - | parallel -j "${JOBS}" clang-tidy -p "${PWD}" \ - -extra-arg=-Wno-unknown-warning-option \ - -extra-arg=-Wno-unused-command-line-argument \ - -header-filter="^${SRCDIR}/.*\.hpp$" -checks="${CHECKS}" \ - 1> clang-tidy.log 2> /dev/null || true - -# Propagate any errors. -if test -s clang-tidy.log; then - cat clang-tidy.log - exit 1 -else - echo "No mesos-tidy violations found." -fi diff --git a/support/mesos-website/Dockerfile b/support/mesos-website/Dockerfile deleted file mode 100644 index 2ffed3cc979..00000000000 --- a/support/mesos-website/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM mesos/mesos-build:ubuntu-16.04 -MAINTAINER "dev@mesos.apache.org" - -LABEL Description="This image is used for generating Mesos web site." - -# Set the root user explicitly because the base image -# `mesos/mesos-build` uses `mesos` user by default. Also, note that -# `root` inside the container is mapped to `jenkins` user on the build -# machine host in ASF CI. -USER root - -# Install dependencies. -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - doxygen \ - locales && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Install ruby version manager to get a more updated ruby version -RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \ - curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \ - curl -sSL https://get.rvm.io | bash -s stable --ruby=2.6.6 - -ENV PATH=/usr/local/rvm/rubies/ruby-2.6.6/bin:$PATH - -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LC_ALL en_US.UTF-8 - -ENV CC gcc -ENV CXX g++ - -WORKDIR /mesos -CMD bash support/mesos-website/entrypoint.sh diff --git a/support/mesos-website/entrypoint.sh b/support/mesos-website/entrypoint.sh deleted file mode 100755 index c8af020b993..00000000000 --- a/support/mesos-website/entrypoint.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This is a script for building Mesos website. -set -e -set -o pipefail - -function exit_hook { - # Remove mesos build directory on exit. - rm -rf /mesos/build - - # Remove generated documents on exit. - cd /mesos/site && bundle exec rake clean_docs -} - -trap exit_hook EXIT - -file_owner_uid=`stat . --format=%u` -current_user_uid=`id -u` -if [ $file_owner_uid -ne $current_user_uid ]; then - echo " - The mounted mesos sources are owned by UID $file_owner_uid - which is different from the current user UID $current_user_uid - inside the container. Please check that dockerd has - user namespace remapping configured properly. - " - exit 1 -fi - -# Build mesos to get the latest master and agent binaries. -./bootstrap -mkdir -p build -pushd build -../configure --disable-python -make -j3 # Higher parallelism sometimes causes CI to get stuck. -popd # build - -# Generate the endpoint docs from the latest mesos and agent binaries. -./support/generate-endpoint-help.py - -# Build the website. -pushd site -bundle install -bundle exec rake -popd # site