Re: Remove MSVC scripts from the tree

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Shubham Khanna <khannashubham1197(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove MSVC scripts from the tree
Date: 2023-12-19 16:44:48
Message-ID: CAN55FZ1MBJy+BpNDi7Zyti6Ta4oW1+vAAFNbZzXHSSOsdY1soA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, 19 Dec 2023 at 18:24, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> On 18.12.23 14:52, Peter Eisentraut wrote:
> >> 2) I had seen that if sed/gzip is not available meson build will fail:
> >> 2.a)
> >> Program gsed sed found: NO
> >> meson.build:334:6: ERROR: Program 'gsed sed' not found or not executable
> >
> > Yes, this would need to be improved. Currently, sed is only required if
> > either selinux or dtrace is enabled, which isn't supported on Windows.
> > But we should adjust the build scripts to not fail the top-level setup
> > run unless those options are enabled.
> >
> >> 2.b)
> >> Program gzip found: NO
> >> meson.build:337:7: ERROR: Program 'gzip' not found or not executable
> >
> > gzip is only required for certain test suites, so again we should adjust
> > the build scripts to not fail the build but instead skip the tests as
> > appropriate.
>
> Here are patches for these two issues. More testing would be appreciated.

0001-meson-Require-sed-only-when-needed:

+sed = find_program(get_option('SED'), 'sed', native: true,
+ required: get_option('dtrace').enabled() or
get_option('selinux').enabled())

dtrace is disabled as default but selinux is set to auto. So, meson
could find selinux ( because of the auto ) and fail to find sed, then
compilation will fail with:
contrib/sepgsql/meson.build:34:19: ERROR: Tried to use not-found
external program in "command"

I think we need to require sed when dtrace or selinux is found, not by
looking at the return value of the get_option().enabled().

Second patch looks good to me.

--
Regards,
Nazir Bilal Yavuz
Microsoft

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-12-19 16:44:52 Re: add non-option reordering to in-tree getopt_long
Previous Message Jacob Burroughs 2023-12-19 16:40:34 libpq compression (part 3)