[MacPorts] #63359: Trace mode causes anything piped to sed from within csh to output the sed executable

MacPorts noreply at macports.org
Thu Aug 12 05:11:31 UTC 2021


#63359: Trace mode causes anything piped to sed from within csh to output the sed
executable
------------------------+--------------------
 Reporter:  ryandesign  |      Owner:  (none)
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  base        |    Version:  2.7.99
 Keywords:  highsierra  |       Port:
------------------------+--------------------
 When trace mode is enabled, piping anything to the sed executable causes
 the contents of the sed executable to be printed rather than the desired
 output. This causes, for example, the magic port to fail to build, because
 part of its build process uses a csh script which sets a variable which is
 composed by piping output to sed.


 Using the attached test [attachment:Portfile], when using trace mode
 (`sudo port -dnt configure`) the beginning of the configure output is:

 {{{
 DEBUG: Executing org.macports.configure (test)
 DEBUG: system: /bin/csh -c 'echo hello world | sed'
 E1íE¾E

 ˆŒ°îÿÿHÿÀAŠL
 uèIÅL‰­À÷ÿÿƄ°îÿÿ





 H‰Ú„¸
 Aˆ
   $IÿÄE1íŠJHÿ„ÉH‰ÓuÁL+¥îÿÿM܋tîÿÿ‰ÈM‰çD)
 }}}

 This is the contents of the sed executable, which I know because later
 output includes:

 {{{
 $FreeBSD: src/usr.bin/sed/compile.c,v 1.28 2005/08/04 10:05:11 dds Exp $
 }}}

 This string appears within the sed executable:

 {{{
 $ grep 'src/usr.bin/sed/compile.c,v 1.28 2005/08/04' /usr/bin/sed
 Binary file /usr/bin/sed matches
 }}}

 When trace mode is not enabled, it works correctly. Configure output
 without trace mode (`sudo port -dn configure`) is:

 {{{
 DEBUG: Executing org.macports.configure (test)
 DEBUG: system: /bin/csh -c 'echo hello world | sed'
 hello world
 Error: Failed to configure test.
 }}}

 This is behaving correctly: sed has passed through the "hello world"
 string which was echoed to it.

-- 
Ticket URL: <https://trac.macports.org/ticket/63359>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list