<?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>212500</bug_id>
          
          <creation_ts>2020-05-28 16:04:23 -0700</creation_ts>
          <short_desc>REGRESSION (r262245): WebCore&apos;s &quot;Check .xcfilelists&quot; build phase is ~100x slower</short_desc>
          <delta_ts>2020-05-29 12:37:24 -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>Tools / Tests</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>212451</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=212420</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>212451</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andy Estes">aestes</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aestes</cc>
    
    <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>krollin</cc>
    
    <cc>ryanhaddad</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1657072</commentid>
    <comment_count>0</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2020-05-28 16:04:23 -0700</bug_when>
    <thetext>Prior to &lt;https://trac.webkit.org/r262245&gt;, when building the &apos;All Source&apos; scheme in WebKit.xcworkspace, WebCore&apos;s &quot;Check.xcfilelists&quot; build phase took ~1 second. With r262245, it takes ~95 seconds.

Modifying Source/WebCore/Scripts/check-xcfilelists.sh to invoke generate-xcfilelists with the &quot;--debug&quot; flag, I see that almost all the time is spent in a subshell invoking Source/WebCore/Scripts/generate-derived-sources.sh.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657076</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-05-28 16:08:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/63736777&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657082</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-28 16:35:25 -0700</bug_when>
    <thetext>The changes in the patch in bug 212420 might fix this. For one thing, it won’t call generate-derived-sources.sh unless something has changed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657112</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-28 17:46:47 -0700</bug_when>
    <thetext>I have no idea why this happened, but I do think that the patch from that other bug will make the problem disappear.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657283</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-29 09:16:29 -0700</bug_when>
    <thetext>Maybe I am being overconfident here; I don’t really know the details of what check xcfilelists build phase does, so I am not sure how I caused this. We could roll out until we figure it out?

Keith, do you understand what this could be?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657297</commentid>
    <comment_count>5</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2020-05-29 09:47:19 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #2)
&gt; The changes in the patch in bug 212420 might fix this. For one thing, it
&gt; won’t call generate-derived-sources.sh unless something has changed.

I applied attachment #400525 to my tree but I still see ~95s runtimes for WebCore&apos;s &quot;Check .xcfilelists&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657313</commentid>
    <comment_count>6</comment_count>
    <who name="Keith Rollin">krollin</who>
    <bug_when>2020-05-29 10:22:10 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #4)
&gt; 
&gt; Keith, do you understand what this could be?

Not off the top of my head. Andy says that the time is spent in generate-derived-sources.sh. The xcfilelist checking process invokes this script to run `make -f DerivedSources.make -d` so that it can capture the dependency information. There&apos;s not much to the script other than invoking `make` so I&apos;d think all the time would be spent in `make`. I wonder if there&apos;s something weird about your changes and in invoking `make` with the -d option (which is what dumps the dependency information). Could `make` now be dumping tons of information?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657321</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-29 10:35:39 -0700</bug_when>
    <thetext>(In reply to Keith Rollin from comment #6)
&gt; The xcfilelist checking process invokes this
&gt; script to run `make -f DerivedSources.make -d` so that it can capture the
&gt; dependency information.

Oh! Had no idea. I thought that DerivedSources.make was only processed once when building. Need to figure out why it’s taking *so* long to process the makefile.

Please roll r262245 out until we can solve this!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657328</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-29 10:40:25 -0700</bug_when>
    <thetext>It’s possible that make now knows about a lot more dependencies, so the output of &quot;make -d&quot; is much bigger, and either make itself is slow, or the code to process it is slow when there&apos;s a lot of data.

It’s possible the invocation of &quot;make -d&quot; is not passing the same environment variables that generate-derived-sources.sh is, leading to something particularly slow.

But neither of those things seems particularly likely. I think we have a mystery.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657331</commentid>
    <comment_count>9</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-29 10:42:38 -0700</bug_when>
    <thetext>Maybe the $(shell) commands are evaluated every time you use FEATURE_AND_PLATFORM_DEFINES rather than only once as the file is processed?

Might just need to use an operator other than &quot;=&quot; to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657334</commentid>
    <comment_count>10</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2020-05-29 10:43:40 -0700</bug_when>
    <thetext>(In reply to Darin Adler from comment #7)
&gt; (In reply to Keith Rollin from comment #6)
&gt; &gt; The xcfilelist checking process invokes this
&gt; &gt; script to run `make -f DerivedSources.make -d` so that it can capture the
&gt; &gt; dependency information.
&gt; 
&gt; Oh! Had no idea. I thought that DerivedSources.make was only processed once
&gt; when building. Need to figure out why it’s taking *so* long to process the
&gt; makefile.
&gt; 
&gt; Please roll r262245 out until we can solve this!

Reverted in https://trac.webkit.org/r262303.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657336</commentid>
    <comment_count>11</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2020-05-29 10:43:56 -0700</bug_when>
    <thetext>*** Bug 212531 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657337</commentid>
    <comment_count>12</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-05-29 10:45:47 -0700</bug_when>
    <thetext>Yes!

The fix is to write &quot;:=&quot; instead of &quot;=&quot; on these lines using @(shell).

Of course I figure this out right after getting the patch rolled out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1657382</commentid>
    <comment_count>13</comment_count>
    <who name="Andy Estes">aestes</who>
    <bug_when>2020-05-29 12:37:24 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 212451 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>