public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: Remove MSVC scripts from the tree
Date: Wed, 8 Nov 2023 09:41:19 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

On 12.10.23 07:23, Michael Paquier wrote:
>> - Is src/backend/utils/README.Gen_dummy_probes still correct after this?
>> AFAICT, the Perl-based MSVC build system uses Gen_dummy_probes.pl, but the
>> meson build uses Gen_dummy_probes.sed even on Windows.  Is that correct,
>> intended?
> Interesting point.  This may depend on the environment at the end?  As
> far as I can see, sed is currently a hard requirement in the meson
> build and we'd fail if the command cannot be used.  The buildfarm
> machines that test meson are able to find sed, making
> Gen_dummy_probes.pl not necessary:
> https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=drongo&dt=2023-10-11%2020%3A21%3A1...
> 
> So the $1000 question is: could there be a point in keeping the perl
> script around if sed cannot be found?  The buildfarm coverage is
> currently saying no thanks to chocolatey, at least.  The VM images
> compiled by Andres for the CI seem to have the same opinion.

I don't think we should rely on sed being there on Windows.  Maybe it's 
true now on the handful of buildfarm/CI machines and early adopters, but 
do we have any indication that that is systematic or just an accident?

Since we definitely require Perl now, we could just as well use the Perl 
script and avoid this issue.

Attached is a Perl version of the sed script, converted by hand (so not 
the super-verbose s2p thing).  It's basically just the sed script with 
semicolons added and the backslashes in the regular expressions moved 
around.  I think we could use something like that for all platforms now.



Attachments:

  [text/x-perl-script] Gen_dummy_probes2.pl (1.2K, ../[email protected]/2-Gen_dummy_probes2.pl)
  download | inline:
#-------------------------------------------------------------------------
# Perl script to create dummy probes.h file when dtrace is not available
#
# Copyright (c) 2008-2023, PostgreSQL Global Development Group
#
# src/backend/utils/Gen_dummy_probes.pl
#-------------------------------------------------------------------------

use strict;
use warnings;

m/^[ 	]*probe / || next;
s/^[ 	]*probe ([^(]*)(.*);/$1$2/;
s/__/_/g;
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;
s/^/#define TRACE_POSTGRESQL_/;
s/\([^,)]{1,}\)/(INT1)/;
s/\([^,)]{1,}, [^,)]{1,}\)/(INT1, INT2)/;
s/\([^,)]{1,}, [^,)]{1,}, [^,)]{1,}\)/(INT1, INT2, INT3)/;
s/\([^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}\)/(INT1, INT2, INT3, INT4)/;
s/\([^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}\)/(INT1, INT2, INT3, INT4, INT5)/;
s/\([^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}\)/(INT1, INT2, INT3, INT4, INT5, INT6)/;
s/\([^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}\)/(INT1, INT2, INT3, INT4, INT5, INT6, INT7)/;
s/\([^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}, [^,)]{1,}\)/(INT1, INT2, INT3, INT4, INT5, INT6, INT7, INT8)/;
s/$/ do {} while (0)/;
print;
s/\(.*$/_ENABLED() (0)/;
print;

view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Remove MSVC scripts from the tree
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox