diff options
Diffstat (limited to 'auto')
-rw-r--r-- | auto/cc/test | 4 | ||||
-rw-r--r-- | auto/help | 2 | ||||
-rw-r--r-- | auto/make | 54 | ||||
-rw-r--r-- | auto/modules/java | 4 | ||||
-rw-r--r-- | auto/modules/java_jar.sha512 | 20 | ||||
-rw-r--r-- | auto/options | 2 | ||||
-rw-r--r-- | auto/otel | 52 | ||||
-rw-r--r-- | auto/sources | 4 | ||||
-rw-r--r-- | auto/summary | 1 | ||||
-rw-r--r-- | auto/threads | 50 |
10 files changed, 120 insertions, 73 deletions
diff --git a/auto/cc/test b/auto/cc/test index 34e4379e..ac4d5f33 100644 --- a/auto/cc/test +++ b/auto/cc/test @@ -67,6 +67,8 @@ case $NXT_CC_NAME in NXT_CFLAGS="$NXT_CFLAGS -fno-strict-overflow" + NXT_CFLAGS="$NXT_CFLAGS -funsigned-char" + NXT_CFLAGS="$NXT_CFLAGS -std=gnu11" NXT_CFLAGS="$NXT_CFLAGS -O" @@ -109,6 +111,8 @@ case $NXT_CC_NAME in NXT_CFLAGS="$NXT_CFLAGS -fno-strict-overflow" + NXT_CFLAGS="$NXT_CFLAGS -funsigned-char" + NXT_CFLAGS="$NXT_CFLAGS -std=gnu11" NXT_CFLAGS="$NXT_CFLAGS -O" @@ -52,6 +52,8 @@ cat << END --njs enable njs library usage + --otel enable otel library usage + --debug enable debug logging --fuzz=ENGINE enable fuzz testing @@ -7,7 +7,6 @@ $echo "creating $NXT_MAKEFILE" - cat << END > $NXT_MAKEFILE # Pretty print compiler etc actions... @@ -22,6 +21,8 @@ AR = $AR EXTRA_CFLAGS = CFLAGS = $NXT_CFLAGS $NXT_CC_OPT $CFLAGS \$(EXTRA_CFLAGS) +RUST_FLAGS = +NXT_OTEL_LIB_LOC = NXT_EXEC_LINK = $NXT_EXEC_LINK $NXT_LD_OPT NXT_SHARED_LOCAL_LINK = $NXT_SHARED_LOCAL_LINK $NXT_LD_OPT @@ -62,6 +63,9 @@ D := 0 ifeq (\$D,1) CFLAGS += -O0 + RUST_FLAGS += --debug +else + RUST_FLAGS += --release endif # Optionally disable -Werror with @@ -76,6 +80,18 @@ END fi +# potentially set otel lib location +if [ $NXT_OTEL = YES ]; then +cat << END >> $NXT_MAKEFILE + +ifeq (\$D,1) + NXT_OTEL_LIB_LOC = $NXT_OTEL_LIB_DIR/target/debug/libotel.a +else + NXT_OTEL_LIB_LOC = $NXT_OTEL_LIB_DIR/target/release/libotel.a +endif + +END +fi # The include paths list. @@ -138,14 +154,14 @@ cat << END >> $NXT_MAKEFILE libnxt: $NXT_BUILD_DIR/lib/$NXT_LIB_SHARED $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC -$NXT_BUILD_DIR/lib/$NXT_LIB_SHARED: \$(NXT_LIB_OBJS) +$NXT_BUILD_DIR/lib/$NXT_LIB_SHARED: \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_LOC) \$(PP_LD) \$@ \$(v)\$(NXT_SHARED_LOCAL_LINK) -o \$@ \$(NXT_LIB_OBJS) \\ - $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS + $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS \$(NXT_OTEL_LIB_LOC) -$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS) +$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_LOC) \$(PP_AR) \$@ - \$(v)$NXT_STATIC_LINK \$@ \$(NXT_LIB_OBJS) + \$(v)$NXT_STATIC_LINK \$@ \$(NXT_LIB_OBJS) \$(NXT_OTEL_LIB_LOC) $NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC: \$(NXT_LIB_UNIT_OBJS) \\ $NXT_BUILD_DIR/share/pkgconfig/unit.pc \\ @@ -359,11 +375,11 @@ $echo >> $NXT_MAKEFILE cat << END >> $NXT_MAKEFILE $NXT_BUILD_DIR/sbin/$NXT_DAEMON: $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\ - \$(NXT_OBJS) + \$(NXT_OBJS) \$(NXT_OTEL_LIB_LOC) \$(PP_LD) \$@ \$(v)\$(NXT_EXEC_LINK) -o \$@ \$(CFLAGS) \\ \$(NXT_OBJS) $NXT_BUILD_DIR/lib/$NXT_LIB_STATIC \\ - $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS + $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS \$(NXT_OTEL_LIB_LOC) END @@ -535,10 +551,6 @@ cat << END > Makefile include $NXT_MAKEFILE -.PHONY: clean -clean: - rm -rf $NXT_BUILD_DIR *.dSYM Makefile - .PHONY: help help: @echo "Variables to control make/build behaviour:" @@ -551,4 +563,24 @@ help: @echo @echo " Variables can be combined." +.PHONY: clean +clean: + rm -rf $NXT_BUILD_DIR *.dSYM Makefile +END + +if [ $NXT_OTEL = YES ]; then + cat << END >> Makefile + cd "$NXT_OTEL_LIB_DIR" && cargo clean END + +NXT_OTEL_DEPS=" \ + build/src/nxt_otel.o \ + src/otel/src/lib.rs \ +" + + cat << END >> $NXT_MAKEFILE + +\$(NXT_OTEL_LIB_LOC): $NXT_OTEL_DEPS + cargo build \$(RUST_FLAGS) --manifest-path $NXT_OTEL_LIB_DIR/Cargo.toml +END +fi diff --git a/auto/modules/java b/auto/modules/java index 4bb34ae7..cd120902 100644 --- a/auto/modules/java +++ b/auto/modules/java @@ -238,7 +238,7 @@ cat << END > $NXT_JAVA_JARS static const char *nxt_java_system_jars[] = { END -NXT_TOMCAT_VERSION=9.0.93 +NXT_TOMCAT_VERSION=9.0.98 NXT_JAR_VERSION=$NXT_TOMCAT_VERSION @@ -297,7 +297,7 @@ NXT_JAR_NAME=jetty-http . auto/modules/java_get_jar NXT_JAR_NAME=classgraph -NXT_JAR_VERSION=4.8.175 +NXT_JAR_VERSION=4.8.179 NXT_JAR_NAMESPACE=io/github/classgraph/ . auto/modules/java_get_jar diff --git a/auto/modules/java_jar.sha512 b/auto/modules/java_jar.sha512 index 14516b8c..e902f6b5 100644 --- a/auto/modules/java_jar.sha512 +++ b/auto/modules/java_jar.sha512 @@ -1,14 +1,14 @@ -75eb34c016ce4eb4c7a8413ed06570b491f9f2fb852b19097d0e7692c746052da466d6e86810a9c899890a87f49d5c94cffd724b15d47b006e34e7c334437efc classgraph-4.8.175.jar +8ae750523f086c667f1ecb22cdd02037f217b67841757c2545100ec314145268a60cc6f381bde86659fa090f1a05de8f7cf3ebaf13fb4e737fda749a1ce77078 classgraph-4.8.179.jar ab441acf5551a7dc81c353eaccb3b3df9e89a48987294d19e39acdb83a5b640fcdff7414cee29f5b96eaa8826647f1d5323e185018fe33a64c402d69c73c9158 ecj-3.26.0.jar 48d5512d378d58c3df93bbe1c68d5a4b097e2dc7466992393e0731414dc0fe449312e067d0874e503dd27cb9b6a1f2da0d1f1569a7b484c1f12bd533afbe2723 jetty-http-9.4.56.v20240826.jar dc0d1f05a7f8477e1f7f57adb307224aadcb1e1fed6f7e5df72d9b84437bf75276c3b0f13da9d079c541ad94601bdbd7314c61477b224dbbdc93a6d5b9f98478 jetty-server-9.4.56.v20240826.jar 025751c45cd8a23f1b436eaa1849af2421f78a2a82bc07c4175df8b4ec5dfc15247036194156897aafb8b0ec83406bbaa25e4092fea5ddd3b900da0ffdfaae19 jetty-util-9.4.56.v20240826.jar -9ea72285b395592dbee58339e3a2a9a8e9d9b623f9c37eace3cb45842107469880d3556a18023f870ef4fcad007705652ff300c12f57fa13af9a8cd666f545de tomcat-api-9.0.93.jar -3a91b9dda9d015aaf0c931847ba40a17bd77102ec0b596a1406142dfac556ab95fa5e0fe554743757d80f28436bcd05f28d2716ca62204bded81f0ed98ac2bf8 tomcat-el-api-9.0.93.jar -d50a0d26c6b8ee2b855df54e7a2647f423181f7fa45fe67daf33b8828122b891cacc7bd8312ae72c05a20708f2b405053045d71939427e1526796b02432db72d tomcat-jasper-9.0.93.jar -4886719cbe70ec7bd9190f691d0a85bc84a343ecdb969eb946b0718f0a8bd670f9bc771a309d2d90b23dae06be1f51d3049df7ed157c90b8f4d724a1064eb21b tomcat-jasper-el-9.0.93.jar -17696c91cb90c71dbebac36cebd5205c001a4ebd4df22eeef0762d818dde16f8b6e8ccfa28301ea2fa6efb001ea2f428a813a2aea1b593f08c7c62d31884571c tomcat-jsp-api-9.0.93.jar -cf9582e6fbc3dae8bdc55e4e687fd2dbc6f44d1bfce77e2117f8673b011d69c07ade7f715493e1d14e205d122284114edc2fe9f19888933645931a093dd26a01 tomcat-juli-9.0.93.jar -280c000ec81893a87feaf7db46702d0b13599e82aedf1540597f69c609bd20a48d04f887131bc464c7f715911aa8c3b44a3502e1c736e5c7575765c419fdb064 tomcat-servlet-api-9.0.93.jar -55a47b7bc9cc3dc47d93f7850d60375d900f7aac3a7b16bdd06e01e4523672ea93cdac8660825307c6699bda8bb5e4f668b2d1d42967194dddceeb56b1acc004 tomcat-util-9.0.93.jar -db933442c1cbbc1e277cce2a374b17b37aea14b3a7f1a42f1bf7152af8edc0d876ee25ae5087f31e0b06474d1e2a134de36f3e3eaca0f04dac734deeecfd773e tomcat-util-scan-9.0.93.jar +356c0668e2c03201c74e82491a1daf5194368dbb3a08c42c49abb9e544e814b5a1aa85465137e8da785120733ed279a297942bebf6ee8453d935648fb02a3893 tomcat-api-9.0.98.jar +43c106be1a497b4641eed28bc5c2c60192a7240f6dd3e55850197969a275d38c9d853646dd3f313af530010b36095f8893289c8ddfed018f2537cd7ddc84be98 tomcat-el-api-9.0.98.jar +570e6e9f4a762cad5b3190886915d93618f7292bfa3ee39abb7b9f0993704a19fbb0fd4a7727995fd7f50edf62f4b6df50d2854a6fa70ac1e8a6650a02445fd2 tomcat-jasper-9.0.98.jar +77f3c0da8ee1af315c59cc1e6566dab7cfbdd928045aa7c921299e72b88004bd6b710f0b62b39c4a3aaa872b965b50d5f4ba43bf98a0cd39d585c6b82edeaf06 tomcat-jasper-el-9.0.98.jar +8d825b69acb8227709cbdea1349faa6115243c5824ff751af3d5c45822dfe371506077669565e7531f278b6752be819e5e54e73284a75208d4f8784706ee6fb7 tomcat-jsp-api-9.0.98.jar +353c858821644f7284bc272d8f23c031199439fea74b8c104bb2d054716f6a87523d4d9d38f86dca5e353b4ddff307d1cdc0d221ddda10e0626b1cf3cbda482b tomcat-juli-9.0.98.jar +5b1a8ca4c4b3782531e154d0519f2e3fa8cdb647848e455d4af446f7fac6555ad0fa76750e0d76b02f4e7bceae147ebc96c9d3f786542defcab2d69e7b419175 tomcat-servlet-api-9.0.98.jar +6a1729a0f251a3cb80cab476686a2c307b5e1d2827d991327f4ce6f69183a6d876cf9a886ab074eddec693fca418158407dac8844781c4667aca5575378574c6 tomcat-util-9.0.98.jar +37dc24785e3c18d527038242056d7481635505c2609ff77ee3b249e88a7c48323f6c99a562391fef2474e6cb896f9445855eed48fc8a8ab89b8704c8ecb4193a tomcat-util-scan-9.0.98.jar diff --git a/auto/options b/auto/options index 5be1ebe1..7aa7a73a 100644 --- a/auto/options +++ b/auto/options @@ -27,6 +27,7 @@ NXT_CYASSL=NO NXT_POLARSSL=NO NXT_NJS=NO +NXT_OTEL=NO NXT_TEST_BUILD_EPOLL=NO NXT_TEST_BUILD_EVENTPORT=NO @@ -112,6 +113,7 @@ do --polarssl) NXT_POLARSSL=YES ;; --njs) NXT_NJS=YES ;; + --otel) NXT_OTEL=YES ;; --test-build-epoll) NXT_TEST_BUILD_EPOLL=YES ;; --test-build-eventport) NXT_TEST_BUILD_EVENTPORT=YES ;; diff --git a/auto/otel b/auto/otel new file mode 100644 index 00000000..f23aac3b --- /dev/null +++ b/auto/otel @@ -0,0 +1,52 @@ + +# Copyright (C) NGINX, Inc. + +if [ $NXT_OTEL = YES ]; then + + $echo "checking for OTEL requirements:" + + $echo -n " - checking for rust compiler ... " + if [ -z $(which rustc 2>/dev/null) ]; then + $echo "not found" + exit 1; + fi + $echo "found" + + $echo -n " - checking for cargo ... " + if [ -z $(which cargo 2>/dev/null) ]; then + $echo "not found." + exit 1; + fi + $echo "found" + + $echo -n " - " + + nxt_feature="OpenSSL library" + nxt_feature_run=yes + nxt_feature_incs= + nxt_feature_libs="-lssl -lcrypto" + nxt_feature_test="#include <openssl/ssl.h> + + int main(void) { + SSL_library_init(); + return 0; + }" + . auto/feature + + if [ ! $nxt_found = yes ]; then + $echo + $echo $0: error: OpenTelemetry support requires OpenSSL. + $echo + exit 1; + fi + + NXT_OTEL_LIBS="-lssl -lcrypto" + + cat << END >> $NXT_AUTO_CONFIG_H + +#ifndef NXT_HAVE_OTEL +#define NXT_HAVE_OTEL 1 +#endif + +END +fi diff --git a/auto/sources b/auto/sources index dfabf7cf..02740397 100644 --- a/auto/sources +++ b/auto/sources @@ -127,6 +127,10 @@ if [ "$NXT_NJS" != "NO" ]; then NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_js.c src/nxt_http_js.c src/nxt_script.c" fi +if [ "$NXT_OTEL" != "NO" ]; then + NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_otel.c" +fi + NXT_LIB_EPOLL_SRCS="src/nxt_epoll_engine.c" NXT_LIB_KQUEUE_SRCS="src/nxt_kqueue_engine.c" NXT_LIB_EVENTPORT_SRCS="src/nxt_eventport_engine.c" diff --git a/auto/summary b/auto/summary index b6caee6c..eba88be4 100644 --- a/auto/summary +++ b/auto/summary @@ -30,6 +30,7 @@ Unit configuration summary: TLS support: ............... $NXT_OPENSSL Regex support: ............. $NXT_REGEX njs support: ............... $NXT_NJS + otel support: .............. $NXT_OTEL process isolation: ......... $NXT_ISOLATION cgroupv2: .................. $NXT_HAVE_CGROUP diff --git a/auto/threads b/auto/threads index 67b46690..ca4d1304 100644 --- a/auto/threads +++ b/auto/threads @@ -73,56 +73,6 @@ if [ $nxt_found = no ]; then fi -# FreeBSD, Solaris, AIX. - -nxt_feature="pthread spinlock" -nxt_feature_name=NXT_HAVE_PTHREAD_SPINLOCK -nxt_feature_run=yes -nxt_feature_incs= -nxt_feature_libs=$NXT_PTHREAD -nxt_feature_test="#include <pthread.h> - - int main(void) { - pthread_spinlock_t lock; - - if (pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE) != 0) - return 1; - if (pthread_spin_lock(&lock) != 0) - return 1; - if (pthread_spin_unlock(&lock) != 0) - return 1; - if (pthread_spin_destroy(&lock) != 0) - return 1; - return 0; - }" -. auto/feature - - -if [ $nxt_found = yes ]; then - - # Linux glibc uses 0 as pthread_spinlock_t initial value on the most - # platforms. However, on i386 and x86_64 the initial value is 1. - - nxt_feature="pthread spinlock zero initial value" - nxt_feature_name=NXT_HAVE_PTHREAD_SPINLOCK_ZERO - nxt_feature_run=yes - nxt_feature_incs= - nxt_feature_libs=$NXT_PTHREAD - nxt_feature_test="#include <pthread.h> - - pthread_spinlock_t lock = 0; - - int main(void) { - if (pthread_spin_trylock(&lock) != 0) - return 1; - if (pthread_spin_unlock(&lock) != 0) - return 1; - return 0; - }" - . auto/feature -fi - - nxt_feature="sem_timedwait()" nxt_feature_name=NXT_HAVE_SEM_TIMEDWAIT nxt_feature_run=yes |