Opened 7 years ago

Closed 7 years ago

#2817 closed defect (fixed)

message "sed: command garbled: s/\([ \t]*-L\)[ ]*\([^ \t]*[ \t]*\)/\1\2/pg" on Solaris builds

Reported by: cas Owned by: jelte
Priority: medium Milestone: Sprint-20130319
Component: build system Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 3 Add Hours to Ticket: 0
Total Hours: 0.62 Internal?: no

Description

on Solaris (i86pc and SPARC), the configure script prints:

checking for python3.1 script directory... ${prefix}/lib/python3.1/site-packages
checking for python3.1 extension module directory... ${exec_prefix}/lib/python3.1/site-packages
sed: command garbled: s/\([ \t]*-L\)[ ]*\([^ \t]*[ \t]*\)/\1\2/pg
checking Python.h usability... yes
checking Python.h presence... yes

it might be that "configure" uses the wrong "sed" (Solaris sed instead of GNU sed).

Subtickets

Change History (12)

comment:1 Changed 7 years ago by jreed

I also see this on our solaris 10 build system.

It is related to ticket #2661 about removing any spaces and tabs between "-L" and its argument. Can it just be simplified like the following?

sed -e 's/-L[ ]/-L/g'

that is space and tab in the brackets. \t won't work here.

(and just assume that the python ldflags will never have some -L at end of an argument)

Last edited 7 years ago by jreed (previous) (diff)

comment:2 follow-up: Changed 7 years ago by muks

We should also find a way to use GNU sed if detected inside configure.ac. The call which causes the error above calls sed directly currently, whereas the Makefile.ams use $(SED).

comment:3 in reply to: ↑ 2 Changed 7 years ago by muks

Replying to muks:

We should also find a way to use GNU sed if detected inside configure.ac. The call which causes the error above calls sed directly currently, whereas the Makefile.ams use $(SED).

I say this because the reporter mentioned on Jabber that gsed was installed and available in the PATH.

comment:4 Changed 7 years ago by jelte

  • Milestone changed from New Tasks to Sprint-20130319

comment:5 Changed 7 years ago by jelte

  • Owner changed from UnAssigned to jelte
  • Status changed from new to assigned

comment:6 Changed 7 years ago by jelte

  • Owner changed from jelte to UnAssigned
  • Status changed from assigned to reviewing

it's actually not the regex itself it is tripping over, it's the modifier flags (/pg); I can't really find much documentation of this, except that for some other combination the order does indeed matter (and if that is true in this case too, p should be last anyway).

jelte@sol-10:~
> echo "-La -L b -Lc -L d" | sed -ne 's/\([ ]*-L\)[ ]*\([^ \t]*[ \t]*\)/\1\2/pg'
sed: command garbled: s/\([ ]*-L\)[ ]*\([^ \t]*[ \t]*\)/\1\2/pg
jelte@sol-10:~
> echo "-La -L b -Lc -L d" | sed -ne 's/\([ ]*-L\)[ ]*\([^ \t]*[ \t]*\)/\1\2/gp'
-La -L b -Lc -L d

Flipped them, and replaced all calls to sed with $(SED)

comment:7 Changed 7 years ago by vorner

  • Owner changed from UnAssigned to vorner

comment:8 Changed 7 years ago by vorner

  • Owner changed from vorner to jelte

The explanation makes kind of sense and I expect you did try it on the problematic machine.

Though, there's a problem that seems related. When I run configure, I get bunch of messages like this:
checking for python3.2 extension module directory... ${exec_prefix}/lib64/python3.2/site-packages
../configure: line 16184: 7317{SED}: command not found
Exception IOError: IOError(32, 'Broken pipe') in <_io.TextIOWrapper name='<stdout>' mode='w' encoding='ANSI_X3.4-1968'> ignored
../configure: line 16213: 7317{SED}: command not found
checking Python.h usability... yes

I guess the double dollar sign gets replaced by the current PID, which is not the best thing to do. Should that be single dollar?

comment:9 Changed 7 years ago by jelte

  • Owner changed from jelte to vorner

yes it should have been a single dollar, a last minute unchecked search&replace that went wrong :/ fixed now

comment:10 Changed 7 years ago by vorner

  • Owner changed from vorner to jelte

OK, then I think it can be merged.

With regards

comment:11 Changed 7 years ago by vorner

  • Total Hours changed from 0 to 0.62

comment:12 Changed 7 years ago by jelte

  • Resolution set to fixed
  • Status changed from reviewing to closed

thanks! merged, closing ticket

Note: See TracTickets for help on using tickets.