OSSystems / meta-browser

OpenEmbedded/Yocto BSP layer for Web Browsers
MIT License
185 stars 194 forks source link

chromium: update to 113.0.5672.126 #721

Closed MaxIhlenfeldt closed 1 year ago

MaxIhlenfeldt commented 1 year ago

Release notes: https://chromereleases.googleblog.com/2023/05/stable-channel-update-for-desktop.html https://chromereleases.googleblog.com/2023/05/stable-channel-update-for-desktop_8.html https://chromereleases.googleblog.com/2023/05/stable-channel-update-for-desktop_16.html

Build and patch changes:

Drop 0009-nomerge-attribute-on-declaration-is-only-available-s.patch as all supported Yocto releases use clang >= 12 by now.

Drop 0013-Fix-html_minifier-script-for-node-v12.patch as all supported Yocto releases use Node >= 14 by now.

Revert an upstream change that allows mixing __attribute__ and alignas syntax, because older versions of clang still used by some Yocto releases don't like that very much.

Add 0021-Add-missing-typename-s.patch to fix a compile error.

Backport various patches to fix compile errors: 0019-Backport-constexpr-std-string-fixes.patch 0022-Backport-Avoid-capturing-structured-bindings.patch 0023-Backport-IWYU-for-translate-TranslateUILanguagesMana.patch 0024-Backport-Fix-erroneous-SupportsOstreamOperator-int-i.patch 0025-Backport-Do-not-use-std-monospace-for-absl-variant.patch 0026-Backport-std-string-ends_with-is-C-20.-Use-base-Ends.patch

Rebase remaining patches.

License changes:

Added licenses:

Removed licenses:

Updated licenses:

Test-built:

** Please note that Chromium requires below set-up when on dunfell branch.

*** Please note that there currently is a problem on RPi4/dunfell where Chromium's network service crashes.

Signed-off-by: Max Ihlenfeldt max@igalia.com

MaxIhlenfeldt commented 1 year ago

Alright, this is finally ready. Sorry for taking a bit, I definitely need to improve my build testing setup :sweat_smile:

This is a big update, but for the most part it's just backports. Most of the backported patches are to avoid C++20-specific features, which make especially dunfell's clang 12 very unhappy. Without the backports, it's just two new patches, one of which is very small and will hopefully be accepted upstream.

nrpt-m commented 1 year ago

@MaxIhlenfeldt, @rakuco, @rwmacleod Have built and tested chromium for qemux86-64, qemuarm & qemuarm64 with master branch. For all systems chromium launches and worked well.

Next started build with kirkstone branch for qemux86-64, qemuarm & qemuarm64.

nrpt-m commented 1 year ago

@MaxIhlenfeldt , @rakuco & @rwmacleod For Kirkstone branch, chromium build is failing for rpi4 & qemux86-64 machines (yet to build qemuarm, qemuarm64) with below errors:

kirkstone branch machines:rpi4, qemux86-64 Build errors @log.do_compile:

In file included from ../../chrome/browser/enterprise/connectors/analysis/files_request_handler.cc:17: In file included from ../../components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h:28: gen/services/network/public/mojom/network_context.mojom.h:720:5: warning: unknown attribute 'noinline' ignored [-Wunknown-attributes] NOINLINE static uint32_t IPCStableHash(); ^~~~ ../../base/compiler_specific.h:45:20: note: expanded from macro 'NOINLINE'

define NOINLINE [[clang::noinline]]

               ^~~~~~~~~~~~~~~

