Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Chromium 121.0.6167.85 #2681

Merged
merged 1 commit into from Jan 25, 2024

Conversation

Ahrotahn
Copy link
Contributor

@Ahrotahn Ahrotahn commented Jan 19, 2024

This PR updates to Chromium 121.0.6167.85.

Notes:


  • If building with a prior version of clang [5030335] will need to be reverted and the constexpr introduced in [5059164] will need to be removed:

    diff
    --- a/components/performance_manager/resource_attribution/query_params.h
    +++ b/components/performance_manager/resource_attribution/query_params.h
    @@ -27,7 +27,7 @@
       QueryParams(const QueryParams& other);
       QueryParams& operator=(const QueryParams& other);
     
    -  friend constexpr bool operator==(const QueryParams&,
    +  friend bool operator==(const QueryParams&,
                                        const QueryParams&) = default;
     
       // Individual resource contexts to measure.
  • The Rust QR code generator is being shipped with [5064208] and can be reverted with:

    diff
    --- a/components/qr_code_generator/BUILD.gn
    +++ b/components/qr_code_generator/BUILD.gn
    @@ -39,21 +39,11 @@
       ]
       deps = [
         ":qr_code_generator_features",
    -    ":qr_code_generator_ffi_glue",
         "//base",
       ]
       public_deps = [ "//base" ]
     }
     
    -rust_static_library("qr_code_generator_ffi_glue") {
    -  allow_unsafe = true  # Needed for FFI that underpins the `cxx` crate.
    -  crate_root = "qr_code_generator_ffi_glue.rs"
    -  sources = [ "qr_code_generator_ffi_glue.rs" ]
    -  cxx_bindings = [ "qr_code_generator_ffi_glue.rs" ]
    -  visibility = [ ":qr_code_generator" ]
    -  deps = [ "//third_party/rust/qr_code/v2:lib" ]
    -}
    -
     source_set("unit_tests") {
       testonly = true
       sources = [ "qr_code_generator_unittest.cc" ]
    --- a/components/qr_code_generator/qr_code_generator.cc
    +++ b/components/qr_code_generator/qr_code_generator.cc
    @@ -11,12 +11,10 @@
     #include <vector>
     
     #include "base/check_op.h"
    -#include "base/containers/span_rust.h"
     #include "base/memory/raw_ptr.h"
     #include "base/notreached.h"
     #include "base/numerics/safe_conversions.h"
     #include "components/qr_code_generator/features.h"
    -#include "components/qr_code_generator/qr_code_generator_ffi_glue.rs.h"
     
     namespace qr_code_generator {
     
    @@ -572,31 +570,6 @@
       return sum;
     }
     
    -absl::optional<QRCodeGenerator::GeneratedCode> GenerateQrCodeUsingRust(
    -    base::span<const uint8_t> in,
    -    absl::optional<int> min_version) {
    -  rust::Slice<const uint8_t> rs_in = base::SpanToRustSlice(in);
    -
    -  // `min_version` might come from a fuzzer and therefore we use a lenient
    -  // `saturated_cast` instead of a `checked_cast`.
    -  int16_t rs_min_version =
    -      base::saturated_cast<int16_t>(min_version.value_or(0));
    -
    -  std::vector<uint8_t> result_pixels;
    -  size_t result_width = 0;
    -  bool result_is_success = generate_qr_code_using_rust(
    -      rs_in, rs_min_version, result_pixels, result_width);
    -
    -  if (!result_is_success) {
    -    return absl::nullopt;
    -  }
    -  QRCodeGenerator::GeneratedCode code;
    -  code.data = std::move(result_pixels);
    -  code.qr_size = base::checked_cast<int>(result_width);
    -  CHECK_EQ(code.data.size(), static_cast<size_t>(code.qr_size * code.qr_size));
    -  return code;
    -}
    -
     }  // namespace
     
     QRCodeGenerator::QRCodeGenerator() = default;
    @@ -617,10 +590,6 @@
         return absl::nullopt;
       }
     
    -  if (IsRustyQrCodeGeneratorFeatureEnabled()) {
    -    return GenerateQrCodeUsingRust(in, min_version);
    -  }
    -
       std::vector<Segment> segments;
       const QRVersionInfo* version_info = nullptr;
     
    They plan to remove the c++ code in a month, so I'll work on removing the llvm and rust contingent paths for platforms that need to build with the included sources.

