WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
229337
GLContextGLX.cpp may sometimes fail build because of X11 include files
https://bugs.webkit.org/show_bug.cgi?id=229337
Summary
GLContextGLX.cpp may sometimes fail build because of X11 include files
Nina Kolesa
Reported
2021-08-20 08:22:36 PDT
The file should probably be marked @no-unify.
Attachments
patch
(1.25 KB, patch)
2021-08-20 08:23 PDT
,
Nina Kolesa
pnormand
: review+
Details
Formatted Diff
Diff
patch
(1.18 KB, patch)
2021-10-26 08:15 PDT
,
Nina Kolesa
nina
: review?
nina
: commit-queue?
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Nina Kolesa
Comment 1
2021-08-20 08:23:34 PDT
Created
attachment 435989
[details]
patch
Radar WebKit Bug Importer
Comment 2
2021-08-27 08:23:21 PDT
<
rdar://problem/82439830
>
Nina Kolesa
Comment 3
2021-10-26 08:15:23 PDT
Created
attachment 442489
[details]
patch updated patch
Fujii Hironori
Comment 4
2021-10-26 18:35:45 PDT
WebKit has a lot of #undef in WTF and WebCore layer for this issue, for example "#undef True" and "#undef None". 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
Fujii Hironori
Comment 5
2021-10-26 18:39:23 PDT
Maybe, No. Because it can't compile if both X11 header and undef-ing headers are included. I think we should take #undef-ing approach.
Fujii Hironori
Comment 6
2021-10-26 18:57:37 PDT
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?
Nina Kolesa
Comment 7
2021-10-27 04:48:15 PDT
possibly, I marked the file no-unify since in practice other OpenGL files do the same thing (there's a bunch of others in the same file) and I think it's the cleanest way to get around it (it should work unconditionally regardless of what the X11 headers do) but I'm fine either way
Fujii Hironori
Comment 8
2021-10-27 12:50:53 PDT
In my understanding, @no-unify approach can'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't compile. Is my understanding right?
Nina Kolesa
Comment 9
2021-10-28 03:49:15 PDT
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
Fujii Hironori
Comment 10
2021-10-28 13:04:43 PDT
Then, we no longer need the #undef. could you remove all #undef for the issue in the patch?
Nina Kolesa
Comment 11
2021-10-29 05:46:06 PDT
you mean for the ANGLE bits?
Fujii Hironori
Comment 12
2021-10-29 13:53:17 PDT
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'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't compile. We need #undef. @no-unify approach isn't a good idea. I think we should add X11Headers.h to include all X11 headers we need.
Nina Kolesa
Comment 13
2021-10-31 18:54:20 PDT
(In reply to Fujii Hironori from
comment #12
)
> 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'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't > compile. We need #undef. @no-unify approach isn't a good idea. > 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'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't control the include order of headers)
Fujii Hironori
Comment 14
2021-10-31 19:24:23 PDT
Sonny, but I don'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't solve the issue.
Nina Kolesa
Comment 15
2021-11-01 09:25:51 PDT
(In reply to Fujii Hironori from
comment #14
)
> Sonny, but I don'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't solve the issue.
it does not fix that because that's a header; this patch is specifically for the one failing file
Michael Catanzaro
Comment 16
2022-01-07 08:23:56 PST
I agree with Fujii that #undef is preferable to @no-unify. Don't hesitate to use @no-unify if you really need to, but I don't see why #undef couldn't do the job here.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug