On Thu Jun 29, 2023 at 2:17 PM CDT, Tristan Partin wrote:
> On Thu Jun 29, 2023 at 2:13 PM CDT, Andres Freund wrote:
> > Hi,
> >
> > On 2023-06-29 14:07:19 -0500, Tristan Partin wrote:
> > > I still think the overrides are important, at the very least for libpq,
> > > but I will defer to your aforementioned decision for now.
> >
> > libpq makes sense to me, fwiw. Just doing it for all binaries individually
> > didn't seem as obviously beneficial.
> >
> > FWIW, it seems it could be handled somewhat centrally for binaries, the
> > bin_targets array should have all that's needed?
>
> I will send a follow-up patch with at least libpq overridden. I will
> investigate the bin_targets.

Attached is a patch which does just that without overriding the
binaries. I investigated the bin_targets stuff, but some test
executables get added there, so it wouldn't work out that well.

-- 
Tristan Partin
Neon (https://neon.tech)
From b52a13d1575e4965e8c1794e7a62f24ecfeeb1cf Mon Sep 17 00:00:00 2001
From: Tristan Partin <tris...@neon.tech>
Date: Wed, 17 May 2023 10:36:52 -0500
Subject: [PATCH v6] Add Meson override for libpq

Meson has the ability to do transparent overrides when projects are used
as subprojects. For instance, say I am building a Postgres extension. I
can define Postgres to be a subproject of my extension given the
following wrap file:

[wrap-git]
url = https://git.postgresql.org/git/postgresql.git
revision = master
depth = 1

[provide]
dependency_names = libpq

Then in my extension (root project), I can have the following line
snippet:

libpq = dependency('libpq')

This will tell Meson to transparently compile libpq prior to it
compiling my extension (because I depend on libpq) if libpq isn't found
on the host system.
---
 src/interfaces/libpq/meson.build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index 80e6a15adf..6d18970e81 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -84,6 +84,8 @@ libpq = declare_dependency(
   include_directories: [include_directories('.')]
 )
 
+meson.override_dependency('libpq', libpq)
+
 pkgconfig.generate(
   name: 'libpq',
   description: 'PostgreSQL libpq library',
-- 
Tristan Partin
Neon (https://neon.tech)

Reply via email to