<?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>229337</bug_id>
          
          <creation_ts>2021-08-20 08:22:36 -0700</creation_ts>
          <short_desc>GLContextGLX.cpp may sometimes fail build because of X11 include files</short_desc>
          <delta_ts>2022-01-07 08:23:56 -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>WebCore Misc.</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nina Kolesová">nina</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fujii</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>pnormand</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1785832</commentid>
    <comment_count>0</comment_count>
    <who name="Nina Kolesová">nina</who>
    <bug_when>2021-08-20 08:22:36 -0700</bug_when>
    <thetext>The file should probably be marked @no-unify.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1785833</commentid>
    <comment_count>1</comment_count>
      <attachid>435989</attachid>
    <who name="Nina Kolesová">nina</who>
    <bug_when>2021-08-20 08:23:34 -0700</bug_when>
    <thetext>Created attachment 435989
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1788025</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-08-27 08:23:21 -0700</bug_when>
    <thetext>&lt;rdar://problem/82439830&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1808852</commentid>
    <comment_count>3</comment_count>
      <attachid>442489</attachid>
    <who name="Nina Kolesová">nina</who>
    <bug_when>2021-10-26 08:15:23 -0700</bug_when>
    <thetext>Created attachment 442489
patch

updated patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809139</commentid>
    <comment_count>4</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-10-26 18:35:45 -0700</bug_when>
    <thetext>WebKit has a lot of #undef in WTF and WebCore layer for this issue, for example &quot;#undef True&quot; and &quot;#undef None&quot;.
Does this change make it possible to remove it?
For example, https://github.com/WebKit/WebKit/blob/bb27304754d0bb686fc3ddfccc42fb8ec1f14d62/Source/WTF/wtf/Threading.h#L64,L68</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809141</commentid>
    <comment_count>5</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-10-26 18:39:23 -0700</bug_when>
    <thetext>Maybe, No. Because it can&apos;t compile if both X11 header and undef-ing headers are included.
I think we should take #undef-ing approach.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809145</commentid>
    <comment_count>6</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-10-26 18:57:37 -0700</bug_when>
    <thetext>WebKit has ANGLEHeaders.h to include ANGLE headers.
https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/graphics/angle/ANGLEHeaders.h

I think we should add X11Headers.h to include X11 headers.
WDYT?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809224</commentid>
    <comment_count>7</comment_count>
    <who name="Nina Kolesová">nina</who>
    <bug_when>2021-10-27 04:48:15 -0700</bug_when>
    <thetext>possibly, I marked the file no-unify since in practice other OpenGL files do the same thing (there&apos;s a bunch of others in the same file) and I think it&apos;s the cleanest way to get around it (it should work unconditionally regardless of what the X11 headers do)

but I&apos;m fine either way</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809389</commentid>
    <comment_count>8</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-10-27 12:50:53 -0700</bug_when>
    <thetext>In my understanding, @no-unify approach can&apos;t solve the issue completely because #include order is ruled by WebKit coding style.
If a header defining None or True are included after X11 header, it can&apos;t compile.
Is my understanding right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809627</commentid>
    <comment_count>9</comment_count>
    <who name="Nina Kolesová">nina</who>
    <bug_when>2021-10-28 03:49:15 -0700</bug_when>
    <thetext>if the build for the file is non-unified, it solves the issue because the file is compiled on its own - and therefore we get control over *which* headers are included and can make sure they are non-conflicting</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809793</commentid>
    <comment_count>10</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-10-28 13:04:43 -0700</bug_when>
    <thetext>Then, we no longer need the #undef. could you remove all #undef for the issue in the patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810046</commentid>
    <comment_count>11</comment_count>
    <who name="Nina Kolesová">nina</who>
    <bug_when>2021-10-29 05:46:06 -0700</bug_when>
    <thetext>you mean for the ANGLE bits?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810225</commentid>
    <comment_count>12</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-10-29 13:53:17 -0700</bug_when>
    <thetext>WebKit has a lot of #undef in WTF and WebCore layer for this issue
For example, https://github.com/WebKit/WebKit/blob/bb27304754d0bb686fc3ddfccc42fb8ec1f14d62/Source/WTF/wtf/Threading.h#L64,L68
If you can solve the issue completely by @no-unify approach, we no longer need the #undef.

