Обсуждение: JIT works only partially with meson build?

Поиск
Список
Период
Сортировка

JIT works only partially with meson build?

От
Yugo Nagata
Дата:
Hi,

While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
generated with meson. Does this means that "inlining" of JIT doesn't
work when PostgreSQL is build with meson?

If so, is it better to describe that in the meson build and JIT sections in the
documentation so that users and packagers would except JIT doesn't work in the same
way when built with meson and autoconf/make?

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>



Re: JIT works only partially with meson build?

От
David Rowley
Дата:
On Mon, 26 May 2025 at 18:08, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
> generated with meson. Does this means that "inlining" of JIT doesn't
> work when PostgreSQL is build with meson?

Yes.  I believe [1] aims to fix this.

David

[1] https://commitfest.postgresql.org/patch/5671/



Re: JIT works only partially with meson build?

От
Laurenz Albe
Дата:
On Fri, 2025-06-27 at 16:19 +0900, Yugo Nagata wrote:
> On Mon, 26 May 2025 19:17:53 +1200
> David Rowley <dgrowleyml@gmail.com> wrote:
>
> > On Mon, 26 May 2025 at 18:08, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> > > While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
> > > generated with meson. Does this means that "inlining" of JIT doesn't
> > > work when PostgreSQL is build with meson?
> >
> > Yes.  I believe [1] aims to fix this.
> >
> > [1] https://commitfest.postgresql.org/patch/5671/
>
> Thank you for the clarification.
>
> I've attached a patch to update the documentation.
> I believe it's worth stating this explicitly, since the fix will not be
> applied until at the earliest PostgreSQL 19.

I think that it is a good idea to document this lack of functionality.

One thing stood out to me:

> --- a/doc/src/sgml/jit.sgml
> +++ b/doc/src/sgml/jit.sgml
> @@ -36,7 +36,8 @@
>     <acronym>JIT</acronym> compilation using <ulink
>     url="https://llvm.org/"><productname>LLVM</productname></ulink> when
>     <productname>PostgreSQL</productname> is built with
> -   <link linkend="configure-with-llvm"><literal>--with-llvm</literal></link>.
> +   <link linkend="configure-with-llvm"><literal>--with-llvm</literal></link>
> +   or <link linkend="configure-with-llvm-meson"><option>-Dllvm</option></link>.

You used the <option> tag, which I believe is correct, but the surrounding
code uses <literal>.  I don't think it renders differently, but I think it
would be good to use the same tag.  I suggest that you change the
surrounding code to use <option> as well.

v18 is already shipped, and we don't know if the patch to produce bitcode
with Meson will make v19 or not.  Consequently, I don't know if we should
apply the patch to git HEAD yet.  But I believe that it should be
backpatched to all older releases, since this is a shortcoming in the
documentation.

Yours,
Laurenz Albe



Re: JIT works only partially with meson build?

От
Yugo Nagata
Дата:
On Tue, 30 Sep 2025 14:04:13 +0200
Laurenz Albe <laurenz.albe@cybertec.at> wrote:

> On Fri, 2025-06-27 at 16:19 +0900, Yugo Nagata wrote:
> > On Mon, 26 May 2025 19:17:53 +1200
> > David Rowley <dgrowleyml@gmail.com> wrote:
> > 
> > > On Mon, 26 May 2025 at 18:08, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> > > > While building PostgreSQL 17 on Windows, I noticed bitcode files (.bc) are not
> > > > generated with meson. Does this means that "inlining" of JIT doesn't
> > > > work when PostgreSQL is build with meson?
> > > 
> > > Yes.  I believe [1] aims to fix this.
> > > 
> > > [1] https://commitfest.postgresql.org/patch/5671/
> > 
> > Thank you for the clarification.
> > 
> > I've attached a patch to update the documentation.
> > I believe it's worth stating this explicitly, since the fix will not be
> > applied until at the earliest PostgreSQL 19.
> 
> I think that it is a good idea to document this lack of functionality.

Thank you for taking a look at it.

> One thing stood out to me:
> 
> > --- a/doc/src/sgml/jit.sgml
> > +++ b/doc/src/sgml/jit.sgml
> > @@ -36,7 +36,8 @@
> >     <acronym>JIT</acronym> compilation using <ulink
> >     url="https://llvm.org/"><productname>LLVM</productname></ulink> when
> >     <productname>PostgreSQL</productname> is built with
> > -   <link linkend="configure-with-llvm"><literal>--with-llvm</literal></link>.
> > +   <link linkend="configure-with-llvm"><literal>--with-llvm</literal></link>
> > +   or <link linkend="configure-with-llvm-meson"><option>-Dllvm</option></link>.
> 
> You used the <option> tag, which I believe is correct, but the surrounding
> code uses <literal>.  I don't think it renders differently, but I think it
> would be good to use the same tag.  I suggest that you change the
> surrounding code to use <option> as well.

Agreed. I fixed it to use <option>, as well as in other place where I think
<option> is appropriate. Please find the attached patch.

> v18 is already shipped, and we don't know if the patch to produce bitcode
> with Meson will make v19 or not.  Consequently, I don't know if we should
> apply the patch to git HEAD yet.  But I believe that it should be
> backpatched to all older releases, since this is a shortcoming in the
> documentation.

+1.

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>

Вложения

Re: JIT works only partially with meson build?

От
Laurenz Albe
Дата:
On Tue, 2025-09-30 at 22:31 +0900, Yugo Nagata wrote:
> > You used the <option> tag, which I believe is correct, but the surrounding
> > code uses <literal>.  I don't think it renders differently, but I think it
> > would be good to use the same tag.  I suggest that you change the
> > surrounding code to use <option> as well.
>
> Agreed. I fixed it to use <option>, as well as in other place where I think
> <option> is appropriate. Please find the attached patch.

I'll mark it "eeady for committer".  A committer can decide whether to apply
this to HEAD or not.  I probably would, and revert it if PostgreSQL + Meson +
Windows learns to produce bitcode.

Yours,
Laurenz Albe