<?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>247206</bug_id>
          
          <creation_ts>2022-10-28 11:28:20 -0700</creation_ts>
          <short_desc>[GLib] Improvements for generate-api-header.py</short_desc>
          <delta_ts>2022-11-07 07:23:03 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>210100</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1909052</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-10-28 11:28:20 -0700</bug_when>
    <thetext>generate-api-header.py has worked well enough so far, but there are a few problems:

 * It cannot expand USE(2022_GLIB_API) because its regex cannot handle underscores, and only handles flag names where all alphabetical characters occur before all numeric characters. The regex should be more permissive
 * It expands USE(FOO) to WTF_USE_FOO, but only HAVE(FOO) flags should receive the WTF_ prefix
 * It doesn&apos;t handle ENABLE_ at all
 * It translates FOO(BAR) to FOO_BAR, but we really want it to be translated to &quot;defined(FOO_BAR) &amp;&amp; FOO_BAR&quot; because unifdef will ignore any directive that it cannot fully evaluate, leaving unwanted guards in the generated headers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1909210</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-10-30 06:26:11 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt;  * It expands USE(FOO) to WTF_USE_FOO, but only HAVE(FOO) flags should
&gt; receive the WTF_ prefix

This actually doesn&apos;t matter, since we control exactly which defines get passed to unifdef, and unifdef is supposed to remove them all. Since our normal build flags are not used, there is no requirement to expand things exactly the same way that the rest of the build would.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1909213</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-10-30 06:59:09 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/5943</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910773</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-07 07:23:00 -0800</bug_when>
    <thetext>Committed 256403@main (40b3dbe8a327): &lt;https://commits.webkit.org/256403@main&gt;

Reviewed commits have been landed. Closing PR #5943 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>