384 warnings generated. [59217/59869] python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./v8_context_snapshot_generator" -- aarch64-poky-linux-clang++ -target aarch64-poky-linux -mcpu=cortex-a72 -march=armv8-a+crc -mlittle-endian -Qunused-arguments -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/buildarea/eng1/chromium/build/kirkstone/tmp/work/cortexa72-poky-linux/chromium-x11/113.0.5672.126-r0/recipe-sysroot -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=64 -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=30 -fwhole-program-vtables -Wl,--undefined-version -Wl,--no-call-graph-profile-sort -Wl,-mllvm,-enable-machine-outliner=never -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -Wl,--lto-O0 -pie -Wl,--disable-new-dtags -Wl,--icf=none -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/buildarea/eng1/chromium/build/kirkstone/tmp/work/cortexa72-poky-linux/chromium-x11/113.0.5672.126-r0=/usr/src/debug/chromium-x11/113.0.5672.126-r0 -fdebug-prefix-map=/buildarea/eng1/chromium/build/kirkstone/tmp/work/cortexa72-poky-linux/chromium-x11/113.0.5672.126-r0=/usr/src/debug/chromium-x11/113.0.5672.126-r0 -fdebug-prefix-map=/buildarea/eng1/chromium/build/kirkstone/tmp/work/cortexa72-poky-linux/chromium-x11/113.0.5672.126-r0/recipe-sysroot= -fdebug-prefix-map=/buildarea/eng1/chromium/build/kirkstone/tmp/work/cortexa72-poky-linux/chromium-x11/113.0.5672.126-r0/recipe-sysroot-native= -Wl,-z,relro,-z,now -stdlib=libc++ -o "./v8_context_snapshot_generator" -Wl,--start-group @"./v8_context_snapshot_generator.rsp" -Wl,--end-group -latomic -ldl -lpthread -lrt -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lresolv -lgio-2.0 -ljpeg -lxslt -lxml2 -lexpat -luuid -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lXtst -ldrm -lxcb -lxkbcommon -lgbm -lXi -lpci -latk-1.0 -latk-bridge-2.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -lasound -lFLAC -lm -lz -ldbus-1 -latspi ninja: build stopped: subcommand failed. WARNING: /buildarea/eng1/chromium/build/kirkstone/tmp/work/cortexa72-poky-linux/chromium-x11/113.0.5672.126-r0/temp/run.do_compile.2774042:147 exit 1 from 'ninja -v -j 64 chrome chrome_sandbox chromedriver.unstripped' WARNING: Backtrace (BB generated script):

1: do_compile, /buildarea/eng1/chromium/build/kirkstone/tmp/work/cortexa72-poky-linux/chromium-x11/113.0.5672.126-r0/temp/run.do_compile.2774042, line 147

    #2: main, /buildarea/eng1/chromium/build/kirkstone/tmp/work/cortexa72-poky-linux/chromium-x11/113.0.5672.126-r0/temp/run.do_compile.2774042, line 151

@console-latest.log:

ERROR: chromium-x11-113.0.5672.126-r0 do_compile: ExecutionError('/buildarea/eng1/chromium/build/kirkstone/tmp/work/core2-64-poky-linux/chromium-x11/113.0.5672.126-r0/temp/run.do_compile.738429', 1, None, None) ERROR: Logfile of failure stored in: /buildarea/eng1/chromium/build/kirkstone/tmp/work/core2-64-poky-linux/chromium-x11/113.0.5672.126-r0/temp/log.do_compile.738429 WARNING: /buildarea/eng1/chromium/poky-kirktone/bitbake/lib/bb/ui/knotty.py:879: ResourceWarning: unclosed file <_io.TextIOWrapper name='/buildarea/eng1/chromium/build/kirkstone/tmp/work/core2-64-poky-linux/chromium-x11/113.0.5672.126-r0/temp/log.do_compile.738429' mode='r' encoding='UTF-8'> main.shutdown = main.shutdown + 1

ERROR: Task (/buildarea/eng1/src/repos/meta-browser.git/meta-chromium/recipes-browser/chromium/chromium-x11_113.0.5672.126.bb:do_compile) failed with exit code '1' NOTE: Tasks Summary: Attempted 6814 tasks of which 2212 didn't need to be rerun and 1 failed.

Building with dunfell branch meanwhile.

nrpt-m commented 1 year ago

Have built chromium for dunfell branch as well and it gives the similar errors.

