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.96) (envelope-from ) id 1vZFpv-006l0b-2N for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Dec 2025 21:59:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vZFpu-00AIc6-2G for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Dec 2025 21:59:03 +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.96) (envelope-from ) id 1vY4Ca-001uMx-1G for pgsql-hackers@lists.postgresql.org; Tue, 23 Dec 2025 15:21:33 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vY4CZ-002CjE-2M for pgsql-hackers@lists.postgresql.org; Tue, 23 Dec 2025 15:21:32 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-595819064cdso8227635e87.0 for ; Tue, 23 Dec 2025 07:21:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766503289; x=1767108089; darn=lists.postgresql.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=XTunxjRqlDycWdzgBzgLZ6Ny0l/4iPXekrXJmEDVTMo=; b=b21T4HkSuElR9tFdGtr2v4wib9+VaeRqT1DuF1Nv0mwK7M5wQU13Lw1wD++ohV+iig df2m7FGq9yxvEJ9QQ8J0c/aOZHvmLh/hYptRvqYpJb3Wn5bb5UZqEAQW7J/Ba19t6OzC XI4ON9MrwUneboe80/1OSBxEAQEXdlPfmsx6k+rnYe/Wz1Lfnbj1hw6yjTq+5KlNF6yf iK5qEb5WMxzGldJH+esC/WAoXM8M1sTmky9YbX2TZYsHEp9lwgicmWlIgdBdCK7Ky9F+ u1ffRKYuJwFWOT3GddYdBLrrzF6vjWRwRhMBuPePoWPj5c2uTknS3I2eONUj3GaPOg0H HAnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766503289; x=1767108089; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XTunxjRqlDycWdzgBzgLZ6Ny0l/4iPXekrXJmEDVTMo=; b=qI3oecWPSnStzvmXHQa4tOArEs5rlY19ot44TOyFUBKoHDrcEAS3CJIiD2kCA/t+j3 +WVSuaeL8ClsymllfghrCxQLYKTkYMtQcTvSb/13JxW72jjk6S0fF/3iId4khFXbpERy I6t4Fjr7h2A7sWN1zgJB7sgRCBvgnT3YNMgdDg3AelmLDnVoz2u5tHWdJTc4wWuVY8OT 4dL2QSlpFooq13PpYx9mrG4a8hV4tjKuOB64hSQAqrDAzA+pYuZFvLfC56AGEiCvzOY0 4eqirNk5JJTq6Z8Qix0a9G59+s6HQaAgFo8EZIS+UtW3bRRFlwr6tO3MewYNWlqq15NY xjaA== X-Gm-Message-State: AOJu0YzaguPcfS8bXdiScBhGRJbCij9BJFmR0WKARUyYWKzy8qdCPLj+ kbU3VeFAWky/KsLltqflmL9+yPV7MVY11haUGk7dLI4Gjdn/hBXne2dNyWnI+Uws X-Gm-Gg: AY/fxX4s+NZZexxfQHpEBbSOIx+9uX2IuQSHSpK8MLf3MUoYDbdpNzRLdzYaqKHETmH ZCL+uB5nTbRlZJS6sa0JXjt4mc/2W+36/udFkZsQu45rMup8XAx7bZjyu0fF7DnxApHDi9KrzEE dKOMcOxfH/YQ68/IXVsvhR9zRqZzJx2KR7EKyGst0loeMBGrJdhgRRuY0Xt5wn9MGzU0NB0DlIE 0DQzcxp/0S6zGmb3Hjh+aHMPm1ZfLbI/3NFfa+YbPUB9Ip0uOpw/yoBUUSskkEJNI6u18FxvFw3 MmYT6o0kn7Gsjh1o/KHh1nAifP/M15ZoTUEZ2LaPQ53rR+5NZOLg03Rs5bc1LK/nFXY4cqWlCeB 1Ul8rpVkdauNAEgJUqLUjyZronPWEvYicfEQZZsM08btU27nbRc/7UCydln6q4mZ5yxtNoUh7 X-Google-Smtp-Source: AGHT+IHZSlq9BazCtYsocL5XpwSHeqdMntE1KcoiB/DmdPwQ+qN/34Y2IAnoYjB/a/dZI+kJCdronQ== X-Received: by 2002:a05:6512:3e04:b0:594:2d64:bce9 with SMTP id 2adb3069b0e04-59a17d042fdmr4878943e87.4.1766503289169; Tue, 23 Dec 2025 07:21:29 -0800 (PST) Received: from smtpclient.apple ([91.217.194.24]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59a18618d07sm4196523e87.62.2025.12.23.07.21.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Dec 2025 07:21:28 -0800 (PST) From: Niyaz Hazigaleyev Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Use Postgres as meson wrap subproject Message-Id: Date: Tue, 23 Dec 2025 18:21:16 +0300 To: pgsql-hackers@lists.postgresql.org X-Mailer: Apple Mail (2.3826.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk It is not possible to use Postgres as meson wrap subproject at least out = of box. But I think it can be easily fixed. I made a small patch for = libpq and it works. There were two problems, first is catalog header = generator using @SOURCE_DIR@ as root for paths, which will use main root = project as source dir, so I just changed it to = meson.project_source_root(). Second was that libpq dependency = include_directories had no dependent headers(for example postgres_ext.h) = so I just used include_directories that were also used in libpq_so, = libpq_st. So the patch looks like this for commit = 955f5506863dce0a3416e3fae7c3297dbbaa946d:=20 diff --git a/src/include/catalog/meson.build = b/src/include/catalog/meson.build index ec1cf46..2b12e8e 100644 --- a/src/include/catalog/meson.build +++ b/src/include/catalog/meson.build @@ -136,7 +136,7 @@ generated_catalog_headers =3D = custom_target('generated_catalog_headers', command: [ perl, files('../../backend/catalog/genbki.pl'), - '--include-path=3D@SOURCE_ROOT@/src/include', + '--include-path=3D' + (meson.project_source_root() / = 'src/include'), '--set-version=3D' + pg_version_major.to_string(), '--output=3D@OUTDIR@', '@INPUT@' ], diff --git a/src/interfaces/libpq/meson.build = b/src/interfaces/libpq/meson.build index b259c99..51e051f 100644 --- a/src/interfaces/libpq/meson.build +++ b/src/interfaces/libpq/meson.build @@ -82,7 +82,7 @@ libpq_so =3D shared_library('libpq', =20 libpq =3D declare_dependency( link_with: [libpq_so], - include_directories: [include_directories('.')] + include_directories: [libpq_inc, postgres_inc] ) =20 # Check for functions that libpq must not call. See libpq_check.pl for = the Example of wrap file that applies patch: [wrap-git] url =3D https://git.postgresql.org/git/postgresql.git revision =3D 955f5506863dce0a3416e3fae7c3297dbbaa946d depth =3D 1 diff_files =3D postgres/libpq.patch [provide] libpq =3D libpq So to use Postgres as wrap subproject u need to change @SOURCE_DIR@ to = meson.project_source_root() and check include_directories for all = dependencies. Is there any plans to support it?=