public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/chromium] epel10.3: revert Migrate OpenType format check bindings to Crubit
@ 2026-09-16 14:21 Than Ngo
  0 siblings, 0 replies; only message in thread
From: Than Ngo @ 2026-09-16 14:21 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/chromium
Branch : epel10.3
Commit : 3ea45e76df8a9e2444bedc01c3292831de6d3f02
Author : Than Ngo <than@redhat.com>
Date   : 2026-09-15T18:19:13+02:00
Stats  : +271/-29 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/chromium/c/3ea45e76df8a9e2444bedc01c3292831de6d3f02?branch=epel10.3

Log:
revert Migrate OpenType format check bindings to Crubit

---
diff --git a/chromium-153-ftbfs-crubit.patch b/chromium-153-ftbfs-crubit.patch
index 0859d48..5e9fe8f 100644
--- a/chromium-153-ftbfs-crubit.patch
+++ b/chromium-153-ftbfs-crubit.patch
@@ -1,40 +1,282 @@
-diff -up chromium-153.0.8010.36/build/rust/crubit/BUILD.gn.crubit chromium-153.0.8010.36/build/rust/crubit/BUILD.gn
---- chromium-153.0.8010.36/build/rust/crubit/BUILD.gn.crubit	2026-09-14 20:15:59.508609350 +0200
-+++ chromium-153.0.8010.36/build/rust/crubit/BUILD.gn	2026-09-14 20:17:25.612646097 +0200
-@@ -8,8 +8,6 @@ import("//build_overrides/crubit.gni")
- group("crubit") {
-   public_configs = [ ":public_config" ]
-   public_deps = [
--    "$crubit_src_dir/support:support_cpp",
--    "$crubit_src_dir/support/rs_std:rs_std_cpp",
-     "//build/rust/std/rules:alloc_bindings",
-     "//build/rust/std/rules:core_bindings",
-     "//build/rust/std/rules:std_bindings",
-@@ -28,7 +26,6 @@ config("public_config") {
- # Dependencies of the `.h` file generated by `cpp_api_from_rust`.
- group("cpp_api_from_rust_bindings_cpp_deps") {
-   public_configs = [ ":public_config" ]
--  public_deps = [ "$crubit_src_dir:cpp_api_from_rust_bindings_cpp_deps" ]
- }
- 
- # Dependencies of the `.rs` file generated by `cpp_api_from_rust`.
-diff -up chromium-153.0.8010.36/third_party/blink/renderer/platform/BUILD.gn.crubit chromium-153.0.8010.36/third_party/blink/renderer/platform/BUILD.gn
---- chromium-153.0.8010.36/third_party/blink/renderer/platform/BUILD.gn.crubit	2026-09-14 20:17:43.578150010 +0200
-+++ chromium-153.0.8010.36/third_party/blink/renderer/platform/BUILD.gn	2026-09-14 20:34:13.459447295 +0200
-@@ -1794,7 +1794,6 @@ component("platform") {
+commit 493e6c3911e33cc356856bafbffc6cf95521266b
+Author: Dominik Röttsches <drott@chromium.org>
+Date:   Thu Aug 13 08:42:15 2026 -0700
+
+    Migrate OpenType format check bindings to Crubit
+    
+    We can remove the Box<> wrapped typing of FontFormatInfo along the way.
+    
+    DEPS checks for the generated output header files requires us to move
+    the format_check target into the fonts subdirectory. This is a good
+    opportunity to move more font specific build rules to the font subdir in
+    the future and reduce the weight of the platform/BUILD.gn build dir.
+    
+    Exercise in using the Crubit bindings mechanism.
+    
+    No functional change.
+    
+    Change-Id: I9440c7285bb707b325b80ee074de51e714ee4884
+    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8244248
+    Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
+    Commit-Queue: Dominik Röttsches <drott@chromium.org>
+    Cr-Commit-Position: refs/heads/main@{#1678858}
+
+diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
+index d5e81a3f07a3c..6a5d275460122 100644
+--- a/third_party/blink/renderer/platform/BUILD.gn
++++ b/third_party/blink/renderer/platform/BUILD.gn
+@@ -186,18 +186,6 @@ group("make_platform_generated") {
+   ]
+ }
+ 
+-rust_static_library("font_format_check") {
+-  allow_unsafe = true  # Needed for FFI that underpins the `cxx` crate.
+-  crate_root = "fonts/opentype/format_check.rs"
+-  sources = [ crate_root ]
+-  cxx_bindings = [ crate_root ]
+-  deps = [
+-    "//third_party/rust/font_types/v0_12:lib",
+-    "//third_party/rust/read_fonts/v0_41:lib",
+-    "//third_party/rust/skrifa/v0_44:lib",
+-  ]
+-}
+-
+ rust_static_library("rustfft_ffi") {
+   allow_unsafe = true  # Needed for FFI that underpins the `cxx` crate.
+   crate_root = "audio/rustfft_ffi.rs"
+@@ -1806,6 +1794,7 @@ component("platform") {
      ":allow_discouraged_type",
      ":blink_platform_public_deps",
      ":platform_export",
--    "//build/rust/crubit",
++    "//build/rust/crubit",
      "//gpu/command_buffer/client:raster_interface",
      "//media/capture:capture_lib",
      "//mojo/public/cpp/base",
-@@ -1822,7 +1821,7 @@ component("platform") {
+@@ -1832,8 +1821,8 @@ component("platform") {
+     "//ui/native_theme/features",
    ]
    deps = [
+-    ":font_format_check",
      ":rustfft_ffi",
--    "fonts:font_format_bindings",
-+    "fonts:font_format",
++    "fonts:font_format_bindings",
      "//base:base_static",
      "//base/allocator:buildflags",
      "//build:chromecast_buildflags",
+diff --git a/third_party/blink/renderer/platform/fonts/BUILD.gn b/third_party/blink/renderer/platform/fonts/BUILD.gn
+new file mode 100644
+index 0000000000000..51b9b03ba7c85
+--- /dev/null
++++ b/third_party/blink/renderer/platform/fonts/BUILD.gn
+@@ -0,0 +1,19 @@
++# Copyright 2026 The Chromium Authors
++# Use of this source code is governed by a BSD-style license that can be
++# found in the LICENSE file.
++
++import("//build/rust/rust_static_library.gni")
++
++rust_static_library("font_format") {
++  crate_root = "opentype/format_check.rs"
++  sources = [ crate_root ]
++  cpp_api_from_rust = {
++    target_name = "font_format_bindings"
++    cpp_namespace = "font_format"
++  }
++  deps = [
++    "//third_party/rust/font_types/v0_12:lib",
++    "//third_party/rust/read_fonts/v0_41:lib",
++    "//third_party/rust/skrifa/v0_44:lib",
++  ]
++}
+diff --git a/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc b/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc
+index b9d2639822bc0..f58e9433d39f4 100644
+--- a/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc
++++ b/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc
+@@ -7,7 +7,6 @@
+ #include "base/containers/span.h"
+ #include "base/containers/span_rust.h"
+ #include "base/numerics/byte_conversions.h"
+-#include "third_party/blink/renderer/platform/fonts/opentype/format_check.rs.h"
+ #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+ #include "third_party/blink/renderer/platform/wtf/vector.h"
+ #include "third_party/skia/include/core/SkTypeface.h"
+@@ -15,35 +14,37 @@
+ namespace blink {
+ 
+ FontFormatCheck::FontFormatCheck(sk_sp<SkData> sk_data)
+-    : format_info_(font_format_check::get_font_format_info(
++    : format_info_(font_format::get_font_format_info(
+           base::SpanToRustSlice(sk_data->byteSpan()))) {}
+ 
++FontFormatCheck::~FontFormatCheck() = default;
++
+ bool FontFormatCheck::IsVariableFont() const {
+-  return font_format_check::is_variable(*format_info_);
++  return font_format::is_variable(format_info_);
+ }
+ 
+ bool FontFormatCheck::IsCbdtCblcColorFont() const {
+-  return font_format_check::is_cbdt_cblc(*format_info_);
++  return font_format::is_cbdt_cblc(format_info_);
+ }
+ 
+ bool FontFormatCheck::IsEbdtEblcMonochromeFont() const {
+-  return font_format_check::is_ebdt_eblc(*format_info_);
++  return font_format::is_ebdt_eblc(format_info_);
+ }
+ 
+ bool FontFormatCheck::IsColrCpalColorFontV0() const {
+-  return font_format_check::is_colrv0(*format_info_);
++  return font_format::is_colrv0(format_info_);
+ }
+ 
+ bool FontFormatCheck::IsColrCpalColorFontV1() const {
+-  return font_format_check::is_colrv1(*format_info_);
++  return font_format::is_colrv1(format_info_);
+ }
+ 
+ bool FontFormatCheck::IsSbixColorFont() const {
+-  return font_format_check::is_sbix(*format_info_);
++  return font_format::is_sbix(format_info_);
+ }
+ 
+ bool FontFormatCheck::IsCff2OutlineFont() const {
+-  return font_format_check::is_cff2(*format_info_);
++  return font_format::is_cff2(format_info_);
+ }
+ 
+ bool FontFormatCheck::IsVariableColrV0Font() const {
+@@ -57,7 +58,7 @@ bool FontFormatCheck::IsColorFont() const {
+ 
+ bool FontFormatCheck::IsAvar2Font() const {
+   return RuntimeEnabledFeatures::FontFormatAvar2Enabled() &&
+-         font_format_check::is_avar2(*format_info_);
++         font_format::is_avar2(format_info_);
+ }
+ 
+ FontFormatCheck::VariableFontSubType FontFormatCheck::ProbeVariableFont(
+diff --git a/third_party/blink/renderer/platform/fonts/opentype/font_format_check.h b/third_party/blink/renderer/platform/fonts/opentype/font_format_check.h
+index 19d2639233b07..af50dbdf74d00 100644
+--- a/third_party/blink/renderer/platform/fonts/opentype/font_format_check.h
++++ b/third_party/blink/renderer/platform/fonts/opentype/font_format_check.h
+@@ -5,7 +5,7 @@
+ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_OPENTYPE_FONT_FORMAT_CHECK_H_
+ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_OPENTYPE_FONT_FORMAT_CHECK_H_
+ 
+-#include "third_party/blink/renderer/platform/fonts/opentype/format_check.rs.h"
++#include "third_party/blink/renderer/platform/fonts/font_format.h"
+ #include "third_party/blink/renderer/platform/platform_export.h"
+ #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
+ #include "third_party/skia/include/core/SkData.h"
+@@ -19,7 +19,7 @@ class PLATFORM_EXPORT FontFormatCheck {
+ 
+  public:
+   explicit FontFormatCheck(sk_sp<SkData>);
+-  virtual ~FontFormatCheck() = default;
++  virtual ~FontFormatCheck();
+   virtual bool IsVariableFont() const;
+   virtual bool IsCbdtCblcColorFont() const;
+   virtual bool IsEbdtEblcMonochromeFont() const;
+@@ -46,7 +46,7 @@ class PLATFORM_EXPORT FontFormatCheck {
+   enum class COLRVersion { kCOLRV0, kCOLRV1, kNoCOLR };
+ 
+  private:
+-  rust::Box<font_format_check::FontFormatInfo> format_info_;
++  font_format::FontFormatInfo format_info_;
+ };
+ 
+ }  // namespace blink
+diff --git a/third_party/blink/renderer/platform/fonts/opentype/format_check.rs b/third_party/blink/renderer/platform/fonts/opentype/format_check.rs
+index eda8e6b2b8188..b99f0ec8655e6 100644
+--- a/third_party/blink/renderer/platform/fonts/opentype/format_check.rs
++++ b/third_party/blink/renderer/platform/fonts/opentype/format_check.rs
+@@ -23,7 +23,7 @@ pub struct FontFormatInfo {
+     format_flags: Option<FontFormatFlags>,
+ }
+ 
+-pub fn get_font_format_info(font_bytes: &[u8]) -> Box<FontFormatInfo> {
++pub fn get_font_format_info(font_bytes: &[u8]) -> FontFormatInfo {
+     let file_ref = make_font_ref_internal(font_bytes, 0);
+ 
+     match file_ref {
+@@ -32,11 +32,11 @@ pub fn get_font_format_info(font_bytes: &[u8]) -> Box<FontFormatInfo> {
+                 font.table_directory().table_records().iter().map(|e| e.tag()).collect();
+             let color_version = get_colr_version(&font);
+             let avar_version = get_avar_version(&font);
+-            Box::new(FontFormatInfo {
++            FontFormatInfo {
+                 format_flags: Some(FontFormatFlags { table_tags, color_version, avar_version }),
+-            })
++            }
+         }
+-        _ => Box::new(FontFormatInfo::default()),
++        _ => FontFormatInfo::default(),
+     }
+ }
+ 
+@@ -44,10 +44,10 @@ fn get_colr_version(font_ref: &FontRef) -> Option<u16> {
+     Some(font_ref.colr().ok()?.version())
+ }
+ 
+-fn is_colrv1(format_info: &FontFormatInfo) -> bool {
++pub fn is_colrv1(format_info: &FontFormatInfo) -> bool {
+     matches!(&format_info.format_flags, Some(FontFormatFlags { color_version: Some(1), .. }),)
+ }
+-fn is_colrv0(format_info: &FontFormatInfo) -> bool {
++pub fn is_colrv0(format_info: &FontFormatInfo) -> bool {
+     matches!(&format_info.format_flags, Some(FontFormatFlags { color_version: Some(0), .. }),)
+ }
+ 
+@@ -56,7 +56,7 @@ fn get_avar_version(font_ref: &FontRef) -> Option<(u16, u16)> {
+     Some((version.major, version.minor))
+ }
+ 
+-fn is_avar2(format_info: &FontFormatInfo) -> bool {
++pub fn is_avar2(format_info: &FontFormatInfo) -> bool {
+     matches!(&format_info.format_flags, Some(FontFormatFlags { avar_version: Some((2, _)), .. }),)
+ }
+ 
+@@ -69,39 +69,22 @@ fn has_tags(format_info: &FontFormatInfo, query: &[Tag]) -> bool {
+     }
+ }
+ 
+-fn is_variable(format_info: &FontFormatInfo) -> bool {
++pub fn is_variable(format_info: &FontFormatInfo) -> bool {
+     has_tags(format_info, &[Tag::new(b"fvar")])
+ }
+ 
+-fn is_sbix(format_info: &FontFormatInfo) -> bool {
++pub fn is_sbix(format_info: &FontFormatInfo) -> bool {
+     has_tags(format_info, &[Tag::new(b"sbix")])
+ }
+ 
+-fn is_cbdt_cblc(format_info: &FontFormatInfo) -> bool {
++pub fn is_cbdt_cblc(format_info: &FontFormatInfo) -> bool {
+     has_tags(format_info, &[Tag::new(b"CBDT"), Tag::new(b"CBLC")])
+ }
+ 
+-fn is_ebdt_eblc(format_info: &FontFormatInfo) -> bool {
++pub fn is_ebdt_eblc(format_info: &FontFormatInfo) -> bool {
+     has_tags(format_info, &[Tag::new(b"EBDT"), Tag::new(b"EBLC")])
+ }
+ 
+-fn is_cff2(format_info: &FontFormatInfo) -> bool {
++pub fn is_cff2(format_info: &FontFormatInfo) -> bool {
+     has_tags(format_info, &[Tag::new(b"CFF2")])
+ }
+-
+-#[cxx::bridge(namespace = "font_format_check")]
+-pub mod ffi {
+-    extern "Rust" {
+-        type FontFormatInfo;
+-
+-        fn get_font_format_info(font_bytes: &[u8]) -> Box<FontFormatInfo>;
+-        fn is_colrv1(format_info: &FontFormatInfo) -> bool;
+-        fn is_colrv0(format_info: &FontFormatInfo) -> bool;
+-        fn is_cbdt_cblc(format_info: &FontFormatInfo) -> bool;
+-        fn is_ebdt_eblc(format_info: &FontFormatInfo) -> bool;
+-        fn is_variable(format_info: &FontFormatInfo) -> bool;
+-        fn is_sbix(format_info: &FontFormatInfo) -> bool;
+-        fn is_cff2(format_info: &FontFormatInfo) -> bool;
+-        fn is_avar2(format_info: &FontFormatInfo) -> bool;
+-    }
+-}

diff --git a/chromium.spec b/chromium.spec
index 4683afc..f835085 100644
--- a/chromium.spec
+++ b/chromium.spec
@@ -1147,7 +1147,7 @@ Qt6 UI for chromium.
 %patch -P315 -p1 -b .rustc-ftbfs
 %patch -P310 -p1 -b .rust-FTBFS-suppress-warnings
 %patch -P311 -p1 -b .fstack-protector-strong
-%patch -P312 -p1 -b .ftbfs-crubit
+%patch -P312 -p1 -R -b .ftbfs-crubit
 
 %if 0%{?rhel} && 0%{?rhel} < 10
 %patch -P354 -p1 -b .split-threshold-for-reg-with-hint

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-16 14:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 14:21 [rpms/chromium] epel10.3: revert Migrate OpenType format check bindings to Crubit Than Ngo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox