Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u3H87-00DHbr-Lk for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Apr 2025 16:21:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u3H85-00Bnil-QF for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Apr 2025 16:21:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u3H85-00Bnid-AU for pgsql-hackers@lists.postgresql.org; Fri, 11 Apr 2025 16:21:21 +0000 Received: from dd25110.kasserver.com ([85.13.146.49]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u3H82-004GbY-1d for pgsql-hackers@postgresql.org; Fri, 11 Apr 2025 16:21:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=technowledgy.de; s=kas202308201259; t=1744388474; bh=Vjp5cCmxn3Fb2OGN5185hT5XPapEAL+m8XZwa8a2K3c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JXeysT/kf4MDzkZhcq27W++QGHe2ucMmckHb/XIPR1wScFmMJoeovOjRFRKcgM6wm evivFsSAFweg5cfYkPSuPJwVenAg3Ih1Q6wdPVp0x1GECR/BJ1dFoGUMAOy9ci0I/O jsV0DPwKPFDcMjq5e1p356f2JSIWRdB82q9FtGWmgMyUlRR3qu9FBN/QUeC4FK31aV zoFgIp6vi7wf1UVVfaSfhb17yuhQx5nuOezY/BNlAOdG5wKfPBh4YeeHrwwp+gKJCp f6VlzqecoQq2K+76kL0NLMPF2/3A70XUer4uhy1zd5MXcUstudH6BLmMQRCE03vUZI rDbnQeYb2Pfaw== Received: from [192.168.0.102] (ip-037-201-153-223.um10.pools.vodafone-ip.de [37.201.153.223]) by dd25110.kasserver.com (Postfix) with ESMTPSA id 7F1D6E1A0056; Fri, 11 Apr 2025 18:21:14 +0200 (CEST) Message-ID: <487dacec-6d8d-46c0-a36f-d5b8c81a56f1@technowledgy.de> Date: Fri, 11 Apr 2025 18:21:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER Content-Language: en-US To: Jacob Champion , Jelte Fennema-Nio Cc: Christoph Berg , Peter Eisentraut , Andres Freund , Tom Lane , Bruce Momjian , PostgreSQL Hackers , Daniel Gustafsson , Thomas Munro , Nazir Bilal Yavuz , Antonin Houska References: <5bec3d4f-613f-425b-88c4-59e71c70f7d6@eisentraut.org> From: Wolfgang Walther In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: + List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jacob Champion: > On Wed, Apr 9, 2025 at 4:42 PM Jelte Fennema-Nio wrote: >> I think your suggestion of not using any .so files would best there (from w user perspective). I'd be quite surprised if a static build still resulted in me having to manage shared library files anyway. > Done this way in v5. I had planned to separate the implementations by > a #define, but I ran into issues with Makefile.shlib, so I split the > shared and dynamic versions into separate files. I just now realized > that we do something about this exact problem in src/common, so I'll > see if I can copy its technique for the next go round. I tried to apply this patch to nixpkgs' libpq build [1]. First, I pinned a recent commit from master (one where the v5 patch will apply cleanly later) and enabled --with-libcurl [2]. At this stage, without the patch applied, I observe the following: 1. The default, dynamically linked, build succeeds and libpq.so is linked to libcurl.so as expected! 2. The statically linked build fails during configure:   checking for curl_multi_init in -lcurl... no   configure: error: library 'curl' does not provide curl_multi_init config.log tells me that it can't link to libcurl, because of undefined references, for example:   undefined reference to `psl_is_cookie_domain_acceptable'   undefined reference to `nghttp2_session_check_request_allowed' I assume the many libs listed in Libs.private in libcurl.pc are not added automatically for this check? Next, I applied the v5 patch and: 3. Running the same build as in step 1 above (dynamically linked), I can see that libpq.so does have some reference to dlopen / libpq-oauth in it - good. But libpq-oauth.so itself is not built. The commands I am using to build just the libpq package are essentially like this:   make submake-libpgport   make submake-libpq   make -C src/bin/pg_config install   make -C src/common install   make -C src/include install   make -C src/interfaces/libpq install   make -C src/port install I tried adding "make submake-libpq-oauth", but that doesn't exist. When I do "make -C src/interfaces/libpq-oauth", I get this error:   make: *** No rule to make target 'oauth-curl.o', needed by 'libpq-oauth-18.so'.  Stop. Not sure how to proceed to build libpq-oauth.so. 4. The statically linked build fails with the same configure error as above. I can only test autoconf right now, not meson - don't have a working setup for that, yet. Best, Wolfgang [1]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sql/postgresql/libpq.nix