pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Solaris "sed" versus pre-v13 plpython tests
5+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2022-09-01 ec20545b20 cc0e506a64 02d060d0f7  Port regress-python3-mangle.mk to Solaris "sed", redux.
* Solaris "sed" versus pre-v13 plpython tests
@ 2022-08-31 22:25  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 5+ messages in thread

From: Tom Lane @ 2022-08-31 22:25 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org; +Cc: Noah Misch <noah@leadboat.com>; hofstetter@jomasoft.ch

I noticed that buildfarm member margay, which just recently started
running tests on REL_12_STABLE, is failing the plpython tests in that
branch [1], though it's happy in v13 and later.  The failures appear
due to syntax errors in Python "except" statements, and it's visible
in some of the tests that we are failing to convert ancient Python
"except" syntax to what Python 3 wants:

inline patch 1: /home/marcel/build-farm-14/buildroot/REL_12_STABLE/pgsql.build/src/pl/plpython/results/python3/plpython_types.out (+3/-1 lines) download inline-1.patchdiff -U3 /home/marcel/build-farm-14/buildroot/REL_12_STABLE/pgsql.build/src/pl/plpython/expected/python3/plpython_types_3.out /home/marcel/build-farm-14/buildroot/REL_12_STABLE/pgsql.build/src/pl/plpython/results/python3/plpython_types.out --- /home/marcel/build-farm-14/buildroot/REL_12_STABLE/pgsql.build/src/pl/plpython/expected/python3/plpython_types_3.out 2022-08-31 22:29:51.070597370 +0200 +++ /home/marcel/build-farm-14/buildroot/REL_12_STABLE/pgsql.build/src/pl/plpython/results/python3/plpython_types.out 2022-08-31 22:29:53.053544840 +0200 @@ -400,15 +400,16 @@ import marshal try: return marshal.loads(x) -except ValueError as e: +except ValueError, e: return 'FAILED: ' + str(e) $$ LANGUAGE plpython3u; +ERROR: could not compile PL/Python function "test_type_unmarshal" +DETAIL: SyntaxError: invalid syntax (<string>, line 6)
So it would seem that regress-python3-mangle.mk's sed command to perform this transformation isn't working on margay's sed. We've had to hack regress-python3-mangle.mk for Solaris "sed" before (cf commit c3556f6fa). This seems to be another instance of that same crummy implementation of '*' patterns. I suppose Noah missed this angle at the time because the problematic pattern had already been removed in v13 and up (45223fd9c). But it's still there in v12. I am not completely sure why buildfarm member wrasse isn't failing similarly, but a likely theory is that Noah has got some other sed in his search path there. I confirmed on the gcc farm's Solaris 11 box that the pattern doesn't work as expected with /usr/bin/sed: tgl@gcc-solaris11:~$ echo except foo, bar: | sed -e 's/except \([[:alpha:]][[:alpha:].]*\), *\([[:alpha:]][[:alpha:]]*\):/except \1 as \2:/g' except foo, bar: We could perhaps do this instead: $ echo except foo, bar: | sed -e '/^ *except.*,.*: *$/s/, / as /g' except foo as bar: It's a little bit more brittle, but Python doesn't allow any other commands on the same line does it? Another idea is to try to find some other sed to use. I see that configure already does that on most platforms, because ax_pthread.m4 has "AC_REQUIRE([AC_PROG_SED])". But if there's still someone out there using --disable-thread-safety, they might think this is an annoying movement of the build-requirements goalposts. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=margay&dt=2022-08-31%2020%3A00%3A05 ^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: Solaris "sed" versus pre-v13 plpython tests
@ 2022-09-01 00:57  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 5+ messages in thread

From: Tom Lane @ 2022-09-01 00:57 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org; +Cc: Noah Misch <noah@leadboat.com>; hofstetter@jomasoft.ch

I wrote:
> I confirmed on the gcc farm's Solaris 11 box that the pattern
> doesn't work as expected with /usr/bin/sed:

> tgl@gcc-solaris11:~$ echo except foo, bar: | sed -e 's/except \([[:alpha:]][[:alpha:].]*\), *\([[:alpha:]][[:alpha:]]*\):/except \1 as \2:/g'
> except foo, bar:

> We could perhaps do this instead:

> $ echo except foo, bar: | sed -e '/^ *except.*,.*: *$/s/, / as /g'
> except foo as bar:

> It's a little bit more brittle, but Python doesn't allow any other
> commands on the same line does it?

Oh ... after a bit more experimentation, there's an easier way.
Apparently the real problem is that Solaris' sed doesn't handle
[[:alpha:]] (I wonder if this is locale-dependent?).  I get
correct results after expanding it manually, eg

tgl@gcc-solaris11:~$ echo except foo, bar: | sed -e 's/except \([a-z][a-z.]*\), *\([a-z][a-zA-Z]*\):/except \1 as \2:/g'
except foo as bar:

We aren't likely to need anything beyond a-zA-Z and maybe 0-9,
so I'll go fix it that way.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Solaris "sed" versus pre-v13 plpython tests
@ 2022-09-01 04:25  Noah Misch <noah@leadboat.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 5+ messages in thread

From: Noah Misch @ 2022-09-01 04:25 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@lists.postgresql.org; hofstetter@jomasoft.ch

On Wed, Aug 31, 2022 at 06:25:01PM -0400, Tom Lane wrote:
> I am not completely sure why buildfarm member wrasse isn't failing
> similarly

wrasse disabled plpython in v12-, from day one, due to this and a crash bug
that I shelved.  I will be interested to see how margay reacts to your fix.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Solaris "sed" versus pre-v13 plpython tests
@ 2022-09-01 09:10  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Noah Misch <noah@leadboat.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2022-09-01 09:10 UTC (permalink / raw)
  To: Noah Misch <noah@leadboat.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers@lists.postgresql.org; hofstetter@jomasoft.ch

On 2022-Aug-31, Noah Misch wrote:

> On Wed, Aug 31, 2022 at 06:25:01PM -0400, Tom Lane wrote:
> > I am not completely sure why buildfarm member wrasse isn't failing
> > similarly
> 
> wrasse disabled plpython in v12-, from day one, due to this and a crash bug
> that I shelved.  I will be interested to see how margay reacts to your fix.

It turned green two hours ago.  Yay :-)

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Solaris "sed" versus pre-v13 plpython tests
@ 2022-09-03 15:43  Noah Misch <noah@leadboat.com>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Noah Misch @ 2022-09-03 15:43 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers@lists.postgresql.org; hofstetter@jomasoft.ch

On Thu, Sep 01, 2022 at 11:10:35AM +0200, Alvaro Herrera wrote:
> On 2022-Aug-31, Noah Misch wrote:
> 
> > On Wed, Aug 31, 2022 at 06:25:01PM -0400, Tom Lane wrote:
> > > I am not completely sure why buildfarm member wrasse isn't failing
> > > similarly
> > 
> > wrasse disabled plpython in v12-, from day one, due to this and a crash bug
> > that I shelved.  I will be interested to see how margay reacts to your fix.
> 
> It turned green two hours ago.  Yay :-)

Excellent.  I can no longer reproduce the crash bug, so I enabled plpython on
wrasse v10,v11,v12.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2022-09-03 15:43 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 22:25 Solaris "sed" versus pre-v13 plpython tests Tom Lane <tgl@sss.pgh.pa.us>
2022-09-01 00:57 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-09-01 04:25 ` Noah Misch <noah@leadboat.com>
2022-09-01 09:10   ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2022-09-03 15:43     ` Noah Misch <noah@leadboat.com>

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