Re: Meson vs. Solaris

From: "Greg Burd" <greg(at)burd(dot)me>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Meson vs. Solaris
Date: 2026-02-07 21:58:45
Message-ID: f4ed5613-263c-4aeb-888a-d71aac85bfc4@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Sat, Feb 7, 2026, at 4:21 PM, Tom Lane wrote:
> I wondered why Greg Burd's new buildfarm animal "icarus" hasn't
> yet managed to complete a successful run.

Hi Tom!

Wow, thanks for taking a minute to dig into this. I have been putting off digging into my "animals" for too long, apologies for that. I had mentioned to Thomas that this was annoying and I needed to dig into it ASAP, but neither of us had great ideas off the top of our head so the fact that this was immediately recognizable to you is amazing.

> The symptoms suggest that getopt() isn't doing what we want:
>
> /scratch/build/HEAD/pgsql.build/tmp_install/scratch/build/HEAD/inst/bin/postgres:
> illegal option -- cluster-name=node1
> Try "postgres --help" for more information.
>
> But we have other BF animals running on OpenIndiana (Solaris)
> without trouble.
>
> On investigation, it seems that Greg is the first to try to use
> the meson build system on Solaris, and it doesn't work.

I tend to be a glutton for punishment of this variety...

> Our
> Autoconf infrastructure knows that we should use our own getopt()
> because Solaris's doesn't do what we want. meson.build did try
> to copy that logic:
>
> always_replace_getopt = host_system in ['windows', 'cygwin', 'openbsd',
> 'solaris']
>
> However, as seen elsewhere in that file, 'solaris' is not the
> value of host_system on this platform! It's 'sunos'. So we
> are trying to use the system's getopt(), and then the failure is
> completely expected.
>
> I've verified on a local OpenIndiana VM that the attached patch
> makes it work. Also, a quick grep doesn't find any other cases
> of the same error in our meson.build files.
>
> regards, tom lane

I'll find a bit of time to validate this on icarus ASAP. Thank you for the patch. I really have a sentimental/irrational attachment to Sun/SPARC/Solaris... er Illumos/OpenIndiana/whatever (says the ex-Sun employee).

I'll have you know that I'm likely to fool around with swapping out GCC for Clang 22 once the build starts working, just because... glutton for punishment. :)

best.

-greg

PS: greenfly and unicorn are on this weeks list for me too.

> diff --git a/meson.build b/meson.build
> index df907b62da3..96b3869df86 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2911,7 +2911,7 @@ gnugetopt_dep = cc.find_library('gnugetopt',
> required: false)
> # (i.e., allow '-' as a flag character), so use our version on those
> platforms
> # - We want to use system's getopt_long() only if the system provides
> struct
> # option
> -always_replace_getopt = host_system in ['windows', 'cygwin',
> 'openbsd', 'solaris']
> +always_replace_getopt = host_system in ['windows', 'cygwin',
> 'openbsd', 'sunos']
> always_replace_getopt_long = host_system in ['windows', 'cygwin'] or
> not cdata.has('HAVE_STRUCT_OPTION')
>
> # Required on BSDs
>
> Attachments:
> * solaris.patch

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-02-07 21:59:45 Re: Meson vs. Solaris
Previous Message Tom Lane 2026-02-07 21:21:31 Meson vs. Solaris