Re: Meson add host_system to PG_VERSION_STR

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Meson add host_system to PG_VERSION_STR
Date: 2022-11-16 19:02:24
Message-ID: 20221116190224.tt7bz3gaos4zp5oi@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
version.diff text/x-diff 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-11-16 19:19:32 Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)
Previous Message Peter Eisentraut 2022-11-16 18:59:09 locale -a missing on Alpine Linux?