| ../../base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h:38:28: note: expanded from macro 'PA_ALWAYS_INLINE' | #define PA_ALWAYS_INLINE [[clang::always_inline]] inline | ^~~~~~~~ | In file included from ../../base/task/common/task_annotator.cc:5: | In file included from ../../base/task/common/task_annotator.h:12: | In file included from ../../base/memory/raw_ptr.h:11: | ../../base/allocator/partition_allocator/pointers/raw_ptr.h:760:3: warning: unknown attribute 'always_inline' ignored [-Wunknown-attributes] | PA_ALWAYS_INLINE constexpr raw_ptr& operator--() { | ^~~~

Let me try adding this patch "[0009-nomerge-attribute-on-declaration-is-only-available-s.patch]" and build again.

nrpt-m commented 1 year ago

Let me try adding this patch "[0009-nomerge-attribute-on-declaration-is-only-available-s.patch]" and build again.

Have checked adding this patch again but, still getting the errors.

MaxIhlenfeldt commented 1 year ago

These are only warnings, they shouldn't cause the build to fail. They're expected, see this patch's commit message.

Can you grep for "error:" in the build log?

nrpt-m commented 1 year ago

@MaxIhlenfeldt , Actually, while building chromium for kirkstone/dunfell branches at some point it was just keep on printing these above warnings and build was not completing. Since, chromium build completed without any warnings in master branch so, I thought it is due to some error in kirkstone/dunfell and have stopped the build. Let me run once again, ignores all these warning messages and wait patiently for the building to complete ;-)

Today, I have built chromium for mickledore branch and getting the below errors:

$less /buildarea/eng1/chromium/build/mickledore/tmp/work/core2-64-poky-linux/chromium-x11/113.0.5672.126-r0/temp/log.do_compile.744922 | grep error: ../../chrome/browser/download/bubble/download_bubble_update_service.cc:90:1: error: missing 'typename' prior to dependent type name 'SortedItems::iterator' ../../chrome/browser/download/bubble/download_bubble_update_service.cc:792:1: error: missing 'typename' prior to dependent type name 'SortedItems::iterator' ../../chrome/browser/download/bubble/download_bubble_update_service.cc:794:5: error: missing 'typename' prior to dependent type name 'SortedItems::iterator' ../../chrome/browser/download/bubble/download_bubble_update_service.cc:793:30: error: out-of-line definition of 'RemoveItemFromCacheByIter' does not match any declaration in 'DownloadBubbleUpdateService'

MaxIhlenfeldt commented 1 year ago

Today, I have built chromium for mickledore branch and getting the below errors:

Hm, 0021-Backport-Add-missing-typename-s-which-are-required-b.patch should prevent exactly this error :thinking: but maybe it's needed to add the typename in the .cc file as well? Can you try modifying the patch to that the diff is this:

 .../download/bubble/download_bubble_update_service.cc       | 6 +++---
 .../download/bubble/download_bubble_update_service.h        | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/chrome/browser/download/bubble/download_bubble_update_service.cc b/chrome/browser/download/bubble/download_bubble_update_service.cc
