-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OTEL build fixes #1527
OTEL build fixes #1527
Conversation
This supplants #1520 Build tested on Fedora, Debian, FreeBSD & macOS with and without --otel |
Also tested on all supported platforms in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'm not sure about the gmake dependency part, though, but it's better to be explicit rather than fail during the build process.
Maybe @osokin has some ideas on how to fix that properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is expected behavior or not: make tests
does not seem to be building libotel.a by default anymore, so if you execute the following you will get an error:
./configure --otel --openssl --tests
make -j8 tests
However if you make
first then you will not have issues with make tests
.
This was found on an Ubuntu arm64 VM.
0397301
to
70d0683
Compare
Fix
|
OK, so here's another issue!... On master
Anyway as I mentioned to @osokin I have an idea to keep BSD make working and will get rid of this issue... It'll mean doing a --release build of otel by default, and if you want to do a --debug build you'll need to do it using GNU make... |
d3cb989
to
4fe4f78
Compare
|
4fe4f78
to
857b85c
Compare
This looks good to me, thank you. Another issue is related to Thank you in advance. |
Same issue with RPM build (which are done offline, especially required for reproducible builds) |
Yeah, so I've created a separate port specifically for the Unit's OTel, devel/unit-otel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's good enough for @osokin it's good enough for me 🙂
I've checked the builds for Linux packages we have, and it's also good. Same on macOS side.
I've created a new issue to track the off-line builds issue and added your comments there... |
When building with --otel on macOS for example I was seeing compile failures with the cpu_set_t stuff which should only be used under Linux. It turned out that despite checking for Linux sched_getaffinity() ... not found we were getting #ifndef NXT_HAVE_LINUX_SCHED_GETAFFINITY #define NXT_HAVE_LINUX_SCHED_GETAFFINITY 1 #endif in build/include/nxt_auto_config.h It seems this was due to the . auto/feature in auto/otel, this check happens right after the above. Without having nxt_feature_name=NXT_HAVE_OTEL set. Instead we were adding the define for that manually. Doing auto/feature without having a nxt_feature_name must have used the last set one and enabled it. Set nxt_feature_name and remove the manual editing of nxt_auto_config.h Fixes: 9d3dcb8 ("otel: add build tooling to include otel code") Signed-off-by: Andrew Clayton <[email protected]>
This better matches existing naming convention, e.g NXT_LIB_STATIC Fixes: 9d3dcb8 ("otel: add build tooling to include otel code") Signed-off-by: Andrew Clayton <[email protected]>
The static library is supposed to be specified prior to its dependencies. Also, no need to put an otel static library inside libnxt static library, as we explicitely link unit binary with otel static library anyway. This fixes the following build problems: - macOS: Finished `release` profile [optimized] target(s) in 58.07s AR build/lib/libnxt.a LD build/sbin/unitd ld: archive member 'libotel.a' not a mach-o file in '/private/tmp/unit-20241219-8965-yb46xp/build/lib/libnxt.a' clang: error: linker command failed with exit code 1 (use -v to see invocation) - Ubuntu 22 (./configure --otel): LD build/sbin/unitd cc -Wl,-E -o build/sbin/unitd -pipe -fPIC -fvisibility=hidden -fno-strict-overflow -funsigned-char -std=gnu11 -O -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fno-strict-aliasing -Wmissing-prototypes -Werror -g \ build/src/nxt_main.o build/lib/libnxt.a \ -lm -lrt -lpthread \ \ -lpcre2-8 -lssl -lcrypto src/otel/target/release/libotel.a /usr/bin/ld: src/otel/target/release/libotel.a(reqwest-97d1376dfb77d784.reqwest.cb371ce8e1e3945e-cgu.04.rcgu.o): in function `core::ptr::drop_in_place<alloc::vec::Vec<reqwest::tls::Certificate>>': reqwest.cb371ce8e1e3945e-cgu.04:(.text._ZN4core3ptr69drop_in_place$LT$alloc..vec..Vec$LT$reqwest..tls..Certificate$GT$$GT$17h9b62679cc7161be5E+0x30): undefined reference to `X509_free' Fixes: 9d3dcb8 ("otel: add build tooling to include otel code") [ Tweaked subject prefix. s/NXT_OTEL_LIB_LOC/NXT_OTEL_LIB_STATIC/ - Andrew ] Signed-off-by: Andrew Clayton <[email protected]>
Fixes: 9d3dcb8 ("otel: add build tooling to include otel code") [ Commit subject, s/NXT_OTEL_LIB_LOC/NXT_OTEL_LIB_STATIC/ and placement of NXT_OTEL_LIB_STATIC tweaked as per @thresheek - Andrew ] Signed-off-by: Andrew Clayton <[email protected]>
Rust code relies on macOS-provided frameworks for TLS. Fixes: 9d3dcb8 ("otel: add build tooling to include otel code") [ Tweaked subject prefix. Some minor tweaks for current changes. - Andrew ] Signed-off-by: Andrew Clayton <[email protected]>
There were at least a couple of issues with building OTEL support. It only worked with GNU make due to the use of ifeq, even gmake had some issues. Debug builds were broken due to trying to pass --debug to cargo which is the default and isn't a valid option. This 'fixes' things by doing 'release' builds of OTEL by default. Passing D=1 to make will generate 'debug' builds but this as previously with D= etc, only works with GNU make. We make use of the '--emit link=' rustc option to place the libotel.a static library into build/lib This is good, it consolidates the static libraries into one place and it simplifies the build scripts. While we're at it pretty print the cargo command by default. Fixes: 9d3dcb8 ("otel: add build tooling to include otel code") Link: <nginx#1520 (comment)> Signed-off-by: Andrew Clayton <[email protected]>
857b85c
to
d0dbba3
Compare
|
Very good! Thank you so much! |
Failing checks are because we need to update for Ruby 3.4... |
This series of commits address a number of build issues with the OTEL support in Unit.
The first commit
f1afcf5b auto/otel: Make use of nxt_feature_name
fixes an issue with systems that don't have Linux's sched_getaffinity(2).The second commit
3b5542ed auto/make: s/NXT_OTEL_LIB_LOC/NXT_OTEL_LIB_STATIC/
is a preparatory cleanup patch that renames a variable to better match existing naming conventions.The third commit
e2c2c901 auto/make, otel: fix linking on macOS and Ubuntu
fixes an issue with how the OTEL static lib was being linked in. This is a patch from @thresheekThe fourth commit
e40a3ca8 auto/make: Add missing NXT_OTEL_LIB_STATIC to some C tests
fixes an issue with building some of the C tests, it's somewhat related to the above and is a patch from @remicolletThe fifth commit
99068620 auto/otel: don't look for OpenSSL on Darwin
fixes an issue with building OTEL on macOS. This is a patch from @thresheekThe sixth commit
0397301e auto/make: Make GNU make mandatory
fixes an issue with building OTEL with non-GNU make, by making GNU make mandatory (it's really the only sane path forward)