Skip to content

Commit

Permalink
Alpine: build otel with system-provided components
Browse files Browse the repository at this point in the history
  • Loading branch information
thresheek committed Jan 3, 2025
1 parent 74f2109 commit 61f8214
Showing 1 changed file with 3 additions and 72 deletions.
75 changes: 3 additions & 72 deletions alpine/Makefile.module-otel
Original file line number Diff line number Diff line change
Expand Up @@ -3,106 +3,37 @@ MODULES+= otel
MODULE_SUMMARY_otel= OpenTelemetry dynamic module

include $(CONTRIB)/src/nginx-otel/version
include $(CONTRIB)/src/abseil-cpp/version
include $(CONTRIB)/src/grpc/version
include $(CONTRIB)/src/opentelemetry-cpp/version
include $(CONTRIB)/src/opentelemetry-proto/version
include $(CONTRIB)/src/protobuf/version

MODULE_VERSION_otel= $(NGINX_OTEL_VERSION)
MODULE_RELEASE_otel= 1

MODULE_VERSION_PREFIX_otel=$(MODULE_TARGET_PREFIX)

MODULE_SOURCES_otel= nginx-otel-$(NGINX_OTEL_VERSION).tar.xz \
abseil-cpp-$(ABSEIL_VERSION).tar.gz \
grpc-$(GRPC_VERSION).tar.gz \
opentelemetry-cpp-$(OPENTELEMETRY_CPP_VERSION).tar.gz \
opentelemetry-proto-$(OPENTELEMETRY_PROTO_VERSION).tar.gz \
protobuf-$(PROTOBUF_VERSION).tar.gz
opentelemetry-proto-$(OPENTELEMETRY_PROTO_VERSION).tar.gz

MODULE_PATCHES_otel= $(CONTRIB)/src/abseil-cpp/b957f0ccd00481cd4fd663d8320aa02ae0564f18.patch \
$(CONTRIB)/src/abseil-cpp/4500c2fada4e952037c59bd65e8be1ba0b29f21e.patch \
$(CONTRIB)/src/grpc/grpc-cmake-no-re2.patch
MODULE_PATCHES_otel=

MODULE_CONFARGS_otel= --add-dynamic-module=$(MODSRC_PREFIX)/nginx-otel-$(NGINX_OTEL_VERSION)/

.deps-module-otel:
cd $(CONTRIB) && make \
.sum-abseil-cpp \
.sum-grpc \
.sum-opentelemetry-cpp \
.sum-opentelemetry-proto \
.sum-protobuf \
.sum-nginx-otel
touch $@

prerequisites-for-module-otel:

MODULE_BUILD_DEPENDS_otel=cmake re2-dev c-ares-dev
MODULE_BUILD_DEPENDS_otel=cmake protobuf-dev grpc-dev

define MODULE_PREBUILD_otel
export PATH=$$builddir/prebuilt/bin/:$$PATH \&\& \
export NGX_OTEL_PROTO_DIR=$$builddir/../opentelemetry-proto-$(OPENTELEMETRY_PROTO_VERSION) \&\&
export CMAKE_PREFIX_PATH=$$builddir/prebuilt/ \&\& \
cd $$builddir/../abseil-cpp-$(ABSEIL_VERSION) \&\& mkdir build \&\& cd build \&\& \
cmake \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW \
-DCMAKE_PREFIX_PATH=$$builddir/prebuilt/ \
-DCMAKE_INSTALL_PREFIX:STRING=$$builddir/prebuilt/ \
-DCMAKE_INSTALL_LIBDIR:STRING=lib \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_TESTING=OFF \
-DWITH_BENCHMARK=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
../ \&\& \
make $$_make_opts install \&\& \
cd $$builddir/../protobuf-$(PROTOBUF_VERSION) \&\& mkdir build \&\& cd build \&\& \
cmake \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW \
-DCMAKE_PREFIX_PATH=$$builddir/prebuilt/ \
-DCMAKE_INSTALL_PREFIX:STRING=$$builddir/prebuilt/ \
-DCMAKE_INSTALL_LIBDIR:STRING=lib \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-Dprotobuf_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
../cmake/ \&\& \
make $$_make_opts install \&\& \
cd $$builddir/../grpc-$(GRPC_VERSION) \&\& mkdir build \&\& cd build \&\& \
CXXFLAGS='-DGRPC_NO_XDS -DGRPC_NO_RLS' \
cmake \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW \
-DCMAKE_PREFIX_PATH=$$builddir/prebuilt/ \
-DCMAKE_INSTALL_PREFIX:STRING=$$builddir/prebuilt/ \
-DCMAKE_INSTALL_LIBDIR:STRING=lib \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-DgRPC_BUILD_CSHARP_EXT=OFF \
-DgRPC_BUILD_CODEGEN=ON \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG \
-DgRPC_USE_PROTO_LITE=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
../ \&\& \
make $$_make_opts install \&\& \
cd $$builddir/../opentelemetry-cpp-$(OPENTELEMETRY_CPP_VERSION) \&\& mkdir build \&\& cd build \&\& \
cmake \
-DCMAKE_CXX_STANDARD=17 \
Expand Down

0 comments on commit 61f8214

Please sign in to comment.