index 0dbffd34222f1..70d43e37c8324 100644
--- a/chrome/browser/download/bubble/download_bubble_update_service.cc
+++ b/chrome/browser/download/bubble/download_bubble_update_service.cc
@@ -87,7 +87,7 @@ ItemSortKey GetSortKey(const Item& item) {
 // Helper to get an iterator to the last element in the cache. The cache
 // must not be empty.
 template <typename Item>
-SortedItems<Item>::iterator GetLastIter(SortedItems<Item>& cache) {
+typename SortedItems<Item>::iterator GetLastIter(SortedItems<Item>& cache) {
   CHECK(!cache.empty());
   auto it = cache.end();
   return std::prev(it);
@@ -789,9 +789,9 @@ bool DownloadBubbleUpdateService::RemoveItemFromCacheImpl(
 }

 template <typename Id, typename Item>
-SortedItems<Item>::iterator
+typename SortedItems<Item>::iterator
 DownloadBubbleUpdateService::RemoveItemFromCacheByIter(
-    SortedItems<Item>::iterator iter,
+    typename SortedItems<Item>::iterator iter,
     SortedItems<Item>& cache,
     IterMap<Id, Item>& iter_map) {
   CHECK(iter != cache.end());
diff --git a/chrome/browser/download/bubble/download_bubble_update_service.h b/chrome/browser/download/bubble/download_bubble_update_service.h
index de4e9e8a14b90..07ee16a3e8ad2 100644
--- a/chrome/browser/download/bubble/download_bubble_update_service.h
+++ b/chrome/browser/download/bubble/download_bubble_update_service.h
@@ -208,8 +208,8 @@ class DownloadBubbleUpdateService

   // Removes item if we already have the iterator to it. Returns next iterator.
   template <typename Id, typename Item>
-  SortedItems<Item>::iterator RemoveItemFromCacheByIter(
-      SortedItems<Item>::iterator iter,
+  typename SortedItems<Item>::iterator RemoveItemFromCacheByIter(
+      typename SortedItems<Item>::iterator iter,
       SortedItems<Item>& cache,
       IterMap<Id, Item>& iter_map);
nrpt-m commented 1 year ago

Hm, 0021-Backport-Add-missing-typename-s-which-are-required-b.patch should prevent exactly this error 🤔 but maybe it's needed to add the typename in the .cc file as well? Can you try modifying the patch to that the diff is this:

Let me try this.

nrpt-m commented 1 year ago

Hm, 0021-Backport-Add-missing-typename-s-which-are-required-b.patch should prevent exactly this error 🤔 but maybe it's needed to add the typename in the .cc file as well? Can you try modifying the patch to that the diff is this:

 .../download/bubble/download_bubble_update_service.cc       | 6 +++---
 .../download/bubble/download_bubble_update_service.h        | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/chrome/browser/download/bubble/download_bubble_update_service.cc b/chrome/browser/download/bubble/download_bubble_update_service.cc
index 0dbffd34222f1..70d43e37c8324 100644
--- a/chrome/browser/download/bubble/download_bubble_update_service.cc
+++ b/chrome/browser/download/bubble/download_bubble_update_service.cc
@@ -87,7 +87,7 @@ ItemSortKey GetSortKey(const Item& item) {
 // Helper to get an iterator to the last element in the cache. The cache
 // must not be empty.
 template <typename Item>
-SortedItems<Item>::iterator GetLastIter(SortedItems<Item>& cache) {
+typename SortedItems<Item>::iterator GetLastIter(SortedItems<Item>& cache) {
   CHECK(!cache.empty());
   auto it = cache.end();
   return std::prev(it);
@@ -789,9 +789,9 @@ bool DownloadBubbleUpdateService::RemoveItemFromCacheImpl(
 }

 template <typename Id, typename Item>
-SortedItems<Item>::iterator
+typename SortedItems<Item>::iterator
 DownloadBubbleUpdateService::RemoveItemFromCacheByIter(
-    SortedItems<Item>::iterator iter,
+    typename SortedItems<Item>::iterator iter,
     SortedItems<Item>& cache,
     IterMap<Id, Item>& iter_map) {
   CHECK(iter != cache.end());
diff --git a/chrome/browser/download/bubble/download_bubble_update_service.h b/chrome/browser/download/bubble/download_bubble_update_service.h
index de4e9e8a14b90..07ee16a3e8ad2 100644
--- a/chrome/browser/download/bubble/download_bubble_update_service.h
+++ b/chrome/browser/download/bubble/download_bubble_update_service.h
@@ -208,8 +208,8 @@ class DownloadBubbleUpdateService

   // Removes item if we already have the iterator to it. Returns next iterator.
   template <typename Id, typename Item>
-  SortedItems<Item>::iterator RemoveItemFromCacheByIter(
-      SortedItems<Item>::iterator iter,
+  typename SortedItems<Item>::iterator RemoveItemFromCacheByIter(
+      typename SortedItems<Item>::iterator iter,
       SortedItems<Item>& cache,
       IterMap<Id, Item>& iter_map);

@MaxIhlenfeldt , With these above changes in the patch, chromium has built successfully without any error for rpi4 & qemux86-64 in kirkstone branch so far and build is going on for other systems :-)

I am quite surprised that why the error was not observed in master branch build.

MaxIhlenfeldt commented 1 year ago

@MaxIhlenfeldt , With these above changes in the patch, chromium has built successfully without any error for rpi4 & qemux86-64 in kirkstone branch so far and build is going on for other systems :-)

Interesting, thanks! I'll update the patch, then. I'll also try and upstream these additions.

I am quite surprised that why the error was not observed in master branch build.

master uses clang 16, right? I think that clang version doesn't need the patch at all, it's only needed for older versions of clang.

nrpt-m commented 1 year ago

master uses clang 16, right? I think that clang version doesn't need the patch at all, it's only needed for older versions of clang.

Yes, master uses clang 16.

nrpt-m commented 1 year ago

Have built & tested the chromium for below systems in kirkstone branch and all worked fine.

Next is dunfell & mickledore branches.

nrpt-m commented 1 year ago

Have built & tested the chromium for below systems in dunfell branch and all worked fine except rpi4.

Have observed the below errors in rpi4:

raspberrypi4-64:~$ cat /tmp/ch.log
*** longjmp causes uninitialized stack frame ***: terminated
[1215:1237:0609/110202.215018:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[1215:1237:0609/110202.217003:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[1249:1249:0609/110202.252475:ERROR:egl_util.cc(44)] Failed to load GLES library: libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
[1215:1215:0609/110202.253859:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
[1249:1249:0609/110202.262488:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[1215:1237:0609/110202.329195:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[1215:1237:0609/110202.331514:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[1215:1237:0609/110202.509382:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[1215:1237:0609/110202.511291:ERROR:bus.cc(399)] Failed to connect to the bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[1307:1307:0609/110202.846494:ERROR:egl_util.cc(44)] Failed to load GLES library: libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
[1307:1307:0609/110202.860164:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[1317:1317:0609/110203.006418:ERROR:egl_util.cc(44)] Failed to load GLES library: libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory
[1317:1317:0609/110203.019082:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[1215:1215:0609/110203.077105:ERROR:network_service_instance_impl.cc(541)] Network service crashed, restarting service.
[1287:26:0609/110203.319378:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[1215:1215:0609/110204.251687:ERROR:network_service_instance_impl.cc(541)] Network service crashed, restarting service.
[1215:1215:0609/110207.395018:ERROR:network_service_instance_impl.cc(541)] Network service crashed, restarting service.
[1215:1215:0609/110207.747601:ERROR:network_service_instance_impl.cc(541)] Network service crashed, restarting service.
[1215:1215:0609/110213.640625:ERROR:network_service_instance_impl.cc(541)] Network service crashed, restarting service.
[1215:1215:0609/110216.317722:ERROR:network_service_instance_impl.cc(541)] Network service crashed, restarting service.
raspberrypi4-64:~$

These above errors have been observed in some earlier releases and we have never solved it until upgrading, let's wait an see what 114 does for dunfell.

Next build is going on for mickledore branch.

rwmacleod commented 1 year ago

As @nrpt-m mentioned, the network service crash is back on RPi4/dunfell (maybe it was there all along and no one was testing it?). I think we should note it as a limitation in the commit log and see if goes away in 114.

nrpt-m commented 1 year ago

@MaxIhlenfeldt @rakuco @rwmacleod Have built and tested chromium for below systems in mickledore branch as well and all systems worked fine.

If you are agree with the above test results in all the branches then, please modify 0021-Backport-Add-missing-typename-s-which-are-required-b.patch before merging.

MaxIhlenfeldt commented 1 year ago

Thank you for all the testing! I've updated patch 0021, and also 0023 as it has been accepted upstream. I'm currently doing one final build to make sure I didn't mess up any of the patch changes.

@nrpt-m can you please confirm I wrote down the correct machines for the master branch in the "Test-built" section? You explicitly listed them for the other branches (thanks a lot!), but I'm not sure which one you used for master.

nrpt-m commented 1 year ago

@nrpt-m can you please confirm I wrote down the correct machines for the master branch in the "Test-built" section? You explicitly listed them for the other branches (thanks a lot!), but I'm not sure which one you used for master.

For master branch, we have tested the below systems:

MaxIhlenfeldt commented 1 year ago

Thanks! I've updated the commit message and the PR description. Let's merge this!