Skip to content

Commit

Permalink
Problem: We need to integrate fty-common-logging.
Browse files Browse the repository at this point in the history
Solution: Add the dependency; regen.

Signed-off-by: Jana Rapava <janarapava@eaton.com>
  • Loading branch information
jana-rapava committed Jul 17, 2018
1 parent 666867e commit 5cc5b6e
Show file tree
Hide file tree
Showing 12 changed files with 290 additions and 9 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ sudo: false
#dist:
#- trusty

# Note: was uncommented in earlier builds (TODO: Check if needed)
services:
- docker
#services:
#- docker

# Set CI_TIME=true to enable build-step profiling in Travis
# Set CI_TRACE=true to enable shell script tracing in Travis
Expand Down Expand Up @@ -70,6 +69,8 @@ pkg_deps_prereqs_source: &pkg_deps_prereqs_source
- libczmq-dev
- libmlm-dev
- libfty-proto-dev
- log4cplus-dev
- libfty-common-logging-dev

# NOTE: Our forks are checked out and built without pkg dependencies in use
pkg_deps_prereqs: &pkg_deps_prereqs
Expand Down Expand Up @@ -117,8 +118,6 @@ matrix:
- env: BUILD_TYPE=valgrind
os: linux
dist: trusty
# Note: was uncommented in earlier builds (TODO: Check if needed)
# sudo: required
addons:
apt:
sources: *pkg_src_zeromq_ubuntu14
Expand Down
14 changes: 14 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ pipeline {
defaultValue: true,
description: 'When using temporary subdirs in build/test workspaces, wipe them after the whole job is done successfully?',
name: 'DO_CLEANUP_AFTER_JOB')
booleanParam (
defaultValue: false,
description: 'When using temporary subdirs in build/test workspaces, wipe them after the whole job is done unsuccessfully (failed)? Note this would not allow postmortems on CI server, but would conserve its disk space.',
name: 'DO_CLEANUP_AFTER_FAILED_JOB')
}
triggers {
pollSCM 'H/2 * * * *'
Expand Down Expand Up @@ -585,6 +589,16 @@ pipeline {
sleep 1
//slackSend (color: "#AA0000", message: "Build ${env.BUILD_NUMBER} of ${env.JOB_NAME} ${currentBuild.result} (<${env.BUILD_URL}|Open>)")
//emailext (to: "qa@example.com", subject: "Build ${env.JOB_NAME} failed!", body: "Build ${env.BUILD_NUMBER} of ${env.JOB_NAME} ${currentBuild.result}\nSee ${env.BUILD_URL}")

dir("tmp") {
script {
if ( params.DO_CLEANUP_AFTER_FAILED_JOB ) {
deleteDir()
} else {
sh """ echo "NOTE: BUILD AREA OF WORKSPACE `pwd` REMAINS FOR POST-MORTEMS ON `hostname` AND CONSUMES `du -hs . | awk '{print \$1}'` !" """
}
}
}
}
}
}
6 changes: 5 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ AM_CPPFLAGS = \
${czmq_CFLAGS} \
${malamute_CFLAGS} \
${fty_proto_CFLAGS} \
${log4cplus_CFLAGS} \
${fty_common_logging_CFLAGS} \
-I$(srcdir)/include

project_libs = ${libsodium_LIBS} ${libzmq_LIBS} ${czmq_LIBS} ${malamute_LIBS} ${fty_proto_LIBS}
project_libs = ${libsodium_LIBS} ${libzmq_LIBS} ${czmq_LIBS} ${malamute_LIBS} ${fty_proto_LIBS} ${log4cplus_LIBS} ${fty_common_logging_LIBS}

SUBDIRS = doc
SUBDIRS += include
Expand All @@ -43,6 +45,8 @@ EXTRA_DIST += \
Findczmq.cmake \
Findmalamute.cmake \
Findfty_proto.cmake \
Findlog4cplus.cmake \
Findfty_common_logging.cmake \
builds/cmake/Modules/ClangFormat.cmake \
builds/cmake/clang-format-check.sh.in \
builds/cmake/Config.cmake.in \
Expand Down
2 changes: 2 additions & 0 deletions builds/check_zproject/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ git clone --quiet --depth 1 -b 4.2.0-FTY-master https://github.com/42ity/libzmq.
git clone --quiet --depth 1 -b v3.0.2-FTY-master https://github.com/42ity/czmq.git czmq
git clone --quiet --depth 1 -b 1.0-FTY-master https://github.com/42ity/malamute.git malamute
git clone --quiet --depth 1 https://github.com/42ity/fty-proto.git fty-proto
git clone --quiet --depth 1 -b 1.1.2-FTY-master https://github.com/42ity/log4cplus.git log4cplus
git clone --quiet --depth 1 -b master https://github.com/42ity/fty-common-logging.git fty-common-logging
cd -

