Thread

Commits

  1. meson: Improve PG_VERSION_STR generation

  1. Meson add host_system to PG_VERSION_STR

    Juan José Santamaría Flecha <juanjo.santamaria@gmail.com> — 2022-11-15T23:08:56Z

    Hello all,
    
    As mentioned here [1] it might be interesting to complete the returned
    information by version() when compiled with meson by including the
    host_system.
    
    [1]
    https://www.postgresql.org/message-id/20221115195318.5v5ynapmkusgyzks%40awork3.anarazel.de
    
    Regards,
    
    Juan José Santamaría Flecha
    
  2. Re: Meson add host_system to PG_VERSION_STR

    Michael Paquier <michael@paquier.xyz> — 2022-11-16T00:01:04Z

    On Wed, Nov 16, 2022 at 12:08:56AM +0100, Juan José Santamaría Flecha wrote:
    > As mentioned here [1] it might be interesting to complete the returned
    > information by version() when compiled with meson by including the
    > host_system.
    
    The meson build provides extra_version, which would be able to do the
    same, no?  The information would be appended to PG_VERSION_STR through
    PG_VERSION.
    --
    Michael
    
  3. Re: Meson add host_system to PG_VERSION_STR

    Peter Eisentraut <peter.eisentraut@enterprisedb.com> — 2022-11-16T09:50:54Z

    On 16.11.22 01:01, Michael Paquier wrote:
    > On Wed, Nov 16, 2022 at 12:08:56AM +0100, Juan José Santamaría Flecha wrote:
    >> As mentioned here [1] it might be interesting to complete the returned
    >> information by version() when compiled with meson by including the
    >> host_system.
    > 
    > The meson build provides extra_version, which would be able to do the
    > same, no?  The information would be appended to PG_VERSION_STR through
    > PG_VERSION.
    
    I think this is meant to achieve parity between the version strings 
    generated by configure and by meson.
    
    Perhaps some examples before and after on different platforms could be 
    shown.
    
    
    
    
    
  4. Re: Meson add host_system to PG_VERSION_STR

    Juan José Santamaría Flecha <juanjo.santamaria@gmail.com> — 2022-11-16T13:12:05Z

    On Wed, Nov 16, 2022 at 10:50 AM Peter Eisentraut <
    peter.eisentraut@enterprisedb.com> wrote:
    
    > On 16.11.22 01:01, Michael Paquier wrote:
    > >
    > > The meson build provides extra_version, which would be able to do the
    > > same, no?  The information would be appended to PG_VERSION_STR through
    > > PG_VERSION.
    >
    > I think this is meant to achieve parity between the version strings
    > generated by configure and by meson.
    >
    > Perhaps some examples before and after on different platforms could be
    > shown.
    >
    
    Yes, that would make clear what the patch is trying to do. For version() we
    get:
    
    Configure:
     PostgreSQL 16devel on x86_64-pc-linux-gnu, compiled by gcc (Debian
    6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
    
    Meson:
     PostgreSQL 16devel on x86_64, compiled by gcc-6.3.0
    
    Patched:
     PostgreSQL 16devel on x86_64-linux, compiled by gcc-6.3.0
    
    Regards,
    
    Juan José Santamaría Flecha
    
  5. Re: Meson add host_system to PG_VERSION_STR

    Andres Freund <andres@anarazel.de> — 2022-11-16T19:02:24Z

    Hi,
    
    On 2022-11-16 09:01:04 +0900, Michael Paquier wrote:
    > On Wed, Nov 16, 2022 at 12:08:56AM +0100, Juan José Santamaría Flecha wrote:
    > > As mentioned here [1] it might be interesting to complete the returned
    > > information by version() when compiled with meson by including the
    > > host_system.
    >
    > The meson build provides extra_version, which would be able to do the
    > same, no?  The information would be appended to PG_VERSION_STR through
    > PG_VERSION.
    
    I don't really follow: Including the operating system in PG_VERSION_STR,
    as we're doing in autoconf, seems orthogonal to extra_version? Adding linux
    into extra_version would result in linux showing up in e.g.
    SHOW server_version;
    which doesn't seem right.
    
    
    I think there's a further deficiency in the PG_VERSION_STR the meson build
    generates - we use the build system's CPU. Autoconf shows $host, not $build.
    
    
    For comparison, on my machine autoconf shows:
      PostgreSQL 16devel on x86_64-pc-linux-gnu, compiled by gcc-12 (Debian 12.2.0-9) 12.2.0, 64-bit
    whereas with meson we currently end up with
      PostgreSQL 16devel on x86_64, compiled by gcc-13.0.0
    
    I still don't think it makes sense to try to copy (or invoke)
    config.guess. Particularly when targetting windows, but even just having to
    keep updating config.guess in perpituity seems unnecessary.
    
    Given we're looking at improving this, should we also add 32/64-bit piece?
    
    If so, we probably should move building PG_VERSION_STR to later so we can use
    SIZEOF_VOID_P - configure.ac does that too.
    
    With extra_version set to -andres the attached results in:
    
    PostgreSQL 16devel-andres on x86_64-linux, compiled by gcc-13.0.0, 64-bit
    
    Greetings,
    
    Andres Freund
    
  6. Re: Meson add host_system to PG_VERSION_STR

    Juan José Santamaría Flecha <juanjo.santamaria@gmail.com> — 2022-11-16T21:32:47Z

    On Wed, Nov 16, 2022 at 8:02 PM Andres Freund <andres@anarazel.de> wrote:
    
    >
    > Given we're looking at improving this, should we also add 32/64-bit piece?
    >
    > If so, we probably should move building PG_VERSION_STR to later so we can
    > use
    > SIZEOF_VOID_P - configure.ac does that too.
    >
    > With extra_version set to -andres the attached results in:
    >
    > PostgreSQL 16devel-andres on x86_64-linux, compiled by gcc-13.0.0, 64-bit
    >
    
    WFM.
    
    Regards,
    
    Juan José Santamaría Flecha
    
  7. Re: Meson add host_system to PG_VERSION_STR

    Michael Paquier <michael@paquier.xyz> — 2022-11-17T02:35:52Z

    On Wed, Nov 16, 2022 at 02:12:05PM +0100, Juan José Santamaría Flecha wrote:
    > On Wed, Nov 16, 2022 at 10:50 AM Peter Eisentraut <
    > peter.eisentraut@enterprisedb.com> wrote:
    >> Perhaps some examples before and after on different platforms could be
    >> shown.
    > 
    > Yes, that would make clear what the patch is trying to do. For version() we
    > get:
    > 
    > Configure:
    >  PostgreSQL 16devel on x86_64-pc-linux-gnu, compiled by gcc (Debian
    > 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
    > 
    > Meson:
    >  PostgreSQL 16devel on x86_64, compiled by gcc-6.3.0
    > 
    > Patched:
    >  PostgreSQL 16devel on x86_64-linux, compiled by gcc-6.3.0
    
    Ah, thanks.  I was not following this point.  Adding the host
    information for consistency makes sense, indeed.
    --
    Michael
    
  8. Re: Meson add host_system to PG_VERSION_STR

    Juan José Santamaría Flecha <juanjo.santamaria@gmail.com> — 2022-12-09T13:53:10Z

    On Thu, Nov 17, 2022 at 3:35 AM Michael Paquier <michael@paquier.xyz> wrote:
    
    >
    > Ah, thanks.  I was not following this point.  Adding the host
    > information for consistency makes sense, indeed.
    >
    
    I've added an entry [1] in the commitfest so we don't miss this subject.
    
    [1] https://commitfest.postgresql.org/41/4057/
    
    Regards,
    
    Juan José Santamaría Flecha
    
  9. Re: Meson add host_system to PG_VERSION_STR

    Andres Freund <andres@anarazel.de> — 2022-12-09T16:58:20Z

    Hi,
    
    On 2022-12-09 14:53:10 +0100, Juan José Santamaría Flecha wrote:
    > I've added an entry [1] in the commitfest so we don't miss this subject.
    
    I indeed had forgotten. Pushed now.
    
    Greetings,
    
    Andres Freund