From 2d27bf62092bf8f355bde94ecb3611046e79e171 Mon Sep 17 00:00:00 2001 From: pawanpraka1 Date: Tue, 14 Nov 2017 15:54:54 +0530 Subject: [PATCH] making travis working for both uzfs and kernel - now we will use ./configure --enable-uzfs=yes to compile for uZFS. By default it will compile for kernel. - fixing make pkg-mod. - installing gtest for travis and codecov - adding gitignore for new binaries --- .travis.yml | 12 ++++++++++-- cmd/tgt/.gitignore | 1 + cmd/zfs/Makefile.am | 2 -- cmd/zpool/Makefile.am | 2 -- config/Rules.am | 4 ++-- config/zol-uzfs.m4 | 14 ++++++++++++++ configure.ac | 1 + include/Makefile.am | 2 ++ lib/libzfs/Makefile.am | 2 -- lib/libzfs_core/Makefile.am | 2 -- tests/cbtest/.gitignore | 1 + 11 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 cmd/tgt/.gitignore create mode 100644 config/zol-uzfs.m4 create mode 100644 tests/cbtest/.gitignore diff --git a/.travis.yml b/.travis.yml index 3ac5aa24d0ae..21c3f553e9ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,14 @@ before_install: - sudo apt-get install lcov # packages for tests - sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio + - sudo apt-get install --yes -qq libgtest-dev cmake install: + - pushd . + - cd /usr/src/gtest + - sudo cmake CMakeLists.txt + - sudo make + - sudo cp *.a /usr/lib + - popd - cd .. - git clone https://github.com/zfsonlinux/spl - cd spl @@ -31,10 +38,11 @@ install: fi - cd ../ZoL - sh autogen.sh - - ./configure --enable-code-coverage=yes - if [ $ZFS_BUILD_TAGS = 0 ]; then + ./configure --enable-code-coverage=yes --enable-uzfs=yes; make; else + ./configure --enable-code-coverage=yes; make --no-print-directory -s pkg-utils pkg-kmod; sudo dpkg -i *.deb; fi @@ -49,4 +57,4 @@ after_failure: - find /var/tmp/test_results/current/log -type f -name '*' -printf "%f\n" -exec cut -c -$ZFS_TEST_TRAVIS_LOG_MAX_LENGTH {} \; after_success: - find /var/tmp/test_results/current/log -type f -name '*' -printf "%f\n" -exec cut -c -$ZFS_TEST_TRAVIS_LOG_MAX_LENGTH {} \; - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file + - bash <(curl -s https://codecov.io/bash) diff --git a/cmd/tgt/.gitignore b/cmd/tgt/.gitignore new file mode 100644 index 000000000000..6c21df4e7df6 --- /dev/null +++ b/cmd/tgt/.gitignore @@ -0,0 +1 @@ +/tgt diff --git a/cmd/zfs/Makefile.am b/cmd/zfs/Makefile.am index 85c760ff8ba6..e40909516d57 100644 --- a/cmd/zfs/Makefile.am +++ b/cmd/zfs/Makefile.am @@ -1,7 +1,5 @@ include $(top_srcdir)/config/Rules.am -AM_CFLAGS += -D_UZFS - DEFAULT_INCLUDES += \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib/libspl/include diff --git a/cmd/zpool/Makefile.am b/cmd/zpool/Makefile.am index 315053887752..d07f8d616534 100644 --- a/cmd/zpool/Makefile.am +++ b/cmd/zpool/Makefile.am @@ -1,7 +1,5 @@ include $(top_srcdir)/config/Rules.am -AM_CFLAGS += -D_UZFS - DEFAULT_INCLUDES += \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib/libspl/include diff --git a/config/Rules.am b/config/Rules.am index 215f09c34a9c..c66dc3ee121b 100644 --- a/config/Rules.am +++ b/config/Rules.am @@ -6,7 +6,7 @@ AM_CFLAGS += ${NO_UNUSED_BUT_SET_VARIABLE} AM_CFLAGS += ${NO_BOOL_COMPARE} AM_CFLAGS += -fno-strict-aliasing AM_CFLAGS += -std=gnu99 -AM_CFLAGS += $(CODE_COVERAGE_CFLAGS) +AM_CFLAGS += $(CODE_COVERAGE_CFLAGS) $(UZFS_CFLAGS) AM_CPPFLAGS = -D_GNU_SOURCE -D__EXTENSIONS__ -D_REENTRANT AM_CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64 AM_CPPFLAGS += -D_LARGEFILE64_SOURCE -DHAVE_LARGE_STACKS=1 @@ -15,4 +15,4 @@ AM_CPPFLAGS += -DLIBEXECDIR=\"$(libexecdir)\" AM_CPPFLAGS += -DRUNSTATEDIR=\"$(runstatedir)\" AM_CPPFLAGS += -DSBINDIR=\"$(sbindir)\" AM_CPPFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\" -AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS) +AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS) $(UZFS_CFLAGS) diff --git a/config/zol-uzfs.m4 b/config/zol-uzfs.m4 new file mode 100644 index 000000000000..7ce0e5eb0c9c --- /dev/null +++ b/config/zol-uzfs.m4 @@ -0,0 +1,14 @@ +AC_DEFUN([ZFS_ZOL_UZFS], [ + AC_ARG_ENABLE(uzfs, + AC_HELP_STRING([--enable-uzfs], + [create user space binaries [[default: no]]]), + [],enable_uzfs=no) + + AS_IF([test "x$enable_uzfs" = xyes], + [ + UZFS_CFLAGS="-D_UZFS -Werror" + ]) + + AC_SUBST(UZFS_CFLAGS) + AC_MSG_RESULT([$enable_uzfs]) +]) diff --git a/configure.ac b/configure.ac index 0d0168c628f2..7333f8adc84a 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,7 @@ ZFS_AC_PACKAGE ZFS_AC_CONFIG ZFS_AC_DEBUG ZFS_AC_DEBUGINFO +ZFS_ZOL_UZFS AC_CONFIG_FILES([ Makefile diff --git a/include/Makefile.am b/include/Makefile.am index a94cad50da17..c5984f1deb77 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -18,6 +18,8 @@ USER_H = \ $(top_srcdir)/include/libuutil.h \ $(top_srcdir)/include/libuutil_impl.h \ $(top_srcdir)/include/libzfs.h \ + $(top_srcdir)/include/libuzfs.h \ + $(top_srcdir)/include/gtest_helper.h \ $(top_srcdir)/include/libzfs_core.h \ $(top_srcdir)/include/libzfs_impl.h diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am index 860a3fe548f7..390069df4191 100644 --- a/lib/libzfs/Makefile.am +++ b/lib/libzfs/Makefile.am @@ -1,7 +1,5 @@ include $(top_srcdir)/config/Rules.am -AM_CFLAGS += -D_UZFS - libzfs_pcdir = $(datarootdir)/pkgconfig libzfs_pc_DATA = libzfs.pc libzfs_core.pc diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am index 037d34330d56..5eafc25c057b 100644 --- a/lib/libzfs_core/Makefile.am +++ b/lib/libzfs_core/Makefile.am @@ -1,7 +1,5 @@ include $(top_srcdir)/config/Rules.am -AM_CFLAGS += -D_UZFS - DEFAULT_INCLUDES += \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib/libspl/include diff --git a/tests/cbtest/.gitignore b/tests/cbtest/.gitignore new file mode 100644 index 000000000000..80532ccf8765 --- /dev/null +++ b/tests/cbtest/.gitignore @@ -0,0 +1 @@ +/test_uzfs