Change log
Blog post

@teeminus
Copy link
Contributor

Builds and runs fine on windows with the Rust QR code generator patch. I also had to update the safebrowsing patch because linking would fail otherwise:

--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -7107,6 +7044,7 @@ ChromeContentBrowserClient::GetAsyncCheckTracker(
     bool is_consumer_lookup_enabled,
     safe_browsing::hash_realtime_utils::HashRealTimeSelection
         hash_realtime_selection) {
+  return nullptr;
   content::WebContents* contents = wc_getter.Run();
   if (!contents || !safe_browsing_service_ ||
       !safe_browsing_service_->ui_manager()) {

I pasted the patch here in case it is required some any of the other platforms. If not, I will add it to the windows safebrowsing removal patch. I am also not quite sure if the return nullptr; needs to be placed after the content::WebContents* contents = wc_getter.Run();...

@Ahrotahn
Copy link
Contributor Author

Thanks @teeminus, I've updated the PR and added one more ui removal as well.

@Ahrotahn Ahrotahn changed the title Update to Chromium 121.0.6167.75 Update to Chromium 121.0.6167.85 Jan 22, 2024
@Ahrotahn Ahrotahn marked this pull request as ready for review January 23, 2024 17:21
@Ahrotahn Ahrotahn requested a review from a team as a code owner January 23, 2024 17:21
@LeFroid
Copy link
Contributor

LeFroid commented Jan 24, 2024

I ran into the following error in HistoryService, building on Gentoo with clang 17. Looked at the delta between chromium 120 and 121 in this class and didn't see anything obvious. Maybe some default compiler flag has been changed?

In file included from ../../components/history/core/browser/history_service.h:10:
In file included from /usr/include/c++/v1/memory:884:
In file included from /usr/include/c++/v1/__memory/allocate_at_least.h:13:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:15:
�[1m/usr/include/c++/v1/__memory/pointer_traits.h:118:22: �[0m�[0;1;31merror: �[0m�[1mimplicit instantiation of undefined template 'std::__pointer_traits_element_type<base::SafeRef<history::HistoryService>>'�[0m
  118 |     typedef typename __pointer_traits_element_type<pointer>::type    element_type;�[0m
      | �[0;1;32m                     ^
�[0m�[1m/usr/include/c++/v1/__memory/pointer_traits.h:182:20: �[0m�[0;1;30mnote: �[0min instantiation of template class 'std::pointer_traits<base::SafeRef<history::HistoryService>>' requested here�[0m
  182 |     decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()))�[0m
      | �[0;1;32m                   ^
�[0m�[1m/usr/include/c++/v1/__memory/pointer_traits.h:195:59: �[0m�[0;1;30mnote: �[0mduring template argument deduction for class template partial specialization '_HasToAddress<_Pointer, decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer &>()))>' [with _Pointer = base::SafeRef<history::HistoryService>]�[0m
  195 |   static const bool value = _HasArrow<_Pointer>::value || _HasToAddress<_Pointer>::value;�[0m
      | �[0;1;32m                                                          ^
�[0m�[1m/usr/include/c++/v1/__memory/pointer_traits.h:195:59: �[0m�[0;1;30mnote: �[0min instantiation of template class 'std::_HasToAddress<base::SafeRef<history::HistoryService>>' requested here�[0m
�[1m/usr/include/c++/v1/__type_traits/conjunction.h:27:32: �[0m�[0;1;30mnote: �[0min instantiation of template class 'std::_IsFancyPointer<base::SafeRef<history::HistoryService>>' requested here�[0m
   27 | __expand_to_true<__enable_if_t<_Pred::value>...> __and_helper(int);�[0m
      | �[0;1;32m                               ^
�[0m�[1m/usr/include/c++/v1/__type_traits/conjunction.h:38:39: �[0m�[0;1;30mnote: �[0mwhile substituting explicitly-specified template arguments into function template '__and_helper' �[0m
   38 | using _And _LIBCPP_NODEBUG = decltype(std::__and_helper<_Pred...>(0));�[0m
      | �[0;1;32m                                      ^
�[0m�[1m/usr/include/c++/v1/__memory/pointer_traits.h:200:5: �[0m�[0;1;30mnote: �[0m(skipping 8 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)�[0m
  200 |     _And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value�[0m
      | �[0;1;32m    ^
�[0m�[1m../../base/functional/bind_internal.h:1395:34: �[0m�[0;1;30mnote: �[0min instantiation of template class 'base::internal::UnderlyingReceiverType<const base::SafeRef<history::HistoryService> &>' requested here�[0m
 1395 |   using Type = TypeList<typename UnderlyingReceiver::Type,�[0m
      | �[0;1;32m                                 ^
�[0m�[1m../../base/functional/bind_internal.h:1763:51: �[0m�[0;1;30mnote: �[0min instantiation of template class 'base::internal::MakeUnwrappedTypeList<false, true, base::SafeRef<history::HistoryService> &&>' requested here�[0m
 1763 |                           BoundArgsList, typename UnwrappedArgsList::Type,�[0m
      | �[0;1;32m                                                  ^
�[0m�[1m../../base/functional/bind_internal.h:1866:45: �[0m�[0;1;30mnote: �[0min instantiation of function template specialization 'base::internal::BindHelper<base::RepeatingCallback>::Bind<void (history::HistoryService::*)(), base::SafeRef<history::HistoryService>>' requested here�[0m
 1866 |       return BindHelper<RepeatingCallback>::Bind(std::forward<Functor>(functor),�[0m
      | �[0;1;32m                                            ^
�[0m�[1m../../base/functional/bind.h:66:59: �[0m�[0;1;30mnote: �[0min instantiation of member function 'base::internal::BindRepeatingHelper<void (history::HistoryService::*)(), base::SafeRef<history::HistoryService>>::BindRepeating' requested here�[0m
   66 |   return internal::BindRepeatingHelper<Functor, Args...>::BindRepeating(�[0m
      | �[0;1;32m                                                          ^
�[0m�[1m../../components/history/core/browser/history_service.cc:447:17: �[0m�[0;1;30mnote: �[0min instantiation of function template specialization 'base::BindRepeating<void (history::HistoryService::*)(), base::SafeRef<history::HistoryService>>' requested here�[0m
  447 |           base::BindRepeating(�[0m
      | �[0;1;32m                ^
�[0m�[1m/usr/include/c++/v1/__memory/pointer_traits.h:38:8: �[0m�[0;1;30mnote: �[0mtemplate is declared here�[0m
   38 | struct __pointer_traits_element_type;�[0m
      | �[0;1;32m       ^
�[0m1 error generated.```

@Ahrotahn
Copy link
Contributor Author

That seems to be the same issue as llvm/llvm-project#67449
You could temporarily apply the fix to libcxx/include/__memory/pointer_traits.h if there isn't a newer version available that already includes the change.

@Ahrotahn Ahrotahn linked an issue Jan 24, 2024 that may be closed by this pull request
@LeFroid
Copy link
Contributor

LeFroid commented Jan 24, 2024

Nice find, thanks!

@LeFroid
Copy link
Contributor

LeFroid commented Jan 24, 2024

I had to apply a minor patch to Blink to get the build working with my system's libxml2 (v2.11.5), otherwise this built and ran perfectly! Thanks again for finding out the issue with libc++, that patch to pointer_traits.h resolved the clang issue.

This is the blink patch for libxml,

--- a/third_party/blink/renderer/core/xml/xslt_processor.h
+++ b/third_party/blink/renderer/core/xml/xslt_processor.h
@@ -77,7 +77,7 @@
 
   void reset();
 
-  static void ParseErrorFunc(void* user_data, const xmlError*);
+  static void ParseErrorFunc(void* user_data, xmlError*);
   static void GenericErrorFunc(void* user_data, const char* msg, ...);
 
   // Only for libXSLT callbacks
--- a/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc
+++ b/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc
@@ -66,7 +66,7 @@
   // It would be nice to do something with this error message.
 }
 
-void XSLTProcessor::ParseErrorFunc(void* user_data, const xmlError* error) {
+void XSLTProcessor::ParseErrorFunc(void* user_data, xmlError* error) {
   FrameConsole* console = static_cast<FrameConsole*>(user_data);
   if (!console)
     return;

Copy link
Member

@networkException networkException left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(tested building without rust)

@networkException networkException merged commit 223fe76 into ungoogled-software:master Jan 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants