From b369de380157dc67c74a77cff91aa45bd0c18646 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Tue, 23 Jul 2019 01:06:09 +0000 Subject: [PATCH] fix(docker/builder): enforce DRAIOS_DEBUG_FLAGS to DNDEBUG when BUILD_TYPE=debug This is a temporary fix for Travis CI (which is where we use falco-builder docker image). Was already done in the past (see: https://github.com/falcosecurity/falco/commit/9285aa59c1b3b629fa8f70f5ded056ae5b5798e4#diff-354f30a63fb0907d4ad57269548329e3). Signed-off-by: Leonardo Di Donato --- docker/builder/Dockerfile | 6 ++---- docker/builder/root/usr/bin/entrypoint | 5 ++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docker/builder/Dockerfile b/docker/builder/Dockerfile index 015eb100..620fb46b 100644 --- a/docker/builder/Dockerfile +++ b/docker/builder/Dockerfile @@ -36,9 +36,7 @@ RUN source scl_source enable devtoolset-7 && \ rm -rf /tmp/cmake-${CMAKE_VERSION} # fixme: deps needs a fix into CMakeLists.txt -RUN yum -y install libyaml-devel - -RUN yum clean all -y +RUN yum -y install libyaml-devel && yum clean all -y COPY ./root / @@ -48,4 +46,4 @@ ENV BASH_ENV=/usr/bin/scl_enable \ PROMPT_COMMAND=". /usr/bin/scl_enable" ENTRYPOINT ["entrypoint"] -CMD ["usage"] \ No newline at end of file +CMD ["usage"] diff --git a/docker/builder/root/usr/bin/entrypoint b/docker/builder/root/usr/bin/entrypoint index 3a150ed3..636206b8 100755 --- a/docker/builder/root/usr/bin/entrypoint +++ b/docker/builder/root/usr/bin/entrypoint @@ -9,8 +9,10 @@ shift # Build type can be "debug" or "release", fallbacks to "release" by default BUILD_TYPE=$(echo "$BUILD_TYPE" | tr "[:upper:]" "[:lower:]") +DRAIOS_DEBUG_FLAGS= case "$BUILD_TYPE" in "debug") + DRAIOS_DEBUG_FLAGS="-D_DEBUG -DNDEBUG" ;; *) BUILD_TYPE="release" @@ -39,6 +41,7 @@ case "$CMD" in -DBUILD_BPF="$BUILD_BPF" \ -DBUILD_WARNINGS_AS_ERRORS="$BUILD_WARNINGS_AS_ERRORS" \ -DFALCO_VERSION="$FALCO_VERSION" \ + -DDRAIOS_DEBUG_FLAGS="$DRAIOS_DEBUG_FLAGS" \ "$SOURCE_DIR/falco" exit "$(printf '%d\n' $?)" ;; @@ -56,4 +59,4 @@ case "$CMD" in cd "$BUILD_DIR/$BUILD_TYPE" make -j"$MAKE_JOBS" "$CMD" ;; -esac \ No newline at end of file +esac