Re: meson vs. llvm bitcode files

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Diego Fronza <diego(dot)fronza(at)percona(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: meson vs. llvm bitcode files
Date: 2025-03-13 10:11:44
Message-ID: CAN55FZ1fWtTpcL3ytJioZWt78oMsCyV5ivKho-pO-EJzvQSWXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, 12 Mar 2025 at 16:39, Diego Fronza <diego(dot)fronza(at)percona(dot)com> wrote:
>
> Hi,
>
> The v7 patch looks good to me, handling the bitcode modules in a uniform way and also avoiding the hacky code and warnings, much better now.
>
> A small note about the bitcode emission for generated sources in contrib, using cube as example, currently it creates two dict entries in a list:
> bc_seg_gen_sources = [{'srcfiles': [seg_scan]}]
> bc_seg_gen_sources += {'srcfiles': [seg_parse[0]]}
>
> Then pass it to the bitcode_modules:
> bitcode_modules += {
> ...
> 'gen_srcfiles': bc_seg_gen_sources,
> }
>
> It could be passed as a list with a single dict, since both generated sources share the same compilation flags:
> bitcode_modules += {
> ...
> 'gen_srcfiles': [
> { 'srcfiles': [cube_scan, cube_parse[0]] }.
> ]
> }
>
> Both approaches work, the first one has the advantage of being able to pass separate additional_flags per generated source.

I liked the current approach as it makes bitcode_modules easier to
understand but both approaches work for me as well.

One thing I noticed is that gen_srcfiles['srcfiles'] seems wrong.
gen_sources is a better name compared to gen_srcfiles. So, I changed
it to gen_sources in v4.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment Content-Type Size
v4-0001-meson-Add-generated-header-stamps.patch text/x-patch 5.0 KB
v4-0002-meson-Add-postgresql-extension.pc-for-building-ex.patch text/x-patch 4.5 KB
v4-0003-meson-Test-building-extensions-by-using-postgresq.patch text/x-patch 10.7 KB
v4-0004-meson-WIP-Add-docs-for-postgresql-extension.pc.patch text/x-patch 12.3 KB
v4-0005-meson-Add-architecture-for-LLVM-bitcode-emission.patch text/x-patch 9.0 KB
v4-0006-meson-Add-LLVM-bitcode-emissions-for-contrib-libr.patch text/x-patch 22.6 KB
v4-0007-meson-Add-LLVM-bitcode-emission-for-backend-sourc.patch text/x-patch 5.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2025-03-13 10:53:03 Re: AIO v2.5
Previous Message Kirill Reshke 2025-03-13 10:01:46 Re: Parallel safety docs for CTEs