Hi, I have already applied your previous patch.
From: Stuart Henderson <s...@spacehopper.org> Date: Wed, 1 Jul 2020 10:36:41 +0100 > From my previous mail, I don't see that any of these have been addressed: > > On 2020/05/27 11:38, Stuart Henderson wrote: >> Several of these are in ports already (normally dependencies should be taken >> from ports rather than bundled - so that patches needed for working on >> OpenBSD, >> at least on some arches, are picked up - and so that security fixes don't >> have >> to be made in multiple places - for example onigmo/oniguruma is an old >> version >> missing security fixes). >> >> Builds for some of these do things like force using gcc as the compiler, >> setting opt flags like -O3 -funroll-loops which aren't allowed in ports. >> Those using autoconf bypass the normal ports infrastructure for this and >> pick up tools like gsed/ggrep if present at build time, which in a bulk >> build maybe removed part-way through the build. >> >> cmake checks for some things which aren't listed as dependencies too (and >> finds them if installed), which need to be disabled properly or at least >> check >> that they don't break things if they're present when configure is run but >> removed during the build >> >> -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR >> GTEST_MAIN_LIBRARY) >> -- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.18") found >> components: doxygen dot >> -- Found PythonInterp: /usr/local/bin/python3.8 (found version "3.8.2") >> -- Found PostgreSQL: /usr/local/lib/libpq.so.6.11 (found version "12.2") >> >> I've tidied up some things (diff below) but due to upstream's choices of >> how to do things this is going to be complicated to get in proper shape for >> commit. > Here is the difference between my first and last email. Am I misunderstanding something? -- ASOU Masato diff -urN fluent-bit-1st/Makefile fluent-bit/Makefile --- fluent-bit-1st/Makefile 2020-05-13 16:30:12.000000000 +0900 +++ fluent-bit/Makefile 2020-07-01 14:14:05.000000000 +0900 @@ -1,40 +1,43 @@ # $OpenBSD$ -PKG_ARCH = * +COMMENT = fast log processor and forwarder -COMMENT = Fast log processor and forwarder - -GH_ACCOUNT = fluent -GH_PROJECT = fluent-bit -GH_TAGNAME = v1.4.4 +VERSION = 1.4 +V = ${VERSION}.6 CATEGORIES = sysutils +DISTNAME = fluent-bit-${V} +EXTRACT_SUFX = .tar.gz HOMEPAGE = https://fluentbit.io/ +MASTER_SITES = ${HOMEPAGE:=releases/${VERSION}/} #MAINTAINER = # Apache License 2.0 PERMIT_PACKAGE = Yes -PERMIT_DISTFILES = Yes -MODULES = devel/cmake -USE_NINJA = No +WANTLIB += c c++abi m pthread -# some Makefiles use "$<" -USE_GMAKE = Yes +MODULES = devel/cmake -# CFLAGS "-frandom-seed=\$@" generated by lib/libbacktrace/configure -# assumes a GNU libtool's behavior, our libtool doesn't behave like so. -USE_LIBTOOL = gnu +# hardcodes c++abi +COMPILER = base-clang -# Makefiles generated by cmake are using "$<" +# calls out to $(MAKE) from build files for bundled dependencies, +# some of which need gmake. +USE_NINJA = No +USE_GMAKE = Yes CONFIGURE_ARGS += -DCMAKE_MAKE_PROGRAM:FILEPATH=${LOCALBASE}/bin/gmake CONFIGURE_ARGS += -DCMAKE_INSTALL_SYSCONFDIR:PATH=${LOCALBASE}/share/examples CONFIGURE_ARGS += -DWITHOUT_HEADERS=1 CONFIGURE_ARGS += -DFLB_CORO_STACK_SIZE=16384 +# CFLAGS "-frandom-seed=\$@" generated by lib/libbacktrace/configure +# breaks with openbsd libtool +CONFIGURE_ARGS += -DFLB_BACKTRACE=OFF + BUILD_DEPENDS = devel/bison post-install: diff -urN fluent-bit-1st/distinfo fluent-bit/distinfo --- fluent-bit-1st/distinfo 2020-05-13 16:26:18.000000000 +0900 +++ fluent-bit/distinfo 2020-07-01 09:51:03.000000000 +0900 @@ -1,2 +1,2 @@ -SHA256 (fluent-bit-1.4.4.tar.gz) = f9abc86ca56fbfc7b5c3fff1511f21e6eaa4c75cae7690e2fcca381872abf6f7 -SIZE (fluent-bit-1.4.4.tar.gz) = 12614962 +SHA256 (fluent-bit-1.4.6.tar.gz) = 4da02a9d0f42a82eab07ea3e5713007c0fd5539485da133515ae464789fc11fa +SIZE (fluent-bit-1.4.6.tar.gz) = 12509211 diff -urN fluent-bit-1st/patches/patch-CMakeLists_txt fluent-bit/patches/patch-CMakeLists_txt --- fluent-bit-1st/patches/patch-CMakeLists_txt 1970-01-01 09:00:00.000000000 +0900 +++ fluent-bit/patches/patch-CMakeLists_txt 2020-06-01 15:08:59.000000000 +0900 @@ -0,0 +1,20 @@ +$OpenBSD$ + +avoid gmake-ism, only used to strip off the build path from trace functions + +Index: CMakeLists.txt +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -24,11 +24,7 @@ else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + endif() + +-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'") +-else() +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") +-endif() ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") + + include(GNUInstallDirs) + include(ExternalProject) diff -urN fluent-bit-1st/patches/patch-cmake_onigmo_cmake fluent-bit/patches/patch-cmake_onigmo_cmake --- fluent-bit-1st/patches/patch-cmake_onigmo_cmake 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/patches/patch-cmake_onigmo_cmake 2020-06-01 16:42:13.000000000 +0900 @@ -10,7 +10,7 @@ - CFLAGS=-std=gnu99\ -Wall\ -pipe\ -Os\ -g0\ -s\ -fno-stack-protector\ -fomit-frame-pointer\ -DNDEBUG\ -U_FORTIFY_SOURCE + CFLAGS=-fPIC\ -std=gnu99\ -Wall\ -pipe\ -Os\ -g0\ -s\ -fno-stack-protector\ -fomit-frame-pointer\ -DNDEBUG\ -U_FORTIFY_SOURCE BUILD_COMMAND $(MAKE) - INSTALL_COMMAND $(MAKE) install) + INSTALL_COMMAND $(MAKE) DESTDIR= install) else() @@ -36,7 +36,7 @@ ExternalProject_Add(onigmo SOURCE_DIR ${ONIGMO_SRC} @@ -19,5 +19,5 @@ - CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops + CFLAGS=-fPIC\ -std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops BUILD_COMMAND $(MAKE) - INSTALL_COMMAND $(MAKE) install) + INSTALL_COMMAND $(MAKE) DESTDIR= install) endif() diff -urN fluent-bit-1st/patches/patch-include_fluent-bit_flb_engine_h fluent-bit/patches/patch-include_fluent-bit_flb_engine_h --- fluent-bit-1st/patches/patch-include_fluent-bit_flb_engine_h 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/patches/patch-include_fluent-bit_flb_engine_h 2020-06-01 16:43:53.000000000 +0900 @@ -12,8 +12,8 @@ /* Types of events handled by the Server engine */ #define FLB_ENGINE_EV_CORE MK_EVENT_NOTIFICATION #define FLB_ENGINE_EV_CUSTOM MK_EVENT_CUSTOM -@@ -57,5 +59,7 @@ int flb_engine_flush(struct flb_config *config, - int flb_engine_exit(struct flb_config *config); +@@ -58,5 +60,7 @@ int flb_engine_flush(struct flb_config *config, + int flb_engine_exit_status(struct flb_config *config, int status); int flb_engine_shutdown(struct flb_config *config); int flb_engine_destroy_tasks(struct mk_list *tasks); + diff -urN fluent-bit-1st/patches/patch-lib_chunkio_CMakeLists_txt fluent-bit/patches/patch-lib_chunkio_CMakeLists_txt --- fluent-bit-1st/patches/patch-lib_chunkio_CMakeLists_txt 1970-01-01 09:00:00.000000000 +0900 +++ fluent-bit/patches/patch-lib_chunkio_CMakeLists_txt 2020-06-01 15:13:20.000000000 +0900 @@ -0,0 +1,21 @@ +$OpenBSD$ + +avoid gmake-ism, only used to strip off the build path from trace functions + +Index: lib/chunkio/CMakeLists.txt +--- lib/chunkio/CMakeLists.txt.orig ++++ lib/chunkio/CMakeLists.txt +@@ -14,12 +14,7 @@ else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall ") + endif() + +-# Set __FILENAME__ +-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'") +-else() +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") +-endif() ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") + + # ChunkIO options + option(CIO_DEV "Enable dev/test mode" Off) diff -urN fluent-bit-1st/patches/patch-lib_monkey_CMakeLists_txt fluent-bit/patches/patch-lib_monkey_CMakeLists_txt --- fluent-bit-1st/patches/patch-lib_monkey_CMakeLists_txt 1970-01-01 09:00:00.000000000 +0900 +++ fluent-bit/patches/patch-lib_monkey_CMakeLists_txt 2020-06-01 15:12:10.000000000 +0900 @@ -0,0 +1,16 @@ +$OpenBSD$ + +avoid gmake-ism, only used to strip off the build path from trace functions + +Index: lib/monkey/CMakeLists.txt +--- lib/monkey/CMakeLists.txt.orig ++++ lib/monkey/CMakeLists.txt +@@ -14,7 +14,7 @@ include(GNUInstallDirs) + + # Set default compiler options + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra") +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") + + # Monkey Version + set(MK_VERSION_MAJOR 1) diff -urN fluent-bit-1st/patches/patch-lib_monkey_mk_core_CMakeLists_txt fluent-bit/patches/patch-lib_monkey_mk_core_CMakeLists_txt --- fluent-bit-1st/patches/patch-lib_monkey_mk_core_CMakeLists_txt 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/patches/patch-lib_monkey_mk_core_CMakeLists_txt 2020-06-01 13:58:40.000000000 +0900 @@ -3,7 +3,7 @@ Index: lib/monkey/mk_core/CMakeLists.txt --- lib/monkey/mk_core/CMakeLists.txt.orig +++ lib/monkey/mk_core/CMakeLists.txt -@@ -80,6 +80,7 @@ check_c_source_compiles(" +@@ -78,6 +78,7 @@ check_c_source_compiles(" }" HAVE_EPOLL) check_c_source_compiles(" diff -urN fluent-bit-1st/patches/patch-plugins_in_tail_tail_file_c fluent-bit/patches/patch-plugins_in_tail_tail_file_c --- fluent-bit-1st/patches/patch-plugins_in_tail_tail_file_c 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/patches/patch-plugins_in_tail_tail_file_c 2020-07-01 14:19:31.000000000 +0900 @@ -3,7 +3,7 @@ Index: plugins/in_tail/tail_file.c --- plugins/in_tail/tail_file.c.orig +++ plugins/in_tail/tail_file.c -@@ -1015,9 +1015,8 @@ +@@ -1053,9 +1053,8 @@ { int ret; char *buf; @@ -15,7 +15,7 @@ #elif defined(__APPLE__) char path[PATH_MAX]; #elif defined(_MSC_VER) -@@ -1030,21 +1029,24 @@ +@@ -1068,21 +1067,24 @@ return NULL; } diff -urN fluent-bit-1st/patches/patch-src_CMakeLists_txt fluent-bit/patches/patch-src_CMakeLists_txt --- fluent-bit-1st/patches/patch-src_CMakeLists_txt 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/patches/patch-src_CMakeLists_txt 2020-07-01 14:21:45.000000000 +0900 @@ -3,7 +3,7 @@ Index: src/CMakeLists.txt --- src/CMakeLists.txt.orig +++ src/CMakeLists.txt -@@ -183,6 +183,13 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") +@@ -192,6 +192,13 @@ ) endif() diff -urN fluent-bit-1st/patches/patch-src_flb_engine_c fluent-bit/patches/patch-src_flb_engine_c --- fluent-bit-1st/patches/patch-src_flb_engine_c 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/patches/patch-src_flb_engine_c 2020-06-01 14:02:03.000000000 +0900 @@ -12,7 +12,7 @@ int flb_engine_destroy_tasks(struct mk_list *tasks) { int c = 0; -@@ -483,7 +485,10 @@ int flb_engine_start(struct flb_config *config) +@@ -523,7 +525,10 @@ int flb_engine_start(struct flb_config *config) flb_engine_started(config); while (1) { @@ -24,8 +24,8 @@ mk_event_foreach(event, evl) { if (event->type == FLB_ENGINE_EV_CORE) { ret = flb_engine_handle_event(event->fd, event->mask, config); -@@ -535,6 +540,32 @@ int flb_engine_start(struct flb_config *config) - flb_sched_timer_cleanup(config->sched); +@@ -595,6 +600,32 @@ int flb_engine_start(struct flb_config *config) + flb_upstream_conn_timeouts(config); } } +} diff -urN fluent-bit-1st/patches/patch-src_flb_scheduler_c fluent-bit/patches/patch-src_flb_scheduler_c --- fluent-bit-1st/patches/patch-src_flb_scheduler_c 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/patches/patch-src_flb_scheduler_c 2020-07-01 14:12:37.000000000 +0900 @@ -3,7 +3,7 @@ Index: src/flb_scheduler.c --- src/flb_scheduler.c.orig +++ src/flb_scheduler.c -@@ -376,7 +376,7 @@ int flb_sched_event_handler(struct flb_config *config, +@@ -378,7 +378,7 @@ } else if (timer->type == FLB_SCHED_TIMER_FRAME) { sched = timer->data; diff -urN fluent-bit-1st/patches/patch-src_fluent_bit_c fluent-bit/patches/patch-src_fluent_bit_c --- fluent-bit-1st/patches/patch-src_fluent_bit_c 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/patches/patch-src_fluent_bit_c 2020-07-01 14:13:25.000000000 +0900 @@ -3,7 +3,7 @@ Index: src/fluent-bit.c --- src/fluent-bit.c.orig +++ src/fluent-bit.c -@@ -232,14 +232,8 @@ static void flb_signal_handler(int signal) +@@ -382,14 +382,8 @@ case SIGQUIT: case SIGHUP: #endif diff -urN fluent-bit-1st/pkg/PLIST fluent-bit/pkg/PLIST --- fluent-bit-1st/pkg/PLIST 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/pkg/PLIST 2020-06-01 14:04:49.000000000 +0900 @@ -1,7 +1,7 @@ @comment $OpenBSD: PLIST,v$ @rcscript ${RCDIR}/fluent-bit @bin bin/fluent-bit -lib/libfluent-bit.so +@so lib/libfluent-bit.so share/doc/fluent-bit/ share/doc/fluent-bit/LICENSE share/doc/fluent-bit/README.md diff -urN fluent-bit-1st/pkg/fluent-bit.rc fluent-bit/pkg/fluent-bit.rc --- fluent-bit-1st/pkg/fluent-bit.rc 2020-05-13 16:21:51.000000000 +0900 +++ fluent-bit/pkg/fluent-bit.rc 2020-06-01 14:05:19.000000000 +0900 @@ -1,7 +1,9 @@ #!/bin/sh +# +# $OpenBSD$ daemon="${TRUEPREFIX}/sbin/fluent-bit" -daemon_flags="-c /etc/fluent-bit/fluent-bit.conf" +daemon_flags="-c ${SYSCONFDIR}/fluent-bit/fluent-bit.conf" rc_bg=YES . /etc/rc.d/rc.subr