On Fri, Aug 8, 2025 at 2:31 PM Jacob Champion <jacob.champ...@enterprisedb.com> wrote: > Well, thank you for the explanation. I'll make that change.
Done in v5. v5-0001 is planned for backport to 18 once the freeze lifts. It ensures that -lm is part of the link line for libpq-oauth, since the module uses floor(). I probably wouldn't have ever noticed, except that the new test executable, which uses the same link flags, complained on Clang [1]. (In that thread, I incorrectly said the problem was with "Meson animals". The Meson side is fine, and both alligator and bushmaster use Autoconf, so I'm not sure how I ended up with that idea.) v5-0002 should fix the more general buildfarm failure that caused the revert. The farm finds the new t/ subdirectory and starts running Make on src/interfaces/libpq-oauth directly, bypassing the skip logic in src/interfaces/Makefile. So I've wrapped the "standard" top-level targets that build and install things in a conditional. The targets that clean things up have been left alone, at Tom's suggestion in [1]. Thanks, --Jacob [1] https://postgr.es/m/CAOYmi%2Bm%3DxY0P_uAzAP_884uF-GhQ3wrineGwc9AEnb6fYxVqVQ%40mail.gmail.com
1: a515435d3b4 < -: ----------- oauth: Remove stale events from the kqueue multiplexer 2: a34be19f17f < -: ----------- oauth: Ensure unused socket registrations are removed 3: 7408778d579 < -: ----------- oauth: Remove expired timers from the multiplexer 4: 8241255e84c < -: ----------- oauth: Track total call count during a client flow -: ----------- > 1: c9962268ef0 oauth: Always link with -lm for floor() 5: 337124064f3 ! 2: 2e36b329c76 oauth: Add unit tests for multiplexer handling @@ Commit message suite for the socket and timer handling code. This is all based on TAP and driven by our existing Test::More infrastructure. + This commit is a replay of 1443b6c0e, which was reverted due to + buildfarm failures. Compared with that, this version protects the build + targets in the Makefile with a with_libcurl conditional, and it tweaks + the code style in 001_oauth.pl. + Reviewed-by: Dagfinn Ilmari Mannsåker <ilm...@ilmari.org> Discussion: https://postgr.es/m/caoymi+ndzxjhawj9_jrsyf8umtocadamofjeggskw-ky7au...@mail.gmail.com ## src/interfaces/libpq-oauth/Makefile ## -@@ src/interfaces/libpq-oauth/Makefile: uninstall: - rm -f '$(DESTDIR)$(libdir)/$(stlib)' - rm -f '$(DESTDIR)$(libdir)/$(shlib)' +@@ src/interfaces/libpq-oauth/Makefile: SHLIB_EXPORTS = exports.txt + # Disable -bundle_loader on macOS. + BE_DLLLIBS = + +-# By default, a library without an SONAME doesn't get a static library, so we +-# add it to the build explicitly. +-all: all-lib all-static-lib +- + # Shared library stuff + include $(top_srcdir)/src/Makefile.shlib + +@@ src/interfaces/libpq-oauth/Makefile: include $(top_srcdir)/src/Makefile.shlib + %_shlib.o: %.c %.o + $(CC) $(CFLAGS) $(CFLAGS_SL) $(CPPFLAGS) $(CPPFLAGS_SHLIB) -c $< -o $@ +.PHONY: all-tests +all-tests: oauth_tests$(X) @@ src/interfaces/libpq-oauth/Makefile: uninstall: +oauth_tests$(X): test-oauth-curl.o oauth-utils.o $(WIN32RES) | submake-libpgport submake-libpq + $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(SHLIB_LINK) -o $@ + ++# ++# Top-Level Targets ++# ++# The existence of a t/ folder induces the buildfarm to run Make directly on ++# this subdirectory, bypassing the recursion skip in src/interfaces/Makefile. ++# Wrap the standard build targets in a with_libcurl conditional to avoid ++# building OAuth code on platforms that haven't requested it. (The "clean"-style ++# targets remain available.) ++# ++ ++ifeq ($(with_libcurl), yes) ++ ++# By default, a library without an SONAME doesn't get a static library, so we ++# add it to the build explicitly. ++all: all-lib all-static-lib ++ + # Ignore the standard rules for SONAME-less installation; we want both the + # static and shared libraries to go into libdir. + install: all installdirs $(stlib) $(shlib) +@@ src/interfaces/libpq-oauth/Makefile: install: all installdirs $(stlib) $(shlib) + installdirs: + $(MKDIR_P) '$(DESTDIR)$(libdir)' + +check: all-tests + $(prove_check) + +installcheck: all-tests + $(prove_installcheck) + ++endif # with_libcurl ++ + uninstall: + rm -f '$(DESTDIR)$(libdir)/$(stlib)' + rm -f '$(DESTDIR)$(libdir)/$(shlib)' + clean distclean: clean-lib rm -f $(OBJS) $(OBJS_STATIC) $(OBJS_SHLIB) + rm -f test-oauth-curl.o oauth_tests$(X) @@ src/interfaces/libpq-oauth/t/001_oauth.pl (new) +my $err = $builder->failure_output; + +IPC::Run::run ['oauth_tests'], -+ '>', IPC::Run::new_chunker, sub { $out->print($_[0]) }, -+ '2>', IPC::Run::new_chunker, sub { $err->print($_[0]) } ++ '>' => (IPC::Run::new_chunker, sub { $out->print($_[0]) }), ++ '2>' => (IPC::Run::new_chunker, sub { $err->print($_[0]) }) + or die "oauth_tests returned $?"; ## src/interfaces/libpq-oauth/test-oauth-curl.c (new) ##
v5-0001-oauth-Always-link-with-lm-for-floor.patch
Description: Binary data
v5-0002-oauth-Add-unit-tests-for-multiplexer-handling.patch
Description: Binary data