nginxinc/nginx-otel

nginx-otel build fails on FreeBSD after `devel/protobuf` update to 24.4

osokin opened this issue · 1 comments

osokin commented

Describe the bug

OTEL module build fails on FreeBSD 13.2 after devel/protobuf update to 24.4

Initially build fails with following error:

/usr/local/poudriere/ports/local/www/nginx-devel/work/nginx-otel-dc52126//src/http_module.cpp:8:10: fatal error: 'google/protobuf/stubs/logging.h' file not found
#include <google/protobuf/stubs/logging.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A trivial patch with removing the header file shows another error:

cc -c -fPIC -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   --std=c++17 -Wno-missing-field-initializers -Wno-conditional-uninitialized -fPIC -fvisibility=hidden -DHAVE_ABSEIL -Dngx_otel_module_EXPORTS -I src/core  -I src/event  -I src/event/modules  -I src/event/quic  -I src/os/unix  -I /usr/local/include  -I objs  -I src/http  -I src/http/modules  -I src/http/v2  -I src/http/v3  -o objs/addon/src/http_module.o  /usr/local/poudriere/ports/local/www/nginx-devel/work/nginx-otel-dc52126//src/http_module.cpp
/usr/local/poudriere/ports/local/www/nginx-devel/work/nginx-otel-dc52126//src/http_module.cpp:509:43: error: no type named 'LogLevel' in namespace 'google::protobuf'
void protobufLogHandler(google::protobuf::LogLevel logLevel,
                        ~~~~~~~~~~~~~~~~~~^
/usr/local/poudriere/ports/local/www/nginx-devel/work/nginx-otel-dc52126//src/http_module.cpp:514:36: error: use of undeclared identifier 'LOGLEVEL_FATAL'
    ngx_uint_t level = logLevel == LOGLEVEL_FATAL   ? NGX_LOG_EMERG :
                                   ^
/usr/local/poudriere/ports/local/www/nginx-devel/work/nginx-otel-dc52126//src/http_module.cpp:515:36: error: use of undeclared identifier 'LOGLEVEL_ERROR'
                       logLevel == LOGLEVEL_ERROR   ? NGX_LOG_ERR :
                                   ^
/usr/local/poudriere/ports/local/www/nginx-devel/work/nginx-otel-dc52126//src/http_module.cpp:516:36: error: use of undeclared identifier 'LOGLEVEL_WARNING'
                       logLevel == LOGLEVEL_WARNING ? NGX_LOG_WARN :
                                   ^
/usr/local/poudriere/ports/local/www/nginx-devel/work/nginx-otel-dc52126//src/http_module.cpp:544:23: error: no type named 'SetLogHandler' in namespace 'google::protobuf'
    google::protobuf::SetLogHandler(protobufLogHandler);
    ~~~~~~~~~~~~~~~~~~^
5 errors generated.
*** [objs/addon/src/http_module.o] Error code 1

To reproduce

  1. Install FreeBSD
  2. Update ports tree
  3. Try to build www/nginx-devel with OTEL module enabled

Expected behavior

Successful "green" build.

Your environment

FreeBSD 13.2-p7, protobuf version 24.4

Additional context

Add any other context about the problem here.

Duplicate of #16