I think @no-unify approach can&apos;t solve the issue completely  because #include order is ruled by WebKit coding style.
If a header defining None or True are included after X11 header, it can&apos;t compile. We need #undef. @no-unify approach isn&apos;t a good idea.
I think we should add X11Headers.h to include all X11 headers we need.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810536</commentid>
    <comment_count>13</comment_count>
    <who name="Nina Kolesová">nina</who>
    <bug_when>2021-10-31 18:54:20 -0700</bug_when>
    <thetext>(In reply to Fujii Hironori from comment #12)
&gt; WebKit has a lot of #undef in WTF and WebCore layer for this issue
&gt; For example,
&gt; https://github.com/WebKit/WebKit/blob/
&gt; bb27304754d0bb686fc3ddfccc42fb8ec1f14d62/Source/WTF/wtf/Threading.h#L64,L68
&gt; If you can solve the issue completely by @no-unify approach, we no longer
&gt; need the #undef.
&gt; 
&gt; I think @no-unify approach can&apos;t solve the issue completely  because
&gt; #include order is ruled by WebKit coding style.
&gt; If a header defining None or True are included after X11 header, it can&apos;t
&gt; compile. We need #undef. @no-unify approach isn&apos;t a good idea.
&gt; I think we should add X11Headers.h to include all X11 headers we need.

this is never really a problem for the problematic file in this case, because the X11 headers are included last, and it&apos;s a source file - which was my point all along, if you eliminate it being unified with another source file, there should be no problem anymore (your concern would only be a problem if the file itself was a header, or if we didn&apos;t control the include order of headers)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810537</commentid>
    <comment_count>14</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2021-10-31 19:24:23 -0700</bug_when>
    <thetext>Sonny, but I don&apos;t understand.
Can we remove all #undef?
For example, https://github.com/WebKit/WebKit/blob/bb27304754d0bb686fc3ddfccc42fb8ec1f14d62/Source/WTF/wtf/Threading.h#L64,L68
If so, please do it.
If not, please give up the @no-unify approach, that don&apos;t solve the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810649</commentid>
    <comment_count>15</comment_count>
    <who name="Nina Kolesová">nina</who>
    <bug_when>2021-11-01 09:25:51 -0700</bug_when>
    <thetext>(In reply to Fujii Hironori from comment #14)
&gt; Sonny, but I don&apos;t understand.
&gt; Can we remove all #undef?
&gt; For example,
&gt; https://github.com/WebKit/WebKit/blob/
&gt; bb27304754d0bb686fc3ddfccc42fb8ec1f14d62/Source/WTF/wtf/Threading.h#L64,L68
&gt; If so, please do it.
&gt; If not, please give up the @no-unify approach, that don&apos;t solve the issue.

it does not fix that because that&apos;s a header; this patch is specifically for the one failing file</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1828907</commentid>
    <comment_count>16</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-01-07 08:23:56 -0800</bug_when>
    <thetext>I agree with Fujii that #undef is preferable to @no-unify.

Don&apos;t hesitate to use @no-unify if you really need to, but I don&apos;t see why #undef couldn&apos;t do the job here.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>435989</attachid>
            <date>2021-08-20 08:23:34 -0700</date>
            <delta_ts>2021-10-26 08:15:23 -0700</delta_ts>
            <desc>patch</desc>
            <filename>gl-context-glx-no-unify.patch</filename>
            <type>text/plain</type>
            <size>1281</size>
            <attacher name="Nina Kolesová">nina</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCBhMGY4M2E3ODI5NmEuLjEzMzkzNmZmNjVlNiAxMDA2NDQKLS0tIGEvU291
cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAt
MSwzICsxLDE4IEBACisyMDIxLTA4LTIwICBEYW5pZWwgS29sZXNhICA8ZGtvbGVzYUBpZ2FsaWEu
Y29tPgorCisgICAgICAgIE1hcmsgR0xDb250ZXh0R0xYLmNwcCBhcyBuby11bmlmeQorICAgICAg
ICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MjI5MzM3CisKKyAgICAg
ICAgUmV2aWV3ZWQgYnkgTk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9ncmFwaGljcy9nbHgvR0xDb250ZXh0R0xYLmNwcCBAbm8tdW5pZnkKIAogcGxh
dGZvcm0vZ3JhcGhpY3MvZ3RrL0NvbG9yR3RrLmNwcAogcGxhdGZvcm0vZ3JhcGhpY3MvZ3RrL0Rp
c3BsYXlSZWZyZXNoTW9uaXRvckd0ay5jcHAK
</data>
<flag name="review"
          id="458927"
          type_id="1"
          status="+"
          setter="pnormand"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>442489</attachid>
            <date>2021-10-26 08:15:23 -0700</date>
            <delta_ts>2021-10-26 08:15:23 -0700</delta_ts>
            <desc>patch</desc>
            <filename>glx-no-unify.patch</filename>
            <type>text/plain</type>
            <size>1206</size>
            <attacher name="Nina Kolesová">nina</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAyMWM1YmQxNzdjMzUuLjQxOGRkMGM2MDExMCAxMDA2NDQKLS0tIGEvU291
cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAt
MSwzICsxLDE2IEBACisyMDIxLTEwLTI2ICBEYW5pZWwgS29sZXNhICA8ZGtvbGVzYUBpZ2FsaWEu
Y29tPgorCisgICAgICAgIE1hcmsgR0xDb250ZXh0R0xYLmNwcCBhcyBuby11bmlmeQorICAgICAg
ICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MjI5MzM3CisKKyAgICAg
ICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgSGF2aW5nIHRoaXMgYSBw
YXJ0IG9mIHVuaWZpZWQgYnVpbGQgY2FuIGJyZWFrIGJ1aWxkcyBzaW5jZSBYMTEKKyAgICAgICAg
aW5jbHVkZSBmaWxlcyBhcmUgaW5jbHVkZWQsIHdoaWNoIGhhdmUgbWFjcm9zIHRoYXQgY29uZmxp
Y3QKKyAgICAgICAgd2l0aCBXVEYncyBlbnVtcy4KKworICAgICAgICAqIFNvdXJjZXNHVEsudHh0
OgorCiAyMDIxLTEwLTI2ICBBbnR0aSBLb2l2aXN0byAgPGFudHRpQGFwcGxlLmNvbT4KIAogICAg
ICAgICBGaXggOjpwYXJ0KGZvbyk6aG92ZXIKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL1Nv
dXJjZXNHVEsudHh0IGIvU291cmNlL1dlYkNvcmUvU291cmNlc0dUSy50eHQKaW5kZXggNmZhMWMx
YWY4MzIzLi5lZGM4OWU5YmM2ZWUgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJDb3JlL1NvdXJjZXNH
VEsudHh0CisrKyBiL1NvdXJjZS9XZWJDb3JlL1NvdXJjZXNHVEsudHh0CkBAIC05NCw3ICs5NCw3
IEBAIHBsYXRmb3JtL2dyYXBoaWNzL2VnbC9HTENvbnRleHRFR0xMaWJXUEUuY3BwIEBuby11bmlm
eQogcGxhdGZvcm0vZ3JhcGhpY3MvZWdsL0dMQ29udGV4dEVHTFdheWxhbmQuY3BwIEBuby11bmlm
eQogcGxhdGZvcm0vZ3JhcGhpY3MvZWdsL0dMQ29udGV4dEVHTFgxMS5jcHAgQG5vLXVuaWZ5CiAK
LXBsYXRmb3JtL2dyYXBoaWNzL2dseC9HTENvbnRleHRHTFguY3BwCitwbGF0Zm9ybS9ncmFwaGlj
cy9nbHgvR0xDb250ZXh0R0xYLmNwcCBAbm8tdW5pZnkKIAogcGxhdGZvcm0vZ3JhcGhpY3MvZ3Rr
L0NvbG9yR3RrLmNwcAogcGxhdGZvcm0vZ3JhcGhpY3MvZ3RrL0Rpc3BsYXlSZWZyZXNoTW9uaXRv
ckd0ay5jcHAK
</data>
<flag name="review"
          id="466999"
          type_id="1"
          status="?"
          setter="nina"
    />
    <flag name="commit-queue"
          id="467000"
          type_id="3"
          status="?"
          setter="nina"
    />
          </attachment>
      

    </bug>

</bugzilla>