Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9A8B-0007m7-JG for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jun 2023 19:56:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q9A8A-0007ZB-G3 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Jun 2023 19:56:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9A8A-0007YU-0r for pgsql-hackers@lists.postgresql.org; Tue, 13 Jun 2023 19:56:42 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q9A86-0021jj-VT for pgsql-hackers@postgresql.org; Tue, 13 Jun 2023 19:56:40 +0000 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6b28fc460bcso3696433a34.1 for ; Tue, 13 Jun 2023 12:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1686686198; x=1689278198; h=in-reply-to:references:message-id:from:to:subject:cc:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HUTcUNYUSl3fUgvaVNOxG3xssjFMNkTtA54lGFd/btc=; b=qUkaYtJBPBijw8Ki8W3O6sKfh7GDIvmJXv21l7UbJDe6XlciZe9KwsHP+X9NvcqX/z 8jm3kDg34Edju2VkLsEqQZhM0V3m9aHBfE9kNwSIPaYIYIhw4bLoBCsk2ZQ6VezE81fy 4yoEPhOANPtI3dS+j+BRDtA1vqZexZIwoFeiFTvdp+DvwpRb0sLsuYUQDTsj0Qs10lYh 8ov8JbSsSR5Imdpueaeb5Z2PU7axR+BCMEGtmdNku/ngZIq70lyUwcNor3RTP6KlLw0T /wXihVEgZ6mQxCPicnpUv07Iyu6kk6S0IdsWBGgghxqus14tF31Ip3Ygb6VoP0N7/p0U bm8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686686198; x=1689278198; h=in-reply-to:references:message-id:from:to:subject:cc:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=HUTcUNYUSl3fUgvaVNOxG3xssjFMNkTtA54lGFd/btc=; b=Sk/IxWnLHk+YjBXCKPU8fIbKccuI3o5enCSeEIDNtU6XS9VExLmJk6sQv3kFt+O6Yo MojmU94CCAo+/YLiJHYozbDVcCuGPn0k+VwHFiYIBW1eqQ3J2RgwoQcHIq8oAqVpehHW qPAnGdAcW15mnqL41lCGIs8IFrNY/i/9ldAnfw9rOrLg02CHF90HCJxoocnT1qzP/Qy1 Y+L51xsGB57FTXCbsA2LIohz/mqkkc+GjDtWdRfN+t+7kaX881YToL7KMjxesYgFblE2 8Xh5F7lWpJjk4nwOxuqDXXx0Iyu3/dO1NXisBXfYbUw+jqI3nUFbZrxXC7Y16lBMuZLF ty/A== X-Gm-Message-State: AC+VfDw8o00Bmq6z8RZJt3xumt8Zd42w9H+SZYwPWoiJC1ayhhw9BHmO /4mlKEHMzfcZNu13GkaXH8pSC+7cGN43l+wO5Zo= X-Google-Smtp-Source: ACHHUZ4lRqWFyyCkTKYJ6JOESTUrRc93FyQ9SNzpAr/+PS6vdKDVY9Mbvz5popEceuB8Zywk+pQPYA== X-Received: by 2002:a9d:7acb:0:b0:6b0:73fe:cf10 with SMTP id m11-20020a9d7acb000000b006b073fecf10mr10434819otn.5.1686686198248; Tue, 13 Jun 2023 12:56:38 -0700 (PDT) Received: from localhost ([2607:fb90:e696:c1dc:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id d23-20020a056830139700b006ac98aae2d3sm5247516otq.40.2023.06.13.12.56.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Jun 2023 12:56:37 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 13 Jun 2023 14:56:36 -0500 Cc: Subject: Re: Meson build updates To: "Andres Freund" From: "Tristan Partin" Message-Id: X-Mailer: aerc 0.15.2-46-g263d8cbec504 References: <20230609164135.77fjwqkqzdxfs3f5@awork3.anarazel.de> <20230609183603.o56z3ngtak6qhb3s@awork3.anarazel.de> In-Reply-To: <20230609183603.o56z3ngtak6qhb3s@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri Jun 9, 2023 at 1:36 PM CDT, Andres Freund wrote: > On 2023-06-09 13:15:27 -0500, Tristan Partin wrote: > > On Fri Jun 9, 2023 at 11:41 AM CDT, Andres Freund wrote: > > > > From 189d3ac3d5593ce3e475813e4830a29bb4e96f70 Mon Sep 17 00:00:00 2= 001 > > > > From: Tristan Partin > > > > Date: Wed, 17 May 2023 10:36:52 -0500 > > > > Subject: [PATCH postgres v1 16/17] Add Meson overrides > > > >=20 > > > > Meson has the ability to do transparent overrides when projects are= used > > > > as subprojects. For instance, say I am building a Postgres extensio= n. I > > > > can define Postgres to be a subproject of my extension given the > > > > following wrap file: > > > >=20 > > > > [wrap-git] > > > > url =3D https://git.postgresql.org/git/postgresql.git > > > > revision =3D master > > > > depth =3D 1 > > > >=20 > > > > [provide] > > > > dependency_names =3D libpq > > > >=20 > > > > Then in my extension (root project), I can have the following line > > > > snippet: > > > >=20 > > > > libpq =3D dependency('libpq') > > > >=20 > > > > This will tell Meson to transparently compile libpq prior to it > > > > compiling my extension (because I depend on libpq) if libpq isn't f= ound > > > > on the host system. > > > >=20 > > > > I have also added overrides for the various public-facing exectuabl= es. > > > > Though I don't expect them to get much usage, might as well go ahea= d and > > > > override them. They can be used by adding the following line to the > > > > aforementioned wrap file: > > > > > > I think adding more boilerplate to all these places does have some co= st. So > > > I'm not really convinced this is worth doign. > >=20 > > Could you explain more about what costs you foresee? > > Repetitive code that needs to be added to each further binary we add. I d= on't > mind doing that if it has a use case, but I'm not sure I see the use case= for > random binaries... I was thinking today. When you initially wrote the build, did you try using the src/bin/meson.build file as the place where all the binaries were built? As you say, most of the src/bin/xxx/meson.build files are extrememly reptitive. We had a similar-ish issue in my last project which I solved like: https://github.com/hse-project/hse/blob/master/tools/meson.build#L20-L405 This is a pattern I used quite frequently in that project. One benefit of this approach is that the binaries all end up next to each other in the build tree which is eventually how they'll be laid out in the install destination. The other benefit is of course reducing reptitive code. - ./build/src/bin/psql/psql + ./build/src/bin/psql Let me know what you think. --=20 Tristan Partin Neon (https://neon.tech)