<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>189237</bug_id>
          
          <creation_ts>2018-09-03 02:36:02 -0700</creation_ts>
          <short_desc>Arguments passed to GNU &apos;sed&apos; by the postprocess header scripts are not accepted.</short_desc>
          <delta_ts>2018-09-03 02:36:02 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>iOS 10.3</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Trivial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="mbiddlecombe">biddlebugz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1456133</commentid>
    <comment_count>0</comment_count>
    <who name="mbiddlecombe">biddlebugz</who>
    <bug_when>2018-09-03 02:36:02 -0700</bug_when>
    <thetext>This is more a nit-pick than a bug.

The Mac OS build was failing for me.

There are two places where a sed transformation is applied to headers:

./Source/JavaScriptCore/postprocess-headers.sh @ line 92
./Source/WebKit/mac/postprocess-framework-headers.sh @ line 84

Inspecting the scripts, the intent is to create a backup file with a &apos;.tmp&apos; extension:

  sed -i .tmp -E &quot;${SED_OPTIONS[@]}&quot; &quot;${TARGET_TEMP_DIR}/${HEADER_PATH##*/}&quot; || exit $?

[Note the space between `sed -i` and `.tmp`]

On my system I have &apos;gnu-sed&apos; installed ahead of the system version and it fails with the following error: 

sed: can&apos;t read .tmp: No such file or directory

So the problem is self-inflicted.

Most of the manuals I could find for &apos;standard&apos; sed specify that the &apos;backup extension suffix&apos; syntax has the `-i` followed by the suffix without any whitespace.

&apos;/usr/bin/sed&apos; prints usage information that shows it expects the syntax with whitespace:

  &gt;/usr/bin/sed --usage
  /usr/bin/sed: illegal option -- -
  usage: sed script [-Ealn] [-i extension] [file ...]
         sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
       
Then I tested and the &apos;/usr/bin/sed&apos; version will also accept the &apos;no-space&apos; syntax. 

Simply removing the space got me past the problem:

  sed -i.tmp -E &quot;${SED_OPTIONS[@]}&quot; &quot;${TARGET_TEMP_DIR}/${HEADER_PATH##*/}&quot; || exit $?

I&apos;m not sure if this worth changing, it&apos;s been this way in the codebase for a long time as is. Searching the bugbase didn&apos;t show any related complaints.

The entire in-place &apos;-i&apos; option itself is non-standard; it doesn&apos;t show in the bare-bones definition: [https://www.unix.com/man-page/posix/1P/sed]</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>