On Mon, Apr 7, 2025 at 10:05 AM Andres Freund <and...@anarazel.de> wrote: > On 2025-04-07 09:41:25 -0700, Jacob Champion wrote: > > Ah, you mean if the RPATH'd build doesn't have a flow, but the > > globally installed one (with a different ABI) does? Yeah, that would > > be a problem. > > That and more: Even if the RPATH libpq does have oauth support, the > libpq-oauth won't necessarily be at the front of the global library search > path. So afaict you'll often get a different libpq-oauth.
ldopen() should respect RPATH, though? Either way, I agree with pushing the minor version into the name (or else deciding that we will keep the ABI completely stable across minor version bumps; not sure I want to guarantee that just yet). > > We can do it however we want, honestly, especially since the ABI isn't > > public/stable. I chose this way just to ease review. > > I found it rather confusing that libpq looks up a symbol and then sets > libpq-oauth's symbol to a pointer in libpq's namespace. Yeah, I think a one-time init call would make this nicer. > > A future simplification could be to pull the use of the threadlock > > back into libpq, and have it perform a one-time > > dlopen-plus-Curl-initialization under the lock... That would also get > > rid of the dlerror() thread safety problems. But that's an awful lot > > of moving parts under a mutex, which makes me a little nervous. > > I still think we should simply reject at configure time if curl init isn't > threadsafe ;) Practically speaking, I don't think that's a choice we can make. For example, RHEL won't have threadsafe Curl until 10. > > Could you explain how this is related to .app bundles? I thought I was > > just building a standard dylib. > > The other kind of bundles (what on earth apple was thinking with the naming > here I don't know). Stuff liked with ld -bundle. Ah, some new corner-case magic to learn... > These days we use compiler flags > that restrict function visibility of everything not annotated with > PGDLLEXPORT. Hm, I missed/forgot that. That is nice. Personally I like having a single file document the exports, so I'll keep it that way for now unless there are objections, but it's good to know it's not necessary. Thanks, --Jacob