if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list zproject >/dev/null 2>&1) || \
Expand Down
64 changes: 64 additions & 0 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,70 @@ default|default-Werror|default-with-docs|valgrind|clang-format-check)
cd "${BASE_PWD}"
fi

# Start of recipe for dependency: log4cplus
if ! (command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list log4cplus-dev >/dev/null 2>&1) || \
(command -v brew >/dev/null 2>&1 && brew ls --versions log4cplus >/dev/null 2>&1) \
; then
echo ""
BASE_PWD=${PWD}
echo "`date`: INFO: Building prerequisite 'log4cplus' from Git repository..." >&2
$CI_TIME git clone --quiet --depth 1 -b 1.1.2-FTY-master https://github.com/42ity/log4cplus.git log4cplus
cd log4cplus
CCACHE_BASEDIR=${PWD}
export CCACHE_BASEDIR
git --no-pager log --oneline -n1
if [ -e autogen.sh ]; then
$CI_TIME ./autogen.sh 2> /dev/null
fi
if [ -e buildconf ]; then
$CI_TIME ./buildconf 2> /dev/null
fi
if [ ! -e autogen.sh ] && [ ! -e buildconf ] && [ ! -e ./configure ] && [ -s ./configure.ac ]; then
$CI_TIME libtoolize --copy --force && \
$CI_TIME aclocal -I . && \
$CI_TIME autoheader && \
$CI_TIME automake --add-missing --copy && \
$CI_TIME autoconf || \
$CI_TIME autoreconf -fiv
fi
$CI_TIME ./configure "${CONFIG_OPTS[@]}"
$CI_TIME make -j4
$CI_TIME make install
cd "${BASE_PWD}"
fi

# Start of recipe for dependency: fty-common-logging
if ! (command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libfty_common_logging-dev >/dev/null 2>&1) || \
(command -v brew >/dev/null 2>&1 && brew ls --versions fty-common-logging >/dev/null 2>&1) \
; then
echo ""
BASE_PWD=${PWD}
echo "`date`: INFO: Building prerequisite 'fty-common-logging' from Git repository..." >&2
$CI_TIME git clone --quiet --depth 1 -b master https://github.com/42ity/fty-common-logging.git fty-common-logging
cd fty-common-logging
CCACHE_BASEDIR=${PWD}
export CCACHE_BASEDIR
git --no-pager log --oneline -n1
if [ -e autogen.sh ]; then
$CI_TIME ./autogen.sh 2> /dev/null
fi
if [ -e buildconf ]; then
$CI_TIME ./buildconf 2> /dev/null
fi
if [ ! -e autogen.sh ] && [ ! -e buildconf ] && [ ! -e ./configure ] && [ -s ./configure.ac ]; then
$CI_TIME libtoolize --copy --force && \
$CI_TIME aclocal -I . && \
$CI_TIME autoheader && \
$CI_TIME automake --add-missing --copy && \
$CI_TIME autoconf || \
$CI_TIME autoreconf -fiv
fi
$CI_TIME ./configure "${CONFIG_OPTS[@]}"
$CI_TIME make -j4
$CI_TIME make install
cd "${BASE_PWD}"
fi

# Build and check this project; note that zprojects always have an autogen.sh
echo ""
echo "`date`: INFO: Starting build of currently tested project with DRAFT APIs..."
Expand Down
178 changes: 178 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,184 @@ dnl END of PKG_CHECK_MODULES and/or direct tests for libfty_proto
dnl END of enabled attempts to search for libfty_proto


was_log4cplus_check_lib_detected=no

search_log4cplus="yes"

AC_ARG_WITH([log4cplus],
[
AS_HELP_STRING([--with-log4cplus],
[yes or no. Optionally specify log4cplus prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
],
[
search_log4cplus="yes"
],
[
search_log4cplus="yes"
])
AS_CASE([x"${with_log4cplus}"],
[xyes], [search_log4cplus="yes"],
[xno], [search_log4cplus="no"])

dnl We do not abort right now, because the maintainer/developer may have
dnl something particular in mind, e.g. to build just parts of a project.
AS_IF([test x"${search_log4cplus}" = xno],
[AC_MSG_WARN([Required dependency on log4cplus was explicitly disabled during configuration by '--with-log4cplus=no'; subsequent full build of fty-metric-cache may fail])])

AS_IF([test x"${search_log4cplus}" = xyes], [
# Archive previously detected and supplied flags
PRE_SEARCH_CFLAGS="${CFLAGS}"
PRE_SEARCH_LIBS="${LIBS}"
found_pkgconfig=""
found_linkname=""
PKG_CHECK_MODULES([log4cplus], [log4cplus >= 0.0.0],
[
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $log4cplus_LIBS"
was_log4cplus_check_lib_detected=pkgcfg
found_pkgconfig="log4cplus"
],
[
AC_MSG_NOTICE([Package log4cplus not found; falling back to defined compilability tests])
log4cplus_synthetic_cflags=""
log4cplus_synthetic_libs="-llog4cplus"
if test -n "${with_log4cplus}" && test x"${with_log4cplus}" != xyes && test x"${with_log4cplus}" != xno; then
if test -r "${with_log4cplus}/include/log4cplus/logger.h"; then
log4cplus_synthetic_cflags="-I${with_log4cplus}/include"
log4cplus_synthetic_libs="-L${with_log4cplus}/lib -llog4cplus"
else
AC_MSG_ERROR([Header file ${with_log4cplus}/include/log4cplus/logger.h was not found. Please check log4cplus prefix])
fi
else
AC_CHECK_HEADER([log4cplus/logger.h], [],
AC_MSG_ERROR([Header file log4cplus/logger.h was not found in default search paths])
)
fi
AC_CHECK_LIB([log4cplus], [appender_test],
[
was_log4cplus_check_lib_detected=yes
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -llog4cplus"
found_linkname="log4cplus"
],
[AC_MSG_ERROR([cannot link with -llog4cplus, install log4cplus])])
])
dnl END of PKG_CHECK_MODULES and/or direct tests for log4cplus
AS_CASE(["x${was_log4cplus_check_lib_detected}"],
[xpkgcfg], [
AC_SUBST([pkgconfig_name_log4cplus],[${found_pkgconfig}])
CFLAGS="${log4cplus_CFLAGS} ${CFLAGS}"
LIBS="${log4cplus_LIBS} ${LIBS}"
],
[xyes], [
AC_SUBST([pkgconfig_name_log4cplus],[${found_linkname}])
CFLAGS="${log4cplus_synthetic_cflags} ${CFLAGS}"
LDFLAGS="${log4cplus_synthetic_libs} ${LDFLAGS}"
LIBS="${log4cplus_synthetic_libs} ${LIBS}"
AC_SUBST([log4cplus_CFLAGS],[${log4cplus_synthetic_cflags}])
AC_SUBST([log4cplus_LIBS],[${log4cplus_synthetic_libs}])
],
[xno], [
AC_SUBST([pkgconfig_name_log4cplus],[log4cplus])
AC_MSG_ERROR([Cannot find pkg-config metadata for log4cplus 0.0.0 or higher])
])
])
dnl END of enabled attempts to search for log4cplus


was_fty_common_logging_check_lib_detected=no

search_libfty_common_logging="yes"

AC_ARG_WITH([libfty_common_logging],
[
AS_HELP_STRING([--with-libfty_common_logging],
[yes or no. Optionally specify libfty_common_logging prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
],
[
search_libfty_common_logging="yes"
],
[
search_libfty_common_logging="yes"
])
AS_CASE([x"${with_libfty_common_logging}"],
[xyes], [search_libfty_common_logging="yes"],
[xno], [search_libfty_common_logging="no"])

dnl We do not abort right now, because the maintainer/developer may have
dnl something particular in mind, e.g. to build just parts of a project.
AS_IF([test x"${search_libfty_common_logging}" = xno],
[AC_MSG_WARN([Required dependency on fty_common_logging was explicitly disabled during configuration by '--with-libfty_common_logging=no'; subsequent full build of fty-metric-cache may fail])])

AS_IF([test x"${search_libfty_common_logging}" = xyes], [
# Archive previously detected and supplied flags
PRE_SEARCH_CFLAGS="${CFLAGS}"
PRE_SEARCH_LIBS="${LIBS}"
found_pkgconfig=""
found_linkname=""
PKG_CHECK_MODULES([fty_common_logging], [libfty_common_logging >= 0.0.0],
[
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $fty_common_logging_LIBS"
was_fty_common_logging_check_lib_detected=pkgcfg
found_pkgconfig="libfty_common_logging"
],
[
AC_MSG_NOTICE([Package libfty_common_logging not found; falling back to defined compilability tests])
fty_common_logging_synthetic_cflags=""
fty_common_logging_synthetic_libs="-lfty-common-logging"
if test -n "${with_libfty_common_logging}" && test x"${with_libfty_common_logging}" != xyes && test x"${with_libfty_common_logging}" != xno; then
if test -r "${with_libfty_common_logging}/include/fty-log/fty_logger.h"; then
fty_common_logging_synthetic_cflags="-I${with_libfty_common_logging}/include"
fty_common_logging_synthetic_libs="-L${with_libfty_common_logging}/lib -lfty-common-logging"
else
AC_MSG_ERROR([Header file ${with_libfty_common_logging}/include/fty-log/fty_logger.h was not found. Please check libfty_common_logging prefix])
fi
else
AC_CHECK_HEADER([fty-log/fty_logger.h], [],
AC_MSG_ERROR([Header file fty-log/fty_logger.h was not found in default search paths])
)
fi
AC_CHECK_LIB([fty-common-logging], [fty_common_logging_selftest],
[
was_fty_common_logging_check_lib_detected=yes
PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lfty-common-logging"
found_linkname="fty-common-logging"
],
[AC_MSG_ERROR([cannot link with -lfty-common-logging, install libfty_common_logging])])
])
dnl END of PKG_CHECK_MODULES and/or direct tests for libfty_common_logging
AS_CASE(["x${was_fty_common_logging_check_lib_detected}"],
[xpkgcfg], [
AC_SUBST([pkgconfig_name_libfty_common_logging],[${found_pkgconfig}])
CFLAGS="${fty_common_logging_CFLAGS} ${CFLAGS}"
LIBS="${fty_common_logging_LIBS} ${LIBS}"
],
[xyes], [
AC_SUBST([pkgconfig_name_libfty_common_logging],[${found_linkname}])
CFLAGS="${fty_common_logging_synthetic_cflags} ${CFLAGS}"
LDFLAGS="${fty_common_logging_synthetic_libs} ${LDFLAGS}"
LIBS="${fty_common_logging_synthetic_libs} ${LIBS}"
AC_SUBST([fty_common_logging_CFLAGS],[${fty_common_logging_synthetic_cflags}])
AC_SUBST([fty_common_logging_LIBS],[${fty_common_logging_synthetic_libs}])
],
[xno], [
AC_SUBST([pkgconfig_name_libfty_common_logging],[libfty_common_logging])
AC_MSG_ERROR([Cannot find pkg-config metadata for libfty_common_logging 0.0.0 or higher])
])
])
dnl END of enabled attempts to search for libfty_common_logging


CFLAGS="${PREVIOUS_CFLAGS}"
LIBS="${PREVIOUS_LIBS}"

Expand Down
1 change: 1 addition & 0 deletions include/fty_metric_cache_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <czmq.h>
#include <malamute.h>
#include <ftyproto.h>
#include <fty-log/fty_logger.h>

// FTY_METRIC_CACHE version macros for compile-time API detection
#define FTY_METRIC_CACHE_VERSION_MAJOR 1
Expand Down
4 changes: 4 additions & 0 deletions packaging/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Build-Depends: debhelper (>= 9),
libczmq-dev,
libmlm-dev,
libfty-proto-dev,
liblog4cplus-dev,
libfty-common-logging-dev,
systemd,
dh-systemd,
asciidoc-base | asciidoc, xmlto,
Expand All @@ -51,6 +53,8 @@ Depends:
libczmq-dev,
libmlm-dev,
libfty-proto-dev,
liblog4cplus-dev,
libfty-common-logging-dev,
libfty-metric-cache1 (= ${binary:Version})
Description: fty-metric-cache development tools
This package contains development files for fty-metric-cache:
Expand Down
2 changes: 2 additions & 0 deletions packaging/debian/fty-metric-cache.dsc.obs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Build-Depends: debhelper (>= 9),
libczmq-dev,
libmlm-dev,
libfty-proto-dev,
liblog4cplus-dev,
libfty-common-logging-dev,
systemd,
dh-systemd,
asciidoc-base | asciidoc, xmlto,
Expand Down
Loading

0 comments on commit 5cc5b6e

Please sign in to comment.