Bug 207365 - Multiple GCC 10 build failures in ANGLE
Summary: Multiple GCC 10 build failures in ANGLE
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords: InRadar
: 207511 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-02-06 15:44 PST by Michael Catanzaro
Modified: 2020-02-12 16:32 PST (History)
10 users (show)

See Also:


Attachments
Patch (3.65 KB, patch)
2020-02-10 10:04 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch (3.65 KB, patch)
2020-02-10 10:13 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch (3.72 KB, patch)
2020-02-12 15:33 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2020-02-06 15:44:39 PST
WebKitGTK 2.27.4 FTBFS with GCC 10:

In file included from ../Source/ThirdParty/ANGLE/src/common/event_tracer.h:9,
                 from ../Source/ThirdParty/ANGLE/src/common/event_tracer.cpp:5:
../Source/ThirdParty/ANGLE/include/platform/Platform.h:239:35: error: 'size_t' has not been declared
  239 |                                   size_t programSize,
      |                                   ^~~~~~
../Source/ThirdParty/ANGLE/include/platform/Platform.h:243:33: error: 'size_t' has not been declared
  243 |                                 size_t programSize,
      |                                 ^~~~~~


Problem is ANGLE's Platform.h only #includes <stdint.h> and <array>. size_t is declared in a bunch of different stdlib headers [1], but stdint.h is not one of them.

stdlib.h seems like the nicest one to use here.

[1] https://en.cppreference.com/w/c/types/size_t
Comment 1 Michael Catanzaro 2020-02-10 09:48:02 PST
In addition to the missing include, there is one more build failure:

../Source/ThirdParty/ANGLE/src/libANGLE/FrameCapture_mock.cpp
In file included from ../Source/ThirdParty/ANGLE/src/libANGLE/FrameCapture.h:13,
                 from ../Source/ThirdParty/ANGLE/src/libANGLE/FrameCapture_mock.cpp:10:
../Source/ThirdParty/ANGLE/src/libANGLE/angletypes.h:427:2:   in 'constexpr' expansion of 'angle::PackedEnumMap<gl::ComponentType, unsigned int>(std::initializer_list<std::pair<gl::ComponentType, unsigned int> >{((const std::pair<gl::ComponentType, unsigned int>*)(& const std::pair<gl::ComponentType, unsigned int> [3]{std::pair<gl::ComponentType, unsigned int>{gl::ComponentType::Float, 65537}, std::pair<gl::ComponentType, unsigned int>{gl::ComponentType::Int, 1}, std::pair<gl::ComponentType, unsigned int>{gl::ComponentType::UnsignedInt, 65536}})), 3})'
../Source/ThirdParty/ANGLE/src/common/PackedEnums.h:89:72: error: modifying a const object '(unsigned int&)(&(&(const Storage&)(&((angle::PackedEnumMap<gl::ComponentType, unsigned int>*)this)->angle::PackedEnumMap<gl::ComponentType, unsigned int>::mPrivateData))->std::array<unsigned int, 4>::operator[](((std::array<unsigned int, 4>::size_type)((angle::PackedEnumMap<gl::ComponentType, unsigned int>::UnderlyingType)it->std::pair<gl::ComponentType, unsigned int>::first))))' is not allowed in a constant expression
   88 |             const_cast<T &>(const_cast<const Storage &>(
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   89 |                 mPrivateData)[static_cast<UnderlyingType>(it->first)]) = it->second;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from ../Source/ThirdParty/ANGLE/src/libANGLE/Caps.h:12,
                 from ../Source/ThirdParty/ANGLE/src/libANGLE/Context.h:20,
                 from ../Source/ThirdParty/ANGLE/src/libANGLE/FrameCapture.h:14,
                 from ../Source/ThirdParty/ANGLE/src/libANGLE/FrameCapture_mock.cpp:10:
../Source/ThirdParty/ANGLE/src/libANGLE/angletypes.h:427:2: note: originally declared 'const' here
  427 | }};
      |  ^


Which is easy to fix by removing the casts. The source code has a comment saying the casts are required until C++17, but in WebKit this file is guaranteed to be built using C++17. Not sure about upstreamability of this one.
Comment 2 Michael Catanzaro 2020-02-10 10:04:38 PST
Created attachment 390259 [details]
Patch
Comment 3 EWS Watchlist 2020-02-10 10:05:39 PST
Note that there are important steps to take when updating ANGLE. See http://trac.webkit.org/wiki/UpdatingANGLE
Comment 4 Michael Catanzaro 2020-02-10 10:13:53 PST
Created attachment 390260 [details]
Patch
Comment 6 Carlos Garcia Campos 2020-02-11 01:15:15 PST
*** Bug 207511 has been marked as a duplicate of this bug. ***
Comment 7 Carlos Alberto Lopez Perez 2020-02-12 09:05:55 PST
its 2.26.x also affected by this? should we backport this to 2.26.x?
Comment 8 Michael Catanzaro 2020-02-12 10:12:19 PST
(In reply to Carlos Alberto Lopez Perez from comment #7)
> its 2.26.x also affected by this? should we backport this to 2.26.x?

It's probably affected, yes.

I doubt any Linux distros will ever use GCC 10 to build 2.26.x, so a backport is probably not very important, but it might be useful for developers to check if bugs exist in 2.26 without having to manually apply the patch.
Comment 9 WebKit Commit Bot 2020-02-12 10:40:57 PST
Comment on attachment 390260 [details]
Patch

Rejecting attachment 390260 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 390260, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Logging in as commit-queue@webkit.org...
Fetching: https://bugs.webkit.org/attachment.cgi?id=390260&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=207365&ctype=xml&excludefield=attachmentdata
Processing 1 patch from 1 bug.
Processing patch 390260 from bug 207365.
Fetching: https://bugs.webkit.org/attachment.cgi?id=390260
Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Carlos Alberto Lopez Perez']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Parsed 4 diffs from patch file(s).
patching file Source/ThirdParty/ANGLE/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Source/ThirdParty/ANGLE/changes.diff
Hunk #1 FAILED at 138.
1 out of 1 hunk FAILED -- saving rejects to file Source/ThirdParty/ANGLE/changes.diff.rej
patching file Source/ThirdParty/ANGLE/include/platform/Platform.h
patching file Source/ThirdParty/ANGLE/src/common/PackedEnums.h

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Carlos Alberto Lopez Perez']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: https://webkit-queues.webkit.org/results/13321487
Comment 10 Michael Catanzaro 2020-02-12 10:51:52 PST
Conflict is r256443
Comment 11 Michael Catanzaro 2020-02-12 15:33:09 PST
Created attachment 390571 [details]
Patch
Comment 12 WebKit Commit Bot 2020-02-12 16:31:11 PST
The commit-queue encountered the following flaky tests while processing attachment 390571 [details]:

editing/spelling/spellcheck-async-remove-frame.html bug 158401 (authors: morrita@google.com, rniwa@webkit.org, and tony@chromium.org)
The commit-queue is continuing to process your patch.
Comment 13 WebKit Commit Bot 2020-02-12 16:31:46 PST
Comment on attachment 390571 [details]
Patch

Clearing flags on attachment: 390571

Committed r256491: <https://trac.webkit.org/changeset/256491>
Comment 14 WebKit Commit Bot 2020-02-12 16:31:48 PST
All reviewed patches have been landed.  Closing bug.
Comment 15 Radar WebKit Bug Importer 2020-02-12 16:32:16 PST
<rdar://problem/59406353>