Bug 284779
Summary: | REGRESSION(287859@main): Building with USE_SKIA_OPENTYPE_SVG=ON fails with Clang 18.1+ | ||
---|---|---|---|
Product: | WebKit | Reporter: | Adrian Perez <aperez> |
Component: | Tools / Tests | Assignee: | Adrian Perez <aperez> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | htl10, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Local Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 283246 | ||
Bug Blocks: |
Adrian Perez
In file included from /home/aperez/devel/WebKit/Source/ThirdParty/skia/src/xml/SkDOM.cpp:8:
In file included from /home/aperez/devel/WebKit/Source/ThirdParty/skia/src/xml/SkDOM.h:14:
In file included from /home/aperez/devel/WebKit/Source/ThirdParty/skia/include/private/base/SkTemplates.h:22:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/memory:78:
/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'SkDOMParser'
91 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:399:4: note: in instantiation of member function 'std::default_delete<SkDOMParser>::operator()' requested here
399 | get_deleter()(std::move(__ptr));
| ^
/home/aperez/devel/WebKit/Source/ThirdParty/skia/src/xml/SkDOM.cpp:72:8: note: in instantiation of member function 'std::unique_ptr<SkDOMParser>::~unique_ptr' requested here
72 | SkDOM::SkDOM() : fAlloc(4096), fRoot(nullptr) {}
| ^
/home/aperez/devel/WebKit/Source/ThirdParty/skia/src/xml/SkDOM.h:20:7: note: forward declaration of 'SkDOMParser'
20 | class SkDOMParser;
| ^
1 error generated.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Adrian Perez
The SkDOMParser declaration is indeed in the source file *after* the SkDOM() constructor definition; shuffling them around makes things work. No idea how this can compile with GCC or with the version of Clang used by Skia for CI, but I will submit the fix to upstream Skia as well.
EWS
Committed 287913@main (cc31f5736f7e): <https://commits.webkit.org/287913@main>
Reviewed commits have been landed. Closing PR #38035 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/141571994>
htl10
I think I know why this problem happens. This is the location of what my patch #7 in https://bugs.webkit.org/show_bug.cgi?id=283246 tries to address. src/xml/SkDOM.cpp uses std::unique_ptr , and std::unique_ptr changes behavior when compiled in c++23 mode. Upstream compiles for c++17 by default, webkitgtk does c++23.
You can google "std::unique_ptr c++23" to read about the details.
htl10
I.e. I think the problem is not, strictly speaking, the compiler version, but the c++N mode. I did see it, and that's why there was a patch #7.
Adrian Perez
Skia bug: https://issues.skia.org/issues/384605093
Upstream patch: https://skia-review.googlesource.com/c/skia/+/930496