AUR AI Reviewer

Review Results

Version #3173 of ungoogled-chromium · commit 398f006dda60 · status Reviewed

Risk 0/5 · Safe .SRCINFO
Result #6549

Comment

The only change in .SRCINFO is a version bump from 156.0.8078.79 to 157.0.8103.78. No sources, checksums, build steps, install scripts, or packaging metadata were altered in the reviewed hunk, so there is no direct security impact visible here. This appears to be a routine package version update.

@@ -1,6 +1,6 @@
 pkgbase = ungoogled-chromium
 	pkgdesc = A lightweight approach to removing Google web service dependency
-	pkgver = 156.0.8078.79
+	pkgver = 157.0.8103.78
 	pkgrel = 1
 	url = https://github.com/ungoogled-software/ungoogled-chromium
 	arch = x86_64
Risk 0/5 · Safe .SRCINFO
Result #6550

Comment

The change only adjusts .SRCINFO makedepends, adding rust-src and rustc-dev and reordering rust/rust-bindgen. This is metadata-only and does not introduce new runtime behavior, install scripts, network fetches, or packaging actions. The added Rust components are plausible build dependencies for Chromium's Rust-based build steps and do not by themselves indicate a security issue.

@@ -20,8 +20,10 @@ pkgbase = ungoogled-chromium
 	makedepends = pipewire
 	makedepends = python
 	makedepends = qt6-base
-	makedepends = rust-bindgen
 	makedepends = rust
+	makedepends = rust-bindgen
+	makedepends = rust-src
+	makedepends = rustc-dev
 	makedepends = typescript
 	makedepends = vulkan-headers
 	depends = alsa-lib
Risk 0/5 · Safe .SRCINFO
Result #6551

Comment

The .SRCINFO change updates Chromium versioned sources and adds a new pinned git source for crubit at a specific commit, which is preferable to a floating branch. The URLs are HTTPS and the added source is commit-pinned, so there is no obvious supply-chain red flag in this diff alone. I do note that .SRCINFO is metadata only; the security impact depends on the corresponding PKGBUILD and any new build-time use of crubit, but nothing in the provided hunk indicates malicious behavior or integrity bypass.

@@ -84,13 +86,14 @@ pkgbase = ungoogled-chromium
 	optdepends = qt6-base: Qt support
 	optdepends = org.freedesktop.secrets: password storage backend on GNOME, KDE and Xfce
 	optdepends = upower: Battery Status API support
-	provides = chromium=156.0.8078.79
-	provides = chromedriver=156.0.8078.79
+	provides = chromium=157.0.8103.78
+	provides = chromedriver=157.0.8103.78
 	conflicts = chromium
 	conflicts = chromedriver
 	options = !lto
-	source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-156.0.8078.79-lite.tar.xz
-	source = ungoogled-chromium-156.0.8078.79-1.tar.gz::https://github.com/ungoogled-software/ungoogled-chromium/archive/156.0.8078.79-1.tar.gz
+	source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-157.0.8103.78-lite.tar.xz
+	source = git+https://chromium.googlesource.com/external/github.com/google/crubit.git#commit=25d2c01bde904c3333bb2d48201e5cbb186a1c7f
+	source = ungoogled-chromium-157.0.8103.78-1.tar.gz::https://github.com/ungoogled-software/ungoogled-chromium/archive/157.0.8103.78-1.tar.gz
 	source = https://github.com/foutrelis/chromium-launcher/archive/v8/chromium-launcher-8.tar.gz
 	source = chromium-138-nodejs-version-check.patch
 	source = chromium-145-fix-SYS_SECCOMP.patch
Risk 0/5 · Safe .SRCINFO
Result #6552

Comment

The change is a routine version bump in .SRCINFO for ungoogled-chromium from 156 to 157, updating source URLs, patch names, and checksums accordingly. The new VCS source is pinned to a specific commit, the main tarball remains HTTPS, and there are no signs of added build-time network fetches, install-script changes, privilege escalation, or suspicious extra sources in this diff. The added makedepends (rust-src, rustc-dev) are consistent with upstream build requirements and do not by themselves indicate a security issue. Overall this appears low risk.

@@ -103,18 +106,18 @@ pkgbase = ungoogled-chromium
 	source = chromium-153-hermetic-python.patch
 	source = chromium-153-iamf-tools-unbundled-opus.patch
 	source = chromium-155-use-system-esbuild.patch
-	source = chromium-156-crubit.patch
-	source = chromium-156-remove-private_verification_tokens.patch
-	source = chromium-156-revert-gn-check-includes.patch
-	source = chromium-156-typescript.patch
 	source = chromium-156-isolatedDeclarations.patch
+	source = chromium-157-revert-gn-check-includes.patch
+	source = chromium-157-typescript.patch
+	source = chromium-157-crubit.patch
 	source = compiler-rt-adjust-paths.patch
 	source = increase-fortify-level.patch
 	source = enable-widevine-arm64.patch
 	source = use-oauth2-client-switches-as-default.patch
 	source = glibc-2.42-baud-rate-fix.patch
-	sha256sums = d9e8b637dbdd3a1cccb4966e81a66e3f3c4c29f5ce9732a70f5a4f949cd03923
-	sha256sums = 6d77c1e7430737937a3a4b63c130a7b4623344482c9b2979a91dfad716414e82
+	sha256sums = 9fdce9d3c866f97f14f7a4250915e8e5b729dc952fcfb3a35507b126233f0660
+	sha256sums = a9c0f429c7a45d31cecd8bd36fc636fbedaf49ff57264a22e3f1eabd4cab523a
+	sha256sums = 4028ace0113428dd9ffb0d27f27a54af1b3c1cec9431862ea130ec7f5a74cf9f
 	sha256sums = 213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a
 	sha256sums = 11a96ffa21448ec4c63dd5c8d6795a1998d8e5cd5a689d91aea4d2bdd13fb06e
 	sha256sums = 4fc040a0656a0a524dd8ad090cd129fc5b6cb21adcc66be82080165789e8c13e
Risk 0/5 · Safe .SRCINFO
Result #6553

Comment

The .SRCINFO update is consistent with a routine upstream version bump: it changes pkgver/provides/source filenames and refreshes sha256 sums for the new release and patch set. The only notable addition is a pinned git source for Chromium's crubit dependency (`#commit=25d2c01...`), which is properly commit-pinned and uses HTTPS, so it does not introduce a floating or untrusted fetch. No suspicious new install scripts, privilege changes, or build-time network behavior are indicated by this metadata-only change.

@@ -127,11 +130,10 @@ pkgbase = ungoogled-chromium
 	sha256sums = ebf74154266d0b6d6cc957c413f845052c5fcfce7745befb8821595cdf3f7d49
 	sha256sums = 2ab9fbe653829ce692f83ee780aad07e8c83a6686e51ab9459ad736cfa2850ee
 	sha256sums = ded2abcb912ac4b6ad139e56384eea8f3b470cf57ecb0baa2c2d042df7575a23
-	sha256sums = 0c8bd7769496ab71116cd73ac17c096b0979fa70fb2e76676f76d34c7424449e
-	sha256sums = 8170368b531a0ae70071da054db4a09a6902b8b7854083d5505570f86a73e644
-	sha256sums = c666f9b009d3a2c737501d714689677e6d474982695966651fe7cdbcbc6e5815
-	sha256sums = 946d4f70daeb446b911197bca804983d305c0ee809bc5507d05451bd07fe9523
 	sha256sums = f6aefbd3f70dbda9242cf815a1dca56af729632166bc57e5067755b119cc95de
+	sha256sums = 3b663878c6b05e612ba103152c48f91dde27cabe7d55ba48427a72829ff4922f
+	sha256sums = 655a43eaff824ba27f359790c31c43abd9fc4234026b0d039b8f2633dcb057cb
+	sha256sums = eda45eaa5ba6c2ee86389200d4b758f0a06ffb32f3d06c3d0b60f2714c5d237f
 	sha256sums = ec8e49b7114e2fa2d359155c9ef722ff1ba5fe2c518fa48e30863d71d3b82863
 	sha256sums = d634d2ce1fc63da7ac41f432b1e84c59b7cceabf19d510848a7cff40c8025342
 	sha256sums = 5ee4bb69379ac0cea7946c9f8f4ca9e20e0a9e4ee2ee9121eb0ebbb94dd7e928
Risk 0/5 · Safe PKGBUILD
Result #6554

Comment

The change is a straightforward version bump plus a pinned Rust/crubit revision adjustment. I do not see any new sources, build-time network fetches, install scripts, privilege escalation, or packaging behavior changes in the provided hunk. The commented-out newer crubit commit is not used; the active value is still a fixed commit hash, which is acceptable from an integrity standpoint. No security-relevant red flags are introduced by this diff alone.

@@ -12,14 +12,18 @@
 # Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
 
 pkgname=ungoogled-chromium
-pkgver=156.0.8078.79
+pkgver=157.0.8103.78
 pkgrel=1
 _launcher_ver=8
 _manual_clone=0
 _system_clang=1
+# Check the CRUBIT_REVISION found in tools/rust/update_rust.py
+#_crubit_rev=20dc640430bd60ff2f7f8dbf69c311c5f807adde
+# The commit above cannot be built successfully, use the last known good commit for stable toolchain
+_crubit_rev=25d2c01bde904c3333bb2d48201e5cbb186a1c7f
 # ungoogled chromium variables
 _uc_usr=ungoogled-software
-_uc_ver=156.0.8078.79-1
+_uc_ver=157.0.8103.78-1
 pkgdesc="A lightweight approach to removing Google web service dependency"
 arch=('x86_64')
 url="https://github.com/ungoogled-software/ungoogled-chromium"
Risk 1/5 · Low PKGBUILD
Result #6555

Comment

The change is low risk. It adds Rust toolchain components (rust-src, rustc-dev) and a pinned git source for crubit, then builds a specific crubit binary during prepare/build. The new source is pinned to a commit over HTTPS, and the build uses cargo with --locked/--frozen, so there is no obvious floating dependency or arbitrary network fetch beyond the declared source. I did not see any privilege escalation, persistence, or install-time execution changes in this hunk. The only notable concern is increased build-time complexity and a new upstream git dependency, but it is pinned and checksum-verified via PKGBUILD source handling, so this does not rise to a security issue.

@@ -78,8 +82,10 @@ makedepends=(
   'pipewire'
   'python'
   'qt6-base'
-  'rust-bindgen'
   'rust'
+  'rust-bindgen'
+  'rust-src'
+  'rustc-dev'
   'typescript'
   'vulkan-headers'
 )
Risk 1/5 · Low PKGBUILD
Result #6556

Comment

The change adds a new VCS source from chromium.googlesource.com pinned to a specific commit, so there is no floating branch risk. The accompanying PKGBUILD changes are consistent with integrating Chromium's Crubit/Rust toolchain support: new rust-related makedepends, a pinned crubit patch, and build-time cargo fetch/build steps for the vendored Crubit helper. I do not see any obvious supply-chain red flags such as unpinned downloads, curl|bash, privilege escalation, or writes outside $pkgdir. The only notable concern is that the build now fetches and compiles an additional upstream Rust repository during prepare()/build(), which increases the trusted build surface, but it is pinned and checksum-verified via makepkg. Overall this looks like a legitimate packaging update rather than a malicious insertion.

@@ -93,6 +99,7 @@ provides=("chromium=$pkgver" "chromedriver=$pkgver")
 conflicts=('chromium' 'chromedriver')
 options=('!lto') # Chromium adds its own flags for ThinLTO
 source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver-lite.tar.xz
+        "git+https://chromium.googlesource.com/external/github.com/google/crubit.git#commit=$_crubit_rev"
         $pkgname-$_uc_ver.tar.gz::https://github.com/$_uc_usr/ungoogled-chromium/archive/$_uc_ver.tar.gz
         https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver/chromium-launcher-$_launcher_ver.tar.gz
         chromium-138-nodejs-version-check.patch
Risk 1/5 · Low PKGBUILD
Result #6557

Comment

The change is mostly a version bump plus patch/source refresh, but it introduces a new VCS source from chromium.googlesource.com for crubit pinned to a specific commit, which is acceptable from an integrity standpoint. I do not see any obvious malicious behavior in the PKGBUILD diff: no network fetches outside source=(), no privilege escalation, no writes outside $pkgdir, and the added cargo fetch/build is for a pinned upstream component. The new symlinked icon files in package() are benign. Overall this looks like routine packaging maintenance with moderate supply-chain risk only from the added external git source, but no high-confidence security issue.

@@ -106,18 +113,18 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom
         chromium-153-hermetic-python.patch
         chromium-153-iamf-tools-unbundled-opus.patch
         chromium-155-use-system-esbuild.patch
-        chromium-156-crubit.patch
-        chromium-156-remove-private_verification_tokens.patch
-        chromium-156-revert-gn-check-includes.patch
-        chromium-156-typescript.patch
         chromium-156-isolatedDeclarations.patch
+        chromium-157-revert-gn-check-includes.patch
+        chromium-157-typescript.patch
+        chromium-157-crubit.patch
         compiler-rt-adjust-paths.patch
         increase-fortify-level.patch
         enable-widevine-arm64.patch
         use-oauth2-client-switches-as-default.patch
         glibc-2.42-baud-rate-fix.patch)
-sha256sums=('d9e8b637dbdd3a1cccb4966e81a66e3f3c4c29f5ce9732a70f5a4f949cd03923'
-            '6d77c1e7430737937a3a4b63c130a7b4623344482c9b2979a91dfad716414e82'
+sha256sums=('9fdce9d3c866f97f14f7a4250915e8e5b729dc952fcfb3a35507b126233f0660'
+            'a9c0f429c7a45d31cecd8bd36fc636fbedaf49ff57264a22e3f1eabd4cab523a'
+            '4028ace0113428dd9ffb0d27f27a54af1b3c1cec9431862ea130ec7f5a74cf9f'
             '213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a'
             '11a96ffa21448ec4c63dd5c8d6795a1998d8e5cd5a689d91aea4d2bdd13fb06e'
             '4fc040a0656a0a524dd8ad090cd129fc5b6cb21adcc66be82080165789e8c13e'
Risk 0/5 · Safe PKGBUILD
Result #6558

Comment

The change is a routine upstream version bump plus packaging updates for Chromium 157. The new source is pinned to a specific crubit commit over HTTPS, and the added build steps fetch and compile that dependency from the declared source tree rather than downloading arbitrary code at build time. I did not find any suspicious network access, privilege escalation, or installation outside $pkgdir in the modified hunk. The extra icon symlinks in package() are benign. Overall this looks low risk.

@@ -130,11 +137,10 @@ sha256sums=('d9e8b637dbdd3a1cccb4966e81a66e3f3c4c29f5ce9732a70f5a4f949cd03923'
             'ebf74154266d0b6d6cc957c413f845052c5fcfce7745befb8821595cdf3f7d49'
             '2ab9fbe653829ce692f83ee780aad07e8c83a6686e51ab9459ad736cfa2850ee'
             'ded2abcb912ac4b6ad139e56384eea8f3b470cf57ecb0baa2c2d042df7575a23'
-            '0c8bd7769496ab71116cd73ac17c096b0979fa70fb2e76676f76d34c7424449e'
-            '8170368b531a0ae70071da054db4a09a6902b8b7854083d5505570f86a73e644'
-            'c666f9b009d3a2c737501d714689677e6d474982695966651fe7cdbcbc6e5815'
-            '946d4f70daeb446b911197bca804983d305c0ee809bc5507d05451bd07fe9523'
             'f6aefbd3f70dbda9242cf815a1dca56af729632166bc57e5067755b119cc95de'
+            '3b663878c6b05e612ba103152c48f91dde27cabe7d55ba48427a72829ff4922f'
+            '655a43eaff824ba27f359790c31c43abd9fc4234026b0d039b8f2633dcb057cb'
+            'eda45eaa5ba6c2ee86389200d4b758f0a06ffb32f3d06c3d0b60f2714c5d237f'
             'ec8e49b7114e2fa2d359155c9ef722ff1ba5fe2c518fa48e30863d71d3b82863'
             'd634d2ce1fc63da7ac41f432b1e84c59b7cceabf19d510848a7cff40c8025342'
             '5ee4bb69379ac0cea7946c9f8f4ca9e20e0a9e4ee2ee9121eb0ebbb94dd7e928'
Risk 0/5 · Safe PKGBUILD
Result #6559

Comment

The change only removes `python-six` from `makedepends` in the `_manual_clone` path. This is a dependency adjustment with no impact on source integrity, build-time code execution, packaging paths, permissions, or install-time behavior. I did not find any new network access, privilege escalation, or persistence mechanism introduced by this diff hunk.

@@ -144,7 +150,7 @@ sha256sums=('d9e8b637dbdd3a1cccb4966e81a66e3f3c4c29f5ce9732a70f5a4f949cd03923'
 if (( _manual_clone )); then
   source[0]=fetch-chromium-release
   sha256sums[0]='2e2f36e3cd1ebc4ad57fd310774a5e5e9db77883d5f9374fedeaabd3c103b819'
-  makedepends+=('python-httplib2' 'python-pyparsing' 'python-six' 'npm' 'rsync')
+  makedepends+=('python-httplib2' 'python-pyparsing' 'npm' 'rsync')
 fi
 
 # Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
Risk 0/5 · Safe PKGBUILD
Result #6560

Comment

The change is low risk. It only updates patch filenames to newer versions and adds a local sed edit in prepare() that removes a brotli:headers dependency from pdfium's BUILD.gn to match the system brotli packaging. There are no new network fetches, privilege changes, install-script changes, or suspicious build-time execution patterns in the shown hunk. The sed edit is a straightforward source-tree modification and does not introduce an obvious security issue by itself.

@@ -254,18 +260,19 @@ prepare() {
 
   patch -Np1 -i ../chromium-155-use-system-esbuild.patch
 
-  patch -Np1 -i ../chromium-156-crubit.patch
-
-  patch -Np1 -i ../chromium-156-remove-private_verification_tokens.patch
+  patch -Np1 -i ../chromium-157-crubit.patch
 
-  patch -Np1 -i ../chromium-156-revert-gn-check-includes.patch
+  patch -Np1 -i ../chromium-157-revert-gn-check-includes.patch
 
   patch -Np1 -i ../chromium-156-isolatedDeclarations.patch
 
   # Work around TypeScript becoming a build dependency: disable tsgo for the
   # WebUI and point devtools at the system tsc binary
   # https://github.com/ungoogled-software/ungoogled-chromium/pull/3966
-  patch -Np1 -i ../chromium-156-typescript.patch
+  patch -Np1 -i ../chromium-157-typescript.patch
+
+  # The unbundled brotli doesn't provide brotli:headers
+  sed -i '/brotli:headers/ d' third_party/pdfium/core/fxcodec/BUILD.gn
 
   rm -rf third_party/devtools-frontend/src/node_modules/esbuild/
   ln -s /usr/lib/node_modules/esbuild/ third_party/devtools-frontend/src/node_modules/esbuild
Risk 1/5 · Low PKGBUILD
Result #6561

Comment

The change adds a new upstream source fetched over HTTPS from chromium.googlesource.com and pins it to a specific commit, which is good. The new build steps only fetch Rust dependencies for the checked-out crubit subproject via `cargo fetch --locked` and build a helper binary from source; there is no obvious curl|bash, privilege escalation, or installation outside `$pkgdir`. The added symlink into the Chromium tree and the extra GN args appear to wire in the locally built crubit tool, not introduce a persistence mechanism. I do note the build now depends on network access during `cargo fetch`, but this is from a pinned git source and is a reproducibility concern rather than a clear security issue in this diff. Overall this looks low risk.

@@ -296,12 +303,14 @@ prepare() {
            third_party/jdk/current/bin \
            third_party/gperf/cipd/bin \
            third_party/dawn/tools/golang/linux-amd64/bin \
+           third_party/rust-toolchain/crubit/lib/third_party/ \
 
   ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
   ln -s /usr/bin/java third_party/jdk/current/bin/
   ln -s /usr/bin/rustc third_party/rust-toolchain/bin/
   ln -s /usr/bin/gperf third_party/gperf/cipd/bin/
   ln -s /usr/bin/go third_party/dawn/tools/golang/linux-amd64/bin/
+  ln -s "$srcdir/crubit" third_party/rust-toolchain/crubit/lib/third_party/crubit
 
   # Remove bundled libraries for which we will use the system copies; this
   # *should* do what the remove_bundled_libraries.py script does, with the
Risk 1/5 · Low PKGBUILD
Result #6562

Comment

Risk is low. The change adds a pinned git source for crubit and fetches its Rust dependencies during prepare(), but the revision is fixed and the fetch is only for the declared upstream source tree, not an arbitrary network download in package(). The rest of the hunk wires the fetched source into the Chromium build and installs the resulting binary into $srcdir/$pkgdir paths. I do not see evidence of privilege escalation, persistence, or unverified external code beyond the already-pinned upstream crubit repository.

@@ -332,6 +341,9 @@ prepare() {
       -s third_party/dawn --revision gpu/webgpu/DAWN_VERSION \
       --header gpu/webgpu/dawn_commit_hash.h
   fi
+
+  cd ../crubit
+  cargo fetch --locked --target host-tuple
 }
 
 build() {
Risk 1/5 · Low PKGBUILD
Result #6563

Comment

Risk is low. The PKGBUILD change adds a new upstream Crubit git source pinned to a specific commit, updates matching patch files, and adjusts build flags to use the system Rust sysroot. I did not find any curl|bash, unpinned VCS source, network fetches outside declared sources, privilege escalation, or install-time persistence. The only notable behavior is a build-time `cargo fetch`/`cargo build` in the new Crubit subdirectory, but it operates on a pinned source and is consistent with the added dependency set. The package() change only adds symlinks for icon names. Overall this looks like a legitimate build-system update rather than a supply-chain or post-install attack.

@@ -352,6 +364,9 @@ build() {
     export NM=$_clang_path/llvm-nm
   fi
 
+  # /usr for pacman managed rust
+  local _rust_sysroot="/usr"
+
   local _flags=(
     'custom_toolchain="//build/toolchain/linux/unbundle:default"'
     'host_toolchain="//build/toolchain/linux/unbundle:default"'
Risk 1/5 · Low PKGBUILD
Result #6564

Comment

The change adds a new pinned git source for Chromium's Crubit toolchain and builds a helper binary from it during prepare()/build(). I don't see obvious malicious behavior in the diff: the source is HTTPS and pinned to a commit, the new cargo fetch is against that declared source, and the built binary is installed only into $srcdir/$pkgdir for Chromium's build. The added GN arg and patch are consistent with enabling Chromium's Rust/Crubit integration. The only notable risk is increased build-time complexity and a new network-fetched dependency, but it is pinned and checksum-verified via the source array, so this does not rise to a security issue in this change.

@@ -376,6 +391,7 @@ build() {
     'enable_platform_hevc=true'
     'enable_hevc_parser_and_hw_decoder=true'
     'use_clang_modules=false'
+    'rust_crubit_root="//third_party/rust-toolchain/crubit/"'
   )
 
   if [[ -n ${_system_libs[icu]+set} ]]; then
Risk 1/5 · Low PKGBUILD
Result #6565

Comment

The change is a packaging update for a new Chromium release and adds support for building Crubit from a pinned upstream git commit. The new source is HTTPS and pinned to a specific commit, and the added build steps stay within the package build context. I do not see any curl|bash, privilege escalation, or writes outside $pkgdir. The only notable risk is that this introduces a new VCS source and executes a Rust cargo build during packaging, but it is pinned and fetched via cargo fetch with locked mode, so the supply-chain exposure is limited and expected for this package.

@@ -405,7 +421,7 @@ build() {
     export RUSTC_BOOTSTRAP=1
 
     _flags+=(
-      'rust_sysroot_absolute="/usr"'
+      "rust_sysroot_absolute=\"$_rust_sysroot\""
       'rust_bindgen_root="/usr"'
       "rustc_version=\"$(rustc --version | awk '{ print $2 ;}')\""
     )
Risk 3/5 · Elevated PKGBUILD
Result #6566

Comment

The added build step compiles and installs a Rust binary from the adjacent `crubit` source tree, which is not part of the normal Chromium build and introduces a new code path with elevated trust requirements. It also sets `RUSTC_BOOTSTRAP=1`, disabling Rust's stability protections, and injects linker flags that add an RPATH into the produced binary. While this is not an obvious backdoor by itself, it is a meaningful supply-chain and build-integrity change: the package now depends on an additional component being built at package time, with relaxed Rust safety constraints and custom runtime search paths. I did not find evidence in this hunk alone of network access, persistence, or direct privilege escalation, so the risk is moderate rather than high.

@@ -438,6 +454,16 @@ build() {
   # https://crbug.com/957519#c122
   CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS}
 
+  (
+    cd ../crubit
+    _rustc_libs="$_rust_sysroot/lib/rustlib/$(rustc --print host-tuple)/lib"
+    export CARGO_TARGET_DIR=target
+    export RUSTC_BOOTSTRAP=1
+    export RUSTFLAGS+=" -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$_rustc_libs"
+    cargo build --frozen --release -p cc_bindings_from_rs --bin cc_bindings_from_rs
+    install -Dm755 -t ../chromium-$pkgver/third_party/rust-toolchain/crubit/bin/ target/release/cc_bindings_from_rs
+  )
+
   msg2 'Configuring Chromium'
   gn gen out/Release --args="${_flags[*]}"
   msg2 'Building Chromium'
Risk 0/5 · Safe PKGBUILD
Result #6567

Comment

The only change in the reviewed hunk is adding symlinks for `chromium-browser.png` to existing packaged icon files. This stays entirely within `$pkgdir`, does not introduce network access, privilege escalation, or executable code, and appears to be a harmless compatibility fix for Chromium's internal icon name. No security-relevant issues are evident in this hunk.

@@ -516,6 +542,13 @@ package() {
       "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
   done
 
+  # chromium uses the icon name "chromium-browser" internally
+  # https://github.com/chromium/chromium/blob/160.0.8155.1/chrome/browser/shell_integration_linux.cc#L604
+  for size in 16 24 32 48 64 128 256; do
+    ln -sv chromium.png \
+      "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser.png"
+  done
+
   install -Dvm644 LICENSE "$pkgdir/usr/share/licenses/chromium/LICENSE"
 }
 
Risk 0/5 · Safe REUSE.toml
Result #6568

Comment

The change only removes two patch filenames from REUSE.toml's declared file list. This is a metadata/license-tracking update, not an executable build or install change. I did not find any indication of added network access, privilege escalation, persistence, or other security-sensitive behavior in this diff hunk itself. Risk is therefore minimal.

@@ -52,8 +52,6 @@ path = [
     "increase-fortify-level.patch",
     "use-oauth2-client-switches-as-default.patch",
     "chromium-150-revert-avx-flag-change.patch",
-    "chromium-152-unbundle-minizip-undo-unicode.patch",
-    "chromium-152-unbundle-opus-devtools.patch",
 ]
 SPDX-FileCopyrightText = "chromium contributors"
 SPDX-License-Identifier = "BSD-3-Clause"
Risk 0/5 · Safe REUSE.toml
Result #6569

Comment

The change only updates REUSE metadata to rename/remove patch filenames in the annotation list. It does not alter build logic, sources, install scripts, or any executable content. Based on the diff shown, this is a low-risk bookkeeping change with no security impact evident.

@@ -61,12 +59,11 @@ SPDX-License-Identifier = "BSD-3-Clause"
 [[annotations]]
 path = [
     "chromium-153-hermetic-python.patch",
-    "chromium-156-crubit.patch",
-    "chromium-156-remove-private_verification_tokens.patch",
-    "chromium-156-revert-gn-check-includes.patch",
-    "chromium-156-typescript.patch",
-    "chromium-156-isolatedDeclarations.patch",
     "chromium-155-use-system-esbuild.patch",
+    "chromium-157-crubit.patch",
+    "chromium-157-revert-gn-check-includes.patch",
+    "chromium-157-typescript.patch",
+    "chromium-156-isolatedDeclarations.patch",
 ]
 SPDX-FileCopyrightText = "2015-2026 The ungoogled-chromium Authors"
 SPDX-License-Identifier = "BSD-3-Clause"
Risk 1/5 · Low chromium-157-crubit.patch
Result #6570

Comment

The patch is a large Chromium Crubit integration update, but I do not see a direct supply-chain or privilege-escalation issue in the diff itself. It mostly generalizes paths from the Chromium Rust toolchain to a configurable `rust_crubit_root`, adds support for generating bindings from prebuilt stdlib `.rmeta` files, and adjusts wrapper scripts to pass through `-L`/`--extern` data. The main security-sensitive change is that `cpp_api_from_rust_wrapper.py` now parses rustc flags and forwards `-L`/`--extern` entries to Crubit, but it does not execute them, and the inputs still come from the build graph. I also do not see network access, shell execution, sudo, install scripts, or shipped binaries being introduced here. The change is complex and could affect build correctness, but based on the provided diff alone I do not find a high-confidence security problem.

@@ -0,0 +1,865 @@
+# Squash of:
+# https://chromium-review.googlesource.com/c/chromium/src/+/8559360
+# https://chromium-review.googlesource.com/c/chromium/src/+/8560244
+# https://chromium-review.googlesource.com/c/chromium/src/+/8563940
+# https://chromium-review.googlesource.com/c/chromium/src/+/8561424
+# https://chromium-review.googlesource.com/c/chromium/src/+/8564239
+# https://chromium-review.googlesource.com/c/chromium/src/+/8268230
+--- a/build/config/rust.gni
++++ b/build/config/rust.gni
+@@ -63,6 +63,21 @@ declare_args() {
+   # the bindgen exectuable).
+   rust_bindgen_root = "//third_party/rust-toolchain"
+ 
++  # Directory under which to find Crubit tools and support libraries:
++  # * `bin/cc_bindings_from_rs` and `bin/rs_bindings_from_cc`
++  # * `lib/third_party/crubit` (support libraries and their `BUILD.gn` files)
++  #
++  # Unlike `rust_bindgen_root` we don't set `rust_crubit_root` to
++  # `"//third_party/rust-toolchain"` by default, because `cc_bindings_from_rs`
++  # has to be built from the same Rust compiler sources as `rustc` (see
++  # https://github.com/google/crubit/blob/89417b58802e20a6a11db7fea7c31692fef25276/docs/design/design.md?plain=1#L599-L602).
++  # Because of the above `rust_crubit_root` has to be explicitly set when using
++  # a custom toolchain via `rust_sysroot_absolute`.  OTOH, when
++  # `use_chromium_rust_toolchain` is set then defaulting to
++  # `"//third_party/rust-toolchain"` is ok (see the `if (rust_crubit_root...
++  # use_chromium_rust_toolchain` code below).
++  rust_crubit_root = ""
++
+   # If you're using a Rust toolchain as specified by rust_sysroot_absolute,
+   # set this to the output of `rustc -V`. Changing this string will cause all
+   # Rust targets to be rebuilt, which allows you to update your toolchain and
+@@ -150,18 +165,6 @@ if (enable_rust) {
+       _version_lines =
+           read_file("//third_party/rust-toolchain/VERSION", "list lines")
+       rustc_revision = _version_lines[0]
+-
+-      # Example:
+-      # rustc 1.88.0 c8f94230282a8e8c1148f3e657f0199aad909228 (c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611 chromium)
+-      # Trim it down as much as we can using GN.
+-      rustc_revision = string_replace(rustc_revision, "rustc ", "")
+-      rustc_revision = string_replace(rustc_revision, " chromium", "")
+-      rustc_revision = string_replace(rustc_revision, "init-", "")
+-      rustc_revision = string_replace(rustc_revision, "llvmorg-", "")
+-      rustc_revision = string_replace(rustc_revision, " ", "")
+-      rustc_revision = string_replace(rustc_revision, ".", "")
+-      rustc_revision = string_replace(rustc_revision, "(", "-")
+-      rustc_revision = string_replace(rustc_revision, ")", "")
+     }
+ 
+     # The same as written in `config.toml.template`.
+@@ -170,6 +173,19 @@ if (enable_rust) {
+     toolchain_has_rust = custom_toolchain_supports_platform
+     rustc_revision = rustc_version
+   }
++
++  # Trim down `rustc_revision`.  This is partially done for aesthetics and
++  # brevity.  But more importantly, removing spaces avoids errors that would
++  # otherwise happen when passing `--cfg cr_rustc_revision=...` in `rustflags`.
++  # See also the `build/config/compiler:rustc_revision` config.
++  rustc_revision = string_replace(rustc_revision, "rustc ", "")
++  rustc_revision = string_replace(rustc_revision, " chromium", "")
++  rustc_revision = string_replace(rustc_revision, "init-", "")
++  rustc_revision = string_replace(rustc_revision, "llvmorg-", "")
++  rustc_revision = string_replace(rustc_revision, " ", "")
++  rustc_revision = string_replace(rustc_revision, ".", "")
++  rustc_revision = string_replace(rustc_revision, "(", "-")
++  rustc_revision = string_replace(rustc_revision, ")", "")
+ }
+ 
+ # TODO(crbug.com/40809974): To build unit tests for Android we need to build
+@@ -188,6 +204,18 @@ if (enable_rust) {
+   }
+ }
+ 
++if (rust_crubit_root == "" && use_chromium_rust_toolchain) {
++  rust_crubit_root = "//third_party/rust-toolchain"
++}
++
++# Message for `assert(rust_crubit_root != "", rust_crubit_root_missing_message)`
++# in places that need Crubit.
++rust_crubit_root_missing_message =
++    "Crubit is required, but `rust_crubit_root` GN arg is not set.  It has " +
++    "to be set when using a custom Rust toolchain via " +
++    "`rust_sysroot_absolute`.  See `rust_crubit_root` in " +
++    "//build/config/rust.gni for more details."
++
+ # Figure out the Rust target triple (aka 'rust_abi_target')
+ #
+ # This is here rather than in the toolchain files because it's used also by
+@@ -415,6 +443,10 @@ if (toolchain_for_rust_host_build_tools)
+ rust_prebuilt_stdlib =
+     !use_chromium_rust_toolchain || toolchain_for_rust_host_build_tools
+ 
++# `rust_sysroot` is the toolchain root (and the default sysroot of rustc),
++# but the locally built stdlib uses a different sysroot.
++local_rustc_sysroot = "$root_out_dir/local_rustc_sysroot"
++
+ # `cpp_api_from_rust` (aka `cc_bindings_from_rs`) is available when building
+ # Chromium, but may be missing or can't be used in some other cases.
+ # `enable_cpp_api_from_rust` is checked under `//build/rust/*.gni` (and may be
+@@ -422,8 +454,7 @@ rust_prebuilt_stdlib =
+ #
+ # See the `assert` comments in `cpp_api_from_rust.gni` for explanation of
+ # the conditions used here.
+-enable_cpp_api_from_rust = enable_rust && use_chromium_rust_toolchain &&
+-                           !rust_prebuilt_stdlib && build_with_chromium
++enable_cpp_api_from_rust = enable_rust && build_with_chromium
+ 
+ declare_args() {
+   # Whether it is okay to use `rust_api_from_cpp.gni`.  The default is `false`,
+@@ -432,9 +463,8 @@ declare_args() {
+   # `true` in `args.gn` for local experimentation.
+   #
+   # TODO(crbug.com/40226863): After officially supporting `rust_api_from_cpp`:
+-  # * Introduce `_enable_crubit = enable_rust && use_chromium_rust_toolchain &&
+-  #   build_with_chromium`
+-  # * Set `enable_cpp_api_from_rust = _enable_crubit && !rust_prebuilt_stdlib`
++  # * Introduce `_enable_crubit = enable_rust && build_with_chromium`
++  # * Set `enable_cpp_api_from_rust = _enable_crubit`
+   # * Set `enable_rust_api_from_cpp = _enable_crubit`
+   #   (and it should just be a variable, not an `args.gn` setting / not in
+   #   `declare_args`)
+@@ -452,8 +482,13 @@ rustc_wrapper_inputs = [
+   "//build/rust/gni_impl/rustc_wrapper.py",
+ ]
+ 
+-if (host_os == "win") {
+-  rustc_wrapper_inputs += [ "//third_party/rust-toolchain/bin/rustc.exe" ]
+-} else {
+-  rustc_wrapper_inputs += [ "//third_party/rust-toolchain/bin/rustc" ]
++if (enable_rust) {
++  # Path to the `rustc` executable (from either the Chromium toolchain or
++  # from a custom toolchain specified via `rust_sysroot_absolute`).
++  rustc_exe_path = "$rust_sysroot/bin/rustc"
++  if (host_os == "win") {
++    rustc_exe_path += ".exe"
++  }
++
++  rustc_wrapper_inputs += [ rustc_exe_path ]
+ }
+--- a/build/rust/cargo_crate.gni
++++ b/build/rust/cargo_crate.gni
+@@ -479,14 +479,9 @@ template("cargo_crate") {
+         "//build/gn_helpers.py",
+         _rustflags_txt,
+         rustc_print_cfg_path,
++        rustc_exe_path,
+       ]
+ 
+-      if (host_os == "win") {
+-        inputs += [ "//third_party/rust-toolchain/bin/rustc.exe" ]
+-      } else {
+-        inputs += [ "//third_party/rust-toolchain/bin/rustc" ]
+-      }
+-
+       build_script_target = ":${_build_script_name}($rust_macro_toolchain)"
+       deps = [
+         ":${_build_script_name}_write_rustflags",
+--- a/build/rust/crubit/BUILD.gn
++++ b/build/rust/crubit/BUILD.gn
+@@ -10,9 +10,7 @@ group("crubit") {
+   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",
++    "//build/rust/std:std_bindings",
+   ]
+ }
+ 
+@@ -22,7 +20,7 @@ config("public_config") {
+   # `include_dirs` below help ensure that Chromium can use the same
+   # `#include` paths as other Crubit clients like google3 - e.g.
+   # `#include "third_party/crubit/support/rs_std/slice_ref.h"`.
+-  include_dirs = [ "//third_party/rust-toolchain/lib" ]
++  include_dirs = [ "${rust_crubit_root}/lib" ]
+ }
+ 
+ # The `cref` crate provides `CRef<T>` and `CMut<T>` - Rust types that represent
+--- a/build/rust/gni_impl/cpp_api_from_rust.gni
++++ b/build/rust/gni_impl/cpp_api_from_rust.gni
+@@ -27,15 +27,22 @@ _globally_enabled_crubit_features = [
+ #   rust_target
+ #     Label of the Rust library to generate the bindings for.
+ #
+-#   rustc_env_and_flags
++#   rustc_env_and_flags (optional)
+ #     Path to the `.rustflags.json` file generated by an earlier invocation
+ #     of `rustc`.  (`cpp_api_from_rust` needs to be invoked with the same
+-#     arguments, target platform, etc. as `rust_target`.)
++#     `-L` and `--extern` flags as `rust_target`.)  Omitted for crates that
++#     `rustc` can find on its own (e.g. crates from a prebuilt Rust standard
++#     library in the sysroot).
+ #
+ #   crate_name
+ #     Name (potentially mangled/auto-generated) of the crate that `rust_target`
+ #     is built into.
+ #
++#   rmeta_path (optional)
++#     Path to the `.rmeta` file produced by `rust_target`.  Omitted for crates
++#     that `rustc` can find on its own (e.g. crates from a prebuilt Rust
++#     standard library in the sysroot).
++#
+ #   h_out
+ #     Path where the generated `.h` file should be written.
+ #
+@@ -46,24 +53,15 @@ _globally_enabled_crubit_features = [
+ #
+ #   sources
+ #   deps
+-#     Dependencies for compiling `rust_target`.
++#     Dependencies for compiling `rust_target`, or files that change together
++#     with the `.rmeta` files read by Crubit (and the targets that generate
++#     these files).  This makes sure that the bindings are re-generated when the
++#     `.rmeta` files change (e.g. when the Rust toolchain changes).
+ #
+ #
+ template("cpp_api_from_rust") {
+-  # `enable_rust` and `use_chromium_rust_toolchain` enforce that `rustc` and
+-  # `cpp_api_from_rust` use the same version of Rust compiler sources - this is
+-  # required (e.g. to see the same memory layout of repr-Rusts structs) as
+-  # explained in
+-  # https://github.com/google/crubit/blob/89417b58802e20a6a11db7fea7c31692fef25276/docs/design/design.md?plain=1#L599-L602
+-  assert(enable_rust && use_chromium_rust_toolchain)
+-
+-  # TODO(https://crbug.com/549864599): `cpp_api_from_rust`-generated bindings
+-  # may depend on C++ bindings of Rust standard library. Currently Chromium is
+-  # only able to invoke Crubit in `.rs`-consuming mode (rather than
+-  # `.rlib`-consuming mode). Together, these two constraints mean that
+-  # `cpp_api_from_rust` only works for the target platform and doesn't yet work
+-  # for the host platform.
+-  assert(!rust_prebuilt_stdlib)
++  assert(enable_rust)
++  assert(rust_crubit_root != "", rust_crubit_root_missing_message)
+ 
+   # PDFium, V8 and other "2nd-party" Chromium projects don't yet have their own
+   # `//build_overrides/crubit.gni` build file.  Until this is fixed, we assert
+@@ -76,16 +74,15 @@ template("cpp_api_from_rust") {
+   _h_target_name = target_name
+   _metadata_target_name = "${target_name}_crubit_metadata"
+ 
++  assert(defined(invoker.rustc_env_and_flags) == defined(invoker.rmeta_path))
+   assert(defined(invoker.deps))
+   assert(defined(invoker.sources))
+-  assert(defined(invoker.rustc_env_and_flags))
+   assert(defined(invoker.rust_target))
+   assert(defined(invoker.original_attributes))
+   assert(defined(invoker.crate_name))
+   assert(defined(invoker.h_out))
+   _crate_name = invoker.crate_name
+   _rust_target = invoker.rust_target
+-  _rust_target_name = get_label_info(_rust_target, "name")
+   _rust_target_dir = get_label_info(_rust_target, "dir")
+   _h_out = invoker.h_out
+   _rs_out = "${_h_out}.impl.rs"
+@@ -97,7 +94,8 @@ template("cpp_api_from_rust") {
+   if (!defined(_original_attributes.deps)) {
+     _original_attributes.deps = []
+   }
+-  _is_rust_stdlib_target = _rust_target_dir == "//build/rust/std/rules"
++  _is_rust_stdlib_target = _rust_target_dir == "//build/rust/std/rules" ||
++                           _rust_target_dir == "//build/rust/std"
+   if (!_is_rust_stdlib_target) {
+     _original_attributes.deps += [ "//build/rust/std:std_bindings" ]
+   }
+@@ -154,6 +152,12 @@ template("cpp_api_from_rust") {
+                              "testonly",
+                            ])
+     deps += [ ":${_rspgen_target_name}" ]
++    if (_is_rust_stdlib_target && !rust_prebuilt_stdlib &&
++        _crate_name != "core") {
++      # The local sysroot must contain the stdlib crates that the synthetic
++      # crate (generated by Crubit) may load implicitly.
++      deps += [ "//build/rust/std/rules:std" ]
++    }
+ 
+     visibility = [
+       ":$_h_target_name",
+@@ -165,9 +169,10 @@ template("cpp_api_from_rust") {
+     inputs += [
+       _action_rsp_path,
+       cpp_api_from_rust_exe_path,
+-      rustfmt_exe_path,
+-      rustfmt_config_path,
+     ]
++    if (defined(invoker.rmeta_path)) {
++      inputs += [ invoker.rmeta_path ]
++    }
+     outputs = [
+       _h_out,
+       _rs_out,
+@@ -177,20 +182,35 @@ template("cpp_api_from_rust") {
+     args = [
+       "--cpp-api-from-rust-exe-path",
+       rebase_path(cpp_api_from_rust_exe_path, root_build_dir),
+-
+-      "--rustc-env-and-flags",
+-      rebase_path(invoker.rustc_env_and_flags, root_build_dir),
+-      "@" + rebase_path(_action_rsp_path, root_build_dir),
+     ]
++    if (defined(invoker.rustc_env_and_flags)) {
++      args += [
++        "--rustc-env-and-flags",
++        rebase_path(invoker.rustc_env_and_flags, root_build_dir),
++      ]
++    }
++    args += [ "@" + rebase_path(_action_rsp_path, root_build_dir) ]
++
++    if (rust_prebuilt_stdlib) {
++      _sysroot = rust_sysroot
++    } else {
++      _sysroot = local_rustc_sysroot
++    }
+ 
+     # `cpp_api_from_rust` flags:
+     args += [
+       "--",
+ 
+-      # TODO(https://gn.issues.chromium.org/490160737): Enable this interface
+-      # once we can get paths to rmeta files in GN.
+-      "--enable-rmeta-interface=false",
+-
++      "--enable-rmeta-interface=true",
++      "--source-crate-name=${_crate_name}",
++      "--target=${rust_abi_target}",
++      "--sysroot=" + rebase_path(_sysroot, root_build_dir),
++    ]
++    if (defined(invoker.rmeta_path)) {
++      args += [ "--extern=${_crate_name}=" +
++                rebase_path(invoker.rmeta_path, root_build_dir) ]
++    }
++    args += [
+       "--h-out",
+       rebase_path(_h_out, root_build_dir),
+ 
+@@ -204,13 +224,21 @@ template("cpp_api_from_rust") {
+ 
+       "--crubit-support-path-format",
+       crubit_support_path_format,
++    ]
++    if (defined(rustfmt_exe_path)) {
++      inputs += [
++        rustfmt_exe_path,
++        rustfmt_config_path,
++      ]
++      args += [
++        "--rustfmt-exe-path",
++        rebase_path(rustfmt_exe_path, root_build_dir),
+ 
+-      "--rustfmt-exe-path",
+-      rebase_path(rustfmt_exe_path, root_build_dir),
+-
+-      "--rustfmt-config-path",
+-      rebase_path(rustfmt_config_path, root_build_dir),
+-
++        "--rustfmt-config-path",
++        rebase_path(rustfmt_config_path, root_build_dir),
++      ]
++    }
++    args += [
+       "--crate-namespace",
+       "self=${_cpp_namespace}",
+     ]
+@@ -261,10 +289,15 @@ template("cpp_api_from_rust") {
+     # of this crate is `_h_target_name`, which only consumes C ABI top-level
+     # entrypoints - this means that the crate name isn't used / doesn't leak
+     # anywhere.  And therefore it doesn't matter what kind of mangling we do,
+-    # as long as we ensure that it is globally unique.
++    # as long as we ensure that it is globally unique.  (Note that
++    # `_rust_target` is not necessarily unique - e.g. with
++    # `use_rmeta_interface`, `//build/rust/std:std` is shared by all the
++    # crates of a prebuilt Rust standard library.  This is why
++    # `_h_target_name` is used as `_crate_name_base` below.)
++    _crate_name_base = _h_target_name
+     _crate_name_suffix =
+-        string_hash(get_label_info(_rust_target_name, "label_with_toolchain"))
+-    crate_name = "${_rust_target_name}_crubit_${_crate_name_suffix}"
++        string_hash(get_label_info(_crate_name_base, "label_with_toolchain"))
++    crate_name = "${_crate_name_base}_crubit_${_crate_name_suffix}"
+     output_name = crate_name
+ 
+     crate_root = _rs_out
+--- a/build/rust/gni_impl/cpp_api_from_rust_wrapper.py
++++ b/build/rust/gni_impl/cpp_api_from_rust_wrapper.py
+@@ -8,12 +8,12 @@ import argparse
+ import subprocess
+ import pathlib
+ import sys
+-import tempfile
+ 
+ from rustc_wrapper import (
+     PrepareRustEnvForExecution,
+     LoadRustEnvAndFlags,
+     HandleReturnCode,
++    ExpandNestedRustStyleRspFiles,
+ )
+ 
+ 
+@@ -22,27 +22,34 @@ def main():
+     parser.add_argument(
+         '--cpp-api-from-rust-exe-path', required=True, type=pathlib.Path
+     )
+-    parser.add_argument(
+-        '--rustc-env-and-flags', type=pathlib.Path, required=True
+-    )
++    # `--rustc-env-and-flags` is not used when generating bindings for a
++    # prebuilt stdlib in the sysroot.
++    parser.add_argument('--rustc-env-and-flags', type=pathlib.Path)
+     parser.add_argument('args', metavar='ARG', nargs='+')
+     args = parser.parse_args()
+ 
+-    (rustenv, rustflags) = LoadRustEnvAndFlags(args.rustc_env_and_flags)
+-    PrepareRustEnvForExecution(rustenv)
+-
+-    rustflags = [*args.args, "--", *rustflags]
++    rustenv = None
++    rustflags = []
++    if args.rustc_env_and_flags:
++        (rustenv, rustflags) = LoadRustEnvAndFlags(args.rustc_env_and_flags)
++        PrepareRustEnvForExecution(rustenv)
++
++    expanded_rustflags = ExpandNestedRustStyleRspFiles(rustflags)
++    flag_parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
++    flag_parser.add_argument('-L', action='append', default=[])
++    flag_parser.add_argument('--extern', action='append', default=[])
++    known, _ = flag_parser.parse_known_args(expanded_rustflags)
++    crubit_extra_args = [f'-L{x}' for x in known.L]
++    # Crubit requires `CRATE=PATH`. Skip sysroot crates like
++    # `--extern proc_macro`.
++    crubit_extra_args += [f'--extern={x}' for x in known.extern if '=' in x]
+ 
+-    # `cpp_api_from_rust` should not write any files into the build directory
+-    # (e.g. into `out/`).
+-    assert not [x for x in rustflags if x.startswith("--emit")]
+-    assert not [x for x in rustflags if x.startswith("-o")]
+-    assert not [x for x in rustflags if x.startswith("--out-dir")]
+-    temp_dir = tempfile.TemporaryDirectory()
+-    rustflags += ["--out-dir", temp_dir.name]
++    crubit_args = [*args.args, *crubit_extra_args]
+ 
+     r = subprocess.run(
+-        [args.cpp_api_from_rust_exe_path, *rustflags], env=rustenv, check=False
++        [args.cpp_api_from_rust_exe_path, *crubit_args],
++        env=rustenv,
++        check=False,
+     )
+     HandleReturnCode(r)
+     return 0
+--- a/build/rust/gni_impl/crubit_shared_args.gni
++++ b/build/rust/gni_impl/crubit_shared_args.gni
+@@ -5,24 +5,36 @@
+ # This `.gni` file defines constants that are shared / reused across
+ # `cpp_api_from_rust.gni` and `rust_api_from_cpp.gni`.
+ 
++import("//build/config/rust.gni")
++
+ crubit_support_path_format = "\"third_party/crubit/support/{header}\""
+ rustfmt_config_path = "//.rustfmt.toml"
+ 
+-_toolchain_bin_path = "//third_party/rust-toolchain/bin"
+-cpp_api_from_rust_exe_path = "${_toolchain_bin_path}/cc_bindings_from_rs"
+-rust_api_from_cpp_exe_path = "${_toolchain_bin_path}/rs_bindings_from_cc"
+-rustfmt_exe_path = "${_toolchain_bin_path}/rustfmt"
++_crubit_bin_path = "${rust_crubit_root}/bin"
++cpp_api_from_rust_exe_path = "${_crubit_bin_path}/cc_bindings_from_rs"
++rust_api_from_cpp_exe_path = "${_crubit_bin_path}/rs_bindings_from_cc"
+ if (host_os == "win") {
+   cpp_api_from_rust_exe_path += ".exe"
+   rust_api_from_cpp_exe_path += ".exe"
+-  rustfmt_exe_path += ".exe"
+ }
+ 
+-# TODO(lukasza): Make this also work on other host platforms.  (Possibly
+-# hoisting this Crubit-agnostic functionality into some other, reusable
+-# location elsewhere.)
+-if (host_os == "linux") {
+-  clang_format_exe_path = "//buildtools/linux64-format/clang-format"
+-} else if (host_os == "win") {
+-  clang_format_exe_path = "//buildtools/win-format/clang-format.exe"
++# Code generated by Crubit is only formatted when using Crubit from
++# //third_party/rust-toolchain.  Formatting only makes the generated code easier
++# to read, and the formatting tools may not be available when using a
++# system-provided Crubit.  Therefore `rustfmt_exe_path` and
++# `clang_format_exe_path` may be undefined.
++if (rust_crubit_root == "//third_party/rust-toolchain") {
++  rustfmt_exe_path = "//third_party/rust-toolchain/bin/rustfmt"
++  if (host_os == "win") {
++    rustfmt_exe_path += ".exe"
++  }
++
++  # TODO(lukasza): Make this also work on other host platforms.  (Possibly
++  # hoisting this Crubit-agnostic functionality into some other, reusable
++  # location elsewhere.)
++  if (host_os == "linux") {
++    clang_format_exe_path = "//buildtools/linux64-format/clang-format"
++  } else if (host_os == "win") {
++    clang_format_exe_path = "//buildtools/win-format/clang-format.exe"
++  }
+ }
+--- a/build/rust/gni_impl/rust_target.gni
++++ b/build/rust/gni_impl/rust_target.gni
+@@ -386,6 +386,34 @@ template("rust_target") {
+       }
+     }
+ 
++    # `_output_dir` and `_output_name` are equivalents of `{{output_dir}}` and
++    # `{{target_output_name}}` in the toolchain.
++    _output_dir = target_out_dir
++    if (defined(invoker.output_dir) && invoker.output_dir != "") {
++      _output_dir = invoker.output_dir
++    }
++    if (defined(invoker.output_name)) {
++      _output_name = invoker.output_name
++    } else {
++      # Note that file names of libraries must start with the crate name in
++      # order for the compiler to find transitive dependencies in the
++      # directory search paths (since they are not all explicitly specified).
++      #
++      # For bin targets, we expect the target name to be unique, and the name
++      # of the exe should not add magic stuff to it. And bin crates can not be
++      # transitive dependencies.
++      if (invoker.target_type == "executable") {
++        _output_name = _target_name
++      } else {
++        # TODO(danakj): Since the crate name includes the whole path for 1p
++        # libraries, we could move the output_dir to `root_out_dir` here for
++        # them, which would make for shorter file paths. But we need to not
++        # do the same for 3p crates or those with a `crate_name` set
++        # explicitly.
++        _output_name = _crate_name
++      }
++    }
++
+     if (_override_crate_type_as_dylib) {
+       # Building a `--crate-type=dylib` means that `rustc` generates a `.dll` /
+       # `.so` in target-specific subdirectories of the build directory.  This
+@@ -404,13 +432,6 @@ template("rust_target") {
+         # of replicating how `...toolchain.gni` calculates the `.so` path in the
+         # `outputs` of `tool("rust_dylib")` (which feels rather fragile).
+         #
+-        # `_source_dir` is an equivalent of `{{output_dir}}` in the toolchain.
+-        _source_dir = target_out_dir
+-        if (defined(invoker.output_dir)) {
+-          _source_dir = invoker.output_dir
+-        }
+-        _source_dir += "/"
+-
+         # `_source_ext` is an equivalent of `{{output_extension}}`
+         _source_ext = shlib_extension
+ 
+@@ -425,13 +446,11 @@ template("rust_target") {
+         # `_source_prefix` is an equivalent of `output_prefix` in `tool`.
+         _source_prefix = shlib_prefix
+ 
+-        # `_source_name` is an equivalent of `{{target_output_name}}`.
+         assert(defined(invoker.output_name))  # Only tested with `cargo_crate`.
+-        _source_name = invoker.output_name
+ 
+         # `_source_path` is the equivalent of `dllname` in the toolchain.
+-        _source_filename = "${_source_prefix}${_source_name}${_source_ext}"
+-        _source_path = "${_source_dir}${_source_filename}"
++        _source_filename = "${_source_prefix}${_output_name}${_source_ext}"
++        _source_path = "${_output_dir}/${_source_filename}"
+ 
+         # `_target_dir` is the equivalent of `default_output_dir` in toolchain.
+         if (defined(invoker.default_shlib_subdir)) {
+@@ -578,6 +597,7 @@ template("rust_target") {
+                                    "features",
+                                    "inputs",
+                                    "no_clippy",
++                                   "output_name",
+                                    "public_deps",
+                                    "rustenv",
+                                    "rustflags",
+@@ -627,26 +647,7 @@ template("rust_target") {
+ 
+       sources = _rust_sources
+       inputs = _rust_inputs
+-
+-      if (!defined(output_name)) {
+-        # Note that file names of libraries must start with the crate name in
+-        # order for the compiler to find transitive dependencies in the
+-        # directory search paths (since they are not all explicitly specified).
+-        #
+-        # For bin targets, we expect the target name to be unique, and the name
+-        # of the exe should not add magic stuff to it. And bin crates can not be
+-        # transitive dependencies.
+-        if (invoker.target_type == "executable") {
+-          output_name = _target_name
+-        } else {
+-          # TODO(danakj): Since the crate name includes the whole path for 1p
+-          # libraries, we could move the output_dir to `root_out_dir` here for
+-          # them, which would make for shorter file paths. But we need to not
+-          # do the same for 3p crates or those with a `crate_name` set
+-          # explicitly.
+-          output_name = _crate_name
+-        }
+-      }
++      output_name = _output_name
+ 
+       if (!_allow_unsafe) {
+         configs += [ "//build/rust:forbid_unsafe" ]
+@@ -755,6 +756,12 @@ template("rust_target") {
+       }
+ 
+       if (_enable_cpp_api_from_rust_for_this_target) {
++        # TODO(https://crbug.com/gn/490160737): If `get_target_outputs` can
++        # support binary targets (unclear) then it should be used here, instead
++        # of replicating how `...toolchain.gni` calculates `rmetaname` in the
++        # `outputs` of `tool("rust_rlib")` (which feels rather fragile).
++        _rmeta_path = "${_output_dir}/lib${_output_name}.rmeta"
++
+         cpp_api_from_rust(_cpp_api_from_rust_target_name) {
+           forward_variables_from(_secondary_rust_compiler_attrs,
+                                  _SECONDARY_RUST_COMPILER_ATTR_NAMES)
+@@ -762,6 +769,7 @@ template("rust_target") {
+           rustc_env_and_flags = _rustc_env_and_flags
+           original_attributes = _cpp_api_from_rust_attributes
+           crate_name = _crate_name
++          rmeta_path = _rmeta_path
+ 
+           if (defined(_cpp_api_from_rust_attributes.h_out)) {
+             h_out = _cpp_api_from_rust_attributes.h_out
+@@ -778,5 +786,9 @@ template("rust_target") {
+         }
+       }
+     }
++    if (!_override_crate_type_as_dylib &&
++        !_enable_cpp_api_from_rust_for_this_target) {
++      not_needed([ "_output_dir" ])
++    }
+   }
+ }
+--- a/build/rust/gni_impl/rustc_wrapper.py
++++ b/build/rust/gni_impl/rustc_wrapper.py
+@@ -334,7 +334,7 @@ def _RecommendApplyFixesScript(tool, rus
+     print(f" {os.path.basename(tool)} {rustc_env_and_flags}", file=sys.stderr)
+ 
+ 
+-def _ExpandNestedRustStyleRspFiles(rsp_args):
++def ExpandNestedRustStyleRspFiles(rsp_args):
+     # `rustc` doesn't support using `@<file.rsp>` from **inside** `@another.rsp`.
+     # And things like `@cargo_flags.rs` (see build script handling inside
+     # `cargo_crate.gni`) may end up in `rustflags`.  And since `rustflags` are
+@@ -411,7 +411,7 @@ def main():
+             remove_lib_suffix_from_extern_args(arg) for arg in rustc_args
+         ]
+     rsp_args = [remove_gn_escaping_from_rsp_args(arg) for arg in rsp_args]
+-    rsp_args = _ExpandNestedRustStyleRspFiles(rsp_args)
++    rsp_args = ExpandNestedRustStyleRspFiles(rsp_args)
+     out_rsp = str(args.rsp) + ".rust"
+     with open(out_rsp, 'w') as rspfile:
+         # rustc needs the rsp file to be separated by newlines. Note that GN
+--- a/build/rust/rust_api_from_cpp.gni
++++ b/build/rust/rust_api_from_cpp.gni
+@@ -65,10 +65,8 @@ _globally_enabled_crubit_features = [
+ #     targets that generate bindings for types from these other targets.
+ template("rust_api_from_cpp") {
+   assert(enable_rust_api_from_cpp)
+-
+-  # At this point `rs_bindings_from_cc` is only distributed with the Chromium
+-  # Rust toolchain.
+-  assert(enable_rust && use_chromium_rust_toolchain)
++  assert(enable_rust)
++  assert(rust_crubit_root != "", rust_crubit_root_missing_message)
+ 
+   # PDFium, V8 and other "2nd-party" Chromium projects don't yet have their own
+   # `//build_overrides/crubit.gni` build file.  Until this is fixed, we assert
+@@ -254,8 +252,6 @@ template("rust_api_from_cpp") {
+       "//build/rust/gni_impl/filter_clang_args.py",
+       _metadata_path,
+       rust_api_from_cpp_exe_path,
+-      rustfmt_exe_path,
+-      rustfmt_config_path,
+     ]
+ 
+     # Public headers are inputs to this action rather than sources,
+@@ -301,10 +297,18 @@ template("rust_api_from_cpp") {
+       "--public_headers=" + string_join(",", _rebased_public_headers),
+       "--target=${_current_lib_target_full_label}",
+       "--crubit_support_path_format=${crubit_support_path_format}",
+-      "--rustfmt_exe_path=" + rebase_path(rustfmt_exe_path, root_build_dir),
+-      "--rustfmt_config_path=" +
+-          rebase_path(rustfmt_config_path, root_build_dir),
+     ]
++    if (defined(rustfmt_exe_path)) {
++      inputs += [
++        rustfmt_exe_path,
++        rustfmt_config_path,
++      ]
++      args += [
++        "--rustfmt_exe_path=" + rebase_path(rustfmt_exe_path, root_build_dir),
++        "--rustfmt_config_path=" +
++            rebase_path(rustfmt_config_path, root_build_dir),
++      ]
++    }
+ 
+     # TODO(https://crbug.com/40226863): Use
+     # `rust_enable_generated_code_formatting` (see https://crrev.com/c/8494684)
+--- a/build/rust/std/BUILD.gn
++++ b/build/rust/std/BUILD.gn
+@@ -19,6 +19,7 @@ import("//build/config/compiler/compiler
+ import("//build/config/coverage/coverage.gni")
+ import("//build/config/rust.gni")
+ import("//build/config/sanitizers/sanitizers.gni")
++import("//build/rust/gni_impl/cpp_api_from_rust.gni")
+ 
+ if (toolchain_has_rust) {
+   # List of Rust stdlib rlibs which are present in the official Rust toolchain
+@@ -180,8 +181,6 @@ if (toolchain_has_rust) {
+   sysroot_lib_subdir = "lib/rustlib/$rust_abi_target/lib"
+ 
+   if (!rust_prebuilt_stdlib) {
+-    local_rustc_sysroot = "$root_out_dir/local_rustc_sysroot"
+-
+     # All std targets starting with core build with our sysroot. It starts empty
+     # and is incrementally built. The directory must exist at the start.
+     generated_file("empty_sysroot_for_std_build") {
+@@ -309,11 +308,7 @@ if (toolchain_has_rust) {
+       out_libdir = rebase_path(target_out_dir, root_build_dir)
+       out_depfile = rebase_path(depfile, root_build_dir)
+ 
+-      if (host_os == "win") {
+-        inputs = [ "//third_party/rust-toolchain/bin/rustc.exe" ]
+-      } else {
+-        inputs = [ "//third_party/rust-toolchain/bin/rustc" ]
+-      }
++      inputs = [ rustc_exe_path ]
+ 
+       # For the rustc sysroot we must include even the rlibs we don't pass to
+       # the C++ linker.
+@@ -382,26 +377,19 @@ if (toolchain_has_rust) {
+       visibility = [ ":*" ]
+     }
+ 
+-    config("prebuilt_stdlib_libs") {
+-      ldflags = []
+-      lib_dir = rebase_path("$prebuilt_rustc_sysroot/$sysroot_lib_subdir",
+-                            root_build_dir)
+-
+-      # We're unable to make these files regular gn dependencies because
+-      # they're prebuilt. Instead, we'll pass them in the ldflags. This doesn't
+-      # work for all types of build because ldflags propagate differently from
+-      # actual dependencies and therefore can end up in different targets from
+-      # the remap_alloc.cc above. For example, in a component build, we might
+-      # apply the remap_alloc.cc file and these ldlags to shared object A,
+-      # while shared object B (that depends upon A) might get only the ldflags
+-      # but not remap_alloc.cc, and thus the build will fail. There is
+-      # currently no known solution to this for the prebuilt stdlib - this
+-      # problem does not apply with configurations where we build the stdlib
+-      # ourselves, which is what we'll use in production.
++    # The prebuilt rlibs are not built by GN, so they are passed to the linker
++    # via `libs`.  `libs` set on a target (rather than in a config) propagate
++    # to dependents only until the nearest shared library or executable - the
++    # same way as GN dependencies on `//build/rust/allocator` and on other Rust
++    # libraries.  This ensures that in a component build the rlibs are linked
++    # only into the shared libraries that contain Rust code (and therefore also
++    # the allocator shims that the rlibs depend on).
++    source_set("prebuilt_stdlib_libs") {
++      libs = []
+       foreach(lib, stdlib_files) {
+-        this_file = "$lib_dir/lib$lib.rlib"
+-        ldflags += [ this_file ]
++        libs += [ "$prebuilt_rustc_sysroot/$sysroot_lib_subdir/lib$lib.rlib" ]
+       }
++      deps = [ ":prebuilt_rustc_copy_to_sysroot" ]
+       visibility = [ ":*" ]
+     }
+ 
+@@ -413,11 +401,8 @@ if (toolchain_has_rust) {
+     }
+ 
+     group("std") {
+-      all_dependent_configs = [
+-        ":prebuilt_stdlib_libs",
+-        ":stdlib_public_dependent_libs",
+-      ]
+-      deps = [ ":prebuilt_rustc_copy_to_sysroot" ]
++      all_dependent_configs = [ ":stdlib_public_dependent_libs" ]
++      deps = [ ":prebuilt_stdlib_libs" ]
+     }
+ 
+     # `stdlib_test_files` are already included in `all_stdlibs_to_copy` and
+@@ -425,5 +410,65 @@ if (toolchain_has_rust) {
+     group("test_support") {
+       deps = [ ":std" ]
+     }
++
++    if (enable_cpp_api_from_rust) {
++      # C++ bindings of the prebuilt Rust standard library.  The in-tree stdlib
++      # build generates the bindings from the stdlib sources (see
++      # `//build/rust/std/rules`), but here Crubit reads the crate metadata
++      # from the `.rmeta` files in the sysroot.
++      _prebuilt_stdlib_bindings = [
++        {
++          crate_name = "core"
++          deps = []
++        },
++        {
++          crate_name = "alloc"
++          deps = [ ":prebuilt_core_bindings" ]
++        },
++        {
++          crate_name = "std"
++          deps = [
++            ":prebuilt_alloc_bindings",
++            ":prebuilt_core_bindings",
++          ]
++        },
++      ]
++      foreach(_bindings, _prebuilt_stdlib_bindings) {
++        cpp_api_from_rust("prebuilt_${_bindings.crate_name}_bindings") {
++          rust_target = ":std"
++          crate_name = _bindings.crate_name
++          h_out = "$root_gen_dir/third_party/crubit/support/rs_std/" +
++                  "rs_${_bindings.crate_name}.h"
++          original_attributes = {
++            cpp_namespace = "rs::${_bindings.crate_name}"
++            deps = _bindings.deps
++          }
++
++          # Crubit reads the `.rmeta` files from `rust_sysroot`.  The copies
++          # made by `:find_stdlib` change together with these files.
++          sources = get_target_outputs(":find_stdlib")
++          deps = [ ":find_stdlib" ]
++
++          visibility = [ ":*" ]
++        }
++      }
++
++      group("std_bindings") {
++        deps = [ ":std" ]
++        public_deps = [
++          ":prebuilt_alloc_bindings",
++          ":prebuilt_core_bindings",
++          ":prebuilt_std_bindings",
++        ]
++      }
++
++      group("std_bindings_crubit_metadata") {
++        public_deps = [
++          ":prebuilt_alloc_bindings_crubit_metadata",
++          ":prebuilt_core_bindings_crubit_metadata",
++          ":prebuilt_std_bindings_crubit_metadata",
++        ]
++      }
++    }
+   }
+ }
+--- a/build_overrides/crubit.gni
++++ b/build_overrides/crubit.gni
+@@ -2,7 +2,11 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+ 
+-crubit_src_dir = "//third_party/rust-toolchain/lib/third_party/crubit"
++import("//build/config/rust.gni")
++
++assert(rust_crubit_root != "", rust_crubit_root_missing_message)
++
++crubit_src_dir = "${rust_crubit_root}/lib/third_party/crubit"
+ crubit_absl_dep_target = "//third_party/abseil-cpp:absl"
+ crubit_gn_configs_to_remove = [
+   "//build/config/compiler:chromium_code",
Risk 0/5 · Safe chromium-157-revert-gn-check-includes.patch
Result #6571

Comment

This patch only removes GN `check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE` settings and a related constant/forwarding in build files. It does not add executable code, network access, install scripts, privilege changes, or packaging-time side effects. The main impact is reduced build-time include hygiene enforcement, which could let some bad include relationships slip through, but that is a maintainability/regression concern rather than a direct security issue in the package artifact itself. No evidence of malicious behavior or supply-chain compromise in the diff reviewed.

@@ -0,0 +1,610 @@
+--- a/.gn
++++ b/.gn
+@@ -470,10 +470,3 @@ expand_directory_allowlist =
+       "//components/policy/BUILD.gn",
+     ]
+ 
+-# Entries in the allowlist should have a justification for why we need them. New
+-# entries should in this list should be reviewed by a member of the chrome build
+-# team.
+-# entries in this list should be reviewed by a member of the chrome build team.
+-allow_circular_includes_from_allowlist =
+-    allow_circular_includes_from_untriaged + project_bedrock_circular_includes +
+-    []
+--- a/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
++++ b/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
+@@ -290,7 +290,6 @@ component("raw_ptr") {
+   configs -= partition_alloc_remove_configs
+   configs += partition_alloc_add_configs
+   configs += [ ":dependants_extra_warnings" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ if (is_clang_or_gcc) {
+--- a/base/numerics/BUILD.gn
++++ b/base/numerics/BUILD.gn
+@@ -30,7 +30,6 @@ source_set("numerics") {
+     "safe_math.h",
+     "wrapping_math.h",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("unittests") {
+--- a/build/rust/rust_bindgen_generator.gni
++++ b/build/rust/rust_bindgen_generator.gni
+@@ -97,7 +97,6 @@ template("rust_bindgen_generator") {
+     # script's args and are populated using deps and configs.
+     forward_variables_from(invoker,
+                            TESTONLY_AND_VISIBILITY + [
+-                                 "check_includes_strict",
+                                  "configs",
+                                  "deps",
+                                  "public_configs",
+--- a/build/strict_deps_failures.gni
++++ b/build/strict_deps_failures.gni
+@@ -10,16 +10,8 @@
+ 
+ # TODO(crbug.com/555455099): Remove this once we've finished the migration and
+ # have no remaining usages.
+-# Set this flag when check_includes_strict is failing for a reason that hasn't
+-# been triaged yet.
+ CHECK_INCLUDES_STRICT_UNTRIAGED = false
+ 
+-# TODO(crbug.com/555455099): Remove this once we've finished the migration and
+-# have no remaining usages.
+-# Set this when check_includes_strict is failing due to public headers including
+-# private headers.
+-CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE = false
+-
+ # A list of directories for which strict_deps is enabled.
+ CHECK_INCLUDES_STRICT_ALLOWLIST = [
+   # keep-sorted: start
+--- a/chrome/browser/default_browser/BUILD.gn
++++ b/chrome/browser/default_browser/BUILD.gn
+@@ -70,7 +70,6 @@ source_set("default_browser") {
+   } else {
+     sources += [ "default_browser_monitor_stub.cc" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("test_support") {
+--- a/chrome/browser/media/prefs/BUILD.gn
++++ b/chrome/browser/media/prefs/BUILD.gn
+@@ -32,7 +32,6 @@ source_set("prefs") {
+     "//base",
+     "//chrome/common:constants",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("unit_tests") {
+--- a/chrome/browser/preloading/search_preload/BUILD.gn
++++ b/chrome/browser/preloading/search_preload/BUILD.gn
+@@ -35,7 +35,6 @@ source_set("search_preload") {
+     "//components/pref_registry",
+     "//components/search_engines",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("feature") {
+--- a/chrome/browser/shortcuts/BUILD.gn
++++ b/chrome/browser/shortcuts/BUILD.gn
+@@ -85,7 +85,6 @@ source_set("shortcuts") {
+     ]
+     deps += [ "//chrome/browser:shell_integration_linux" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("test_support") {
+--- a/chrome/browser/sync_file_system/BUILD.gn
++++ b/chrome/browser/sync_file_system/BUILD.gn
+@@ -158,7 +158,6 @@ source_set("sync_file_system") {
+     "//third_party/leveldatabase",
+     "//url",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("test_support") {
+--- a/chrome/browser/ui/lens/BUILD.gn
++++ b/chrome/browser/ui/lens/BUILD.gn
+@@ -184,7 +184,6 @@ if (!is_android) {
+         "//pdf/mojom",
+       ]
+     }
+-    check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+     deps = [ "//components/input" ]
+   }
+ 
+--- a/chrome/browser/ui/page_action/BUILD.gn
++++ b/chrome/browser/ui/page_action/BUILD.gn
+@@ -50,7 +50,6 @@ if (!is_android) {
+       "//ui/actions:actions_headers",
+       "//ui/base",
+     ]
+-    check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+   }
+ 
+   source_set("page_action_impl") {
+--- a/chrome/browser/ui/startup/default_browser_prompt/BUILD.gn
++++ b/chrome/browser/ui/startup/default_browser_prompt/BUILD.gn
+@@ -46,7 +46,6 @@ source_set("default_browser_prompt") {
+   ]
+ 
+   deps = [ "//chrome/browser/default_browser" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("impl") {
+--- a/chrome/browser/web_applications/locks/BUILD.gn
++++ b/chrome/browser/web_applications/locks/BUILD.gn
+@@ -16,7 +16,6 @@ source_set("partitioned_lock_manager") {
+     "partitioned_lock_manager.cc",
+   ]
+   public_deps = [ "//base" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("partitioned_lock_manager_unit_tests") {
+--- a/chrome/services/system_signals/BUILD.gn
++++ b/chrome/services/system_signals/BUILD.gn
+@@ -50,7 +50,6 @@ source_set("system_signals") {
+ 
+     deps += [ "//components/device_signals/core/system_signals/posix" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("unit_tests") {
+--- a/components/bookmarks/browser/BUILD.gn
++++ b/components/bookmarks/browser/BUILD.gn
+@@ -109,7 +109,6 @@ static_library("browser") {
+   if (is_ios) {
+     sources += [ "bookmark_node_data_ios.cc" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ static_library("test_support") {
+--- a/components/feed/core/v2/BUILD.gn
++++ b/components/feed/core/v2/BUILD.gn
+@@ -148,7 +148,6 @@ if (use_blink) {
+       "//components/feed/core/proto:proto_ios_shared_v2",
+       "//components/feed/core/proto:proto_v2",
+     ]
+-    check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+   }
+ 
+   source_set("test_helpers") {
+--- a/components/global_media_controls/BUILD.gn
++++ b/components/global_media_controls/BUILD.gn
+@@ -88,7 +88,6 @@ component("global_media_controls") {
+   }
+ 
+   friend = [ ":*" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("unit_tests") {
+--- a/components/metrics/BUILD.gn
++++ b/components/metrics/BUILD.gn
+@@ -388,7 +388,6 @@ if (!is_cronet_build || is_ios) {
+         "motherboard_metrics_provider.h",
+       ]
+     }
+-    check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+   }
+ 
+   static_library("test_support") {
+--- a/components/persistent_cache/BUILD.gn
++++ b/components/persistent_cache/BUILD.gn
+@@ -62,7 +62,6 @@ component("persistent_cache") {
+     ":test_support",
+     ":unit_tests",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ static_library("test_support") {
+--- a/components/sqlite_vfs/BUILD.gn
++++ b/components/sqlite_vfs/BUILD.gn
+@@ -58,7 +58,6 @@ component("sqlite_vfs") {
+   }
+ 
+   defines = [ "IS_SQLITE_VFS_IMPL" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ if (use_blink && !is_android) {
+--- a/content/browser/indexed_db/BUILD.gn
++++ b/content/browser/indexed_db/BUILD.gn
+@@ -125,7 +125,6 @@ source_set("indexed_db") {
+     ":*",
+     "//content/test/*",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("indexed_db_fuzzer_support") {
+--- a/content/public/common/BUILD.gn
++++ b/content/public/common/BUILD.gn
+@@ -48,7 +48,6 @@ component("result_codes") {
+   deps = [ "//base" ]
+ 
+   configs += [ "//content:content_implementation" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ # This target allows other targets to depend on content_descriptors.h which is
+@@ -108,7 +107,6 @@ source_set("static_switches") {
+     "//media:media_buildflags",
+     "//tools/v8_context_snapshot:buildflags",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ # This target allowing depending on content_switches without depending on the
+@@ -135,7 +133,6 @@ source_set("switches") {
+   if (enable_ipc_fuzzer) {
+     configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ # This target allows you to use the content MainFunctionParams struct and
+@@ -151,7 +148,6 @@ source_set("static_main_function_params"
+   public_deps = [ "//base" ]
+ 
+   public_configs = [ ":static_switches_defines" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ # Target for depending on main_function_params.h. This can be included without
+@@ -168,7 +164,6 @@ component("main_function_params") {
+   deps = [ "//base" ]
+ 
+   configs += [ "//content:content_implementation" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("memory_consumer_update") {
+--- a/device/bluetooth/public/cpp/BUILD.gn
++++ b/device/bluetooth/public/cpp/BUILD.gn
+@@ -21,5 +21,4 @@ component("features") {
+   ]
+   deps = [ "//base" ]
+   defines = [ "BLUETOOTH_FEATURES_IMPLEMENTATION" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+--- a/device/gamepad/public/cpp/BUILD.gn
++++ b/device/gamepad/public/cpp/BUILD.gn
+@@ -57,5 +57,4 @@ component("switches") {
+   ]
+   public_deps = [ "//base" ]
+   defines = [ "GAMEPAD_FEATURES_IMPLEMENTATION" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+--- a/mojo/core/BUILD.gn
++++ b/mojo/core/BUILD.gn
+@@ -148,7 +148,6 @@ source_set("impl_for_embedder") {
+     configs -= [ "//build/config/compiler:default_optimization" ]
+     configs += [ "//build/config/compiler:optimize_max" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("driver_for_ipcz_tests") {
+--- a/pdf/BUILD.gn
++++ b/pdf/BUILD.gn
+@@ -460,7 +460,6 @@ if (enable_pdf) {
+       "//ui/gfx/range",
+       "//v8",
+     ]
+-    check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+   }
+ 
+   source_set("pdf_test_utils") {
+--- a/remoting/proto/BUILD.gn
++++ b/remoting/proto/BUILD.gn
+@@ -58,7 +58,6 @@ source_set("internal_structs") {
+     "//remoting/base:errors",
+     "//remoting/base:session_policies",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("internal_stubs") {
+--- a/services/device/public/cpp/BUILD.gn
++++ b/services/device/public/cpp/BUILD.gn
+@@ -29,7 +29,6 @@ component("device_features") {
+       "//services/device/public/java:device_feature_list_jni",
+     ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("test_support") {
+--- a/skia/BUILD.gn
++++ b/skia/BUILD.gn
+@@ -637,7 +637,6 @@ component("skia") {
+   # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and
+   # enable the diagnostic by removing this line.
+   configs += [ "//build/config/compiler:no_exit_time_destructors" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ component("skia_switches") {
+--- a/third_party/abseil-cpp/absl/container/BUILD.gn
++++ b/third_party/abseil-cpp/absl/container/BUILD.gn
+@@ -755,7 +755,6 @@ absl_source_set("btree") {
+     "//third_party/abseil-cpp/absl/strings:string_view",
+     "//third_party/abseil-cpp/absl/types:compare",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_source_set("btree_test_common") {
+@@ -866,7 +865,6 @@ absl_source_set("chunked_queue") {
+     "//third_party/abseil-cpp/absl/base:hardening",
+     "//third_party/abseil-cpp/absl/base:iterator_traits_internal",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("chunked_queue_test") {
+--- a/third_party/abseil-cpp/absl/crc/BUILD.gn
++++ b/third_party/abseil-cpp/absl/crc/BUILD.gn
+@@ -53,7 +53,6 @@ absl_source_set("crc32c") {
+     "//third_party/abseil-cpp/absl/strings:str_format",
+     "//third_party/abseil-cpp/absl/strings:string_view",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("crc32c_test") {
+--- a/third_party/abseil-cpp/absl/functional/BUILD.gn
++++ b/third_party/abseil-cpp/absl/functional/BUILD.gn
+@@ -16,7 +16,6 @@ absl_source_set("any_invocable") {
+     "//third_party/abseil-cpp/absl/meta:type_traits",
+     "//third_party/abseil-cpp/absl/utility",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("any_invocable_test") {
+@@ -46,7 +45,6 @@ absl_source_set("bind_back") {
+     "//third_party/abseil-cpp/absl/container:compressed_tuple",
+     "//third_party/abseil-cpp/absl/utility",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("bind_back_test") {
+@@ -66,7 +64,6 @@ absl_source_set("bind_front") {
+     "//third_party/abseil-cpp/absl/meta:type_traits",
+     "//third_party/abseil-cpp/absl/utility",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("bind_front_test") {
+@@ -87,7 +84,6 @@ absl_source_set("function_ref") {
+     "//third_party/abseil-cpp/absl/meta:type_traits",
+     "//third_party/abseil-cpp/absl/utility",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("function_ref_test") {
+--- a/third_party/abseil-cpp/absl/hash/BUILD.gn
++++ b/third_party/abseil-cpp/absl/hash/BUILD.gn
+@@ -29,7 +29,6 @@ absl_source_set("hash") {
+     "//third_party/abseil-cpp/absl/types:variant",
+     "//third_party/abseil-cpp/absl/utility",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_source_set("hash_testing") {
+--- a/third_party/abseil-cpp/absl/status/BUILD.gn
++++ b/third_party/abseil-cpp/absl/status/BUILD.gn
+@@ -41,7 +41,6 @@ absl_source_set("status") {
+     "//third_party/abseil-cpp/absl/types:source_location",
+     "//third_party/abseil-cpp/absl/types:span",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("status_test") {
+@@ -79,7 +78,6 @@ absl_source_set("statusor") {
+     "//third_party/abseil-cpp/absl/types:variant",
+     "//third_party/abseil-cpp/absl/utility",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("statusor_test") {
+@@ -174,7 +172,6 @@ absl_source_set("status_matchers") {
+     "//third_party/googletest:gmock",
+     "//third_party/googletest:gtest",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("status_matchers_test") {
+--- a/third_party/abseil-cpp/absl/strings/BUILD.gn
++++ b/third_party/abseil-cpp/absl/strings/BUILD.gn
+@@ -85,7 +85,6 @@ absl_source_set("strings") {
+     # :string_view.
+     ":string_view",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_source_set("internal") {
+@@ -434,7 +433,6 @@ absl_source_set("cord") {
+     "//third_party/abseil-cpp/absl/types:optional",
+     "//third_party/abseil-cpp/absl/types:span",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_source_set("cordz_handle") {
+@@ -1022,7 +1020,6 @@ absl_source_set("generic_printer") {
+     "//third_party/abseil-cpp/absl/log/internal:container",
+     "//third_party/abseil-cpp/absl/meta:requires",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("generic_printer_test") {
+--- a/third_party/abseil-cpp/absl/types/BUILD.gn
++++ b/third_party/abseil-cpp/absl/types/BUILD.gn
+@@ -47,7 +47,6 @@ absl_source_set("span") {
+     "//third_party/abseil-cpp/absl/hash:weakly_mixed_integer",
+     "//third_party/abseil-cpp/absl/meta:type_traits",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ absl_test("span_test") {
+@@ -78,7 +77,6 @@ absl_source_set("any_span") {
+     "//third_party/abseil-cpp/absl/base:throw_delegate",
+     "//third_party/abseil-cpp/absl/meta:type_traits",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ # any_span_test is not ported because relies on RTTI
+--- a/third_party/federated_compute/BUILD.gn
++++ b/third_party/federated_compute/BUILD.gn
+@@ -328,7 +328,6 @@ source_set("fl_runner") {
+     "//third_party/protobuf:timestamp_proto",
+     "//third_party/re2",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("confidential_compute_crypto_test_util") {
+--- a/third_party/harfbuzz/BUILD.gn
++++ b/third_party/harfbuzz/BUILD.gn
+@@ -23,7 +23,6 @@ if (use_system_harfbuzz) {
+ 
+   component("harfbuzz") {
+     public_configs = [ ":harfbuzz_from_pkgconfig" ]
+-    check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+   }
+ } else {
+   import("//build/rust/cargo_crate.gni")
+@@ -39,7 +38,6 @@ if (use_system_harfbuzz) {
+       "no-doc-comments",
+     ]
+     configs = [ ":harfbuzz_config" ]
+-    check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+   }
+ 
+   cargo_crate("harfbuzz_rust") {
+@@ -578,7 +576,6 @@ if (use_system_harfbuzz) {
+       public += [ "src/src/hb-glib.h" ]
+       sources += [ "src/src/hb-glib.cc" ]
+     }
+-    check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+   }
+ }
+ 
+--- a/third_party/ipcz/src/BUILD.gn
++++ b/third_party/ipcz/src/BUILD.gn
+@@ -97,7 +97,6 @@ source_set("reference_drivers") {
+   if (is_fuchsia) {
+     public_deps += [ "//third_party/fuchsia-sdk/sdk/pkg/zx" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("util") {
+@@ -215,7 +214,6 @@ source_set("impl") {
+   ]
+   public_configs = [ ":ipcz_include_dir" ]
+   configs += [ ":ipcz_include_src_dir" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ source_set("ipcz_sources") {
+--- a/third_party/private-join-and-compute/src/BUILD.gn
++++ b/third_party/private-join-and-compute/src/BUILD.gn
+@@ -61,5 +61,4 @@ component("ec_commutative_cipher") {
+   ]
+ 
+   public_configs = [ ":private_join_and_compute_config" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+--- a/third_party/sqlite/BUILD.gn
++++ b/third_party/sqlite/BUILD.gn
+@@ -260,7 +260,6 @@ component("chromium_sqlite3") {
+   }
+ 
+   deps = [ "//third_party/icu" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ # Similar to component("chromium_sqlite") above, but uses the developer tools
+@@ -340,7 +339,6 @@ source_set("dev_sqlite3") {
+   }
+ 
+   deps = [ "//third_party/icu" ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ config("sqlite_export") {
+--- a/ui/aura/BUILD.gn
++++ b/ui/aura/BUILD.gn
+@@ -175,7 +175,6 @@ component("aura") {
+     public += [ "screen_ozone.h" ]
+     sources += [ "screen_ozone.cc" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ static_library("test_support") {
+--- a/ui/events/BUILD.gn
++++ b/ui/events/BUILD.gn
+@@ -37,7 +37,6 @@ static_library("dom_keycode_converter")
+   if (!is_ios) {
+     deps += [ "//ipc:param_traits" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ static_library("dom_keyboard_layout") {
+--- a/ui/gl/init/BUILD.gn
++++ b/ui/gl/init/BUILD.gn
+@@ -78,5 +78,4 @@ component("init") {
+       "gl_initializer_ios.cc",
+     ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+--- a/ui/views/BUILD.gn
++++ b/ui/views/BUILD.gn
+@@ -1046,7 +1046,6 @@ component("views") {
+   if (use_ozone) {
+     deps += [ "//ui/ozone" ]
+   }
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ if (is_win || is_mac || is_linux || is_chromeos) {
+--- a/ui/wm/public/BUILD.gn
++++ b/ui/wm/public/BUILD.gn
+@@ -39,7 +39,6 @@ component("public") {
+     "//ui/aura",
+     "//ui/base",
+   ]
+-  check_includes_strict = CHECK_INCLUDES_STRICT_PUBLIC_INCLUDES_PRIVATE
+ }
+ 
+ static_library("test_support") {
Risk 3/5 · Elevated chromium-157-typescript.patch
Result #6572

Comment

The patch redirects Chromium/DevTools TypeScript execution from vendored, pinned sources to the system-wide `/usr/bin/tsc` and the Node-installed `typescript` package. That is a supply-chain integrity regression: the build now depends on whatever TypeScript happens to be installed on the build machine, with no version pinning or checksum verification, so the generated artifacts can vary or be influenced by a compromised/malicious local package. The change also flips `use_typescript_go` off and conditionally bypasses the vendored tsgo inputs, further increasing reliance on external host state. I did not see direct shell injection, privilege escalation, or network fetches in this patch, but the loss of hermeticity and trust in build inputs is a meaningful security concern for an AUR package.

@@ -0,0 +1,266 @@
+--- a/third_party/devtools-frontend/src/scripts/build/typescript/typescript_vars.gni
++++ b/third_party/devtools-frontend/src/scripts/build/typescript/typescript_vars.gni
+@@ -6,7 +6,7 @@ import("//build/toolchain/rbe.gni")
+ import("../ninja/vars.gni")
+ 
+ if (host_os == "linux") {
+-  tsc_binary = "//third_party/typescript/linux-amd64/src/lib/tsc"
++  tsc_binary = "/usr/bin/tsc"
+ } else if (host_os == "win") {
+   tsc_binary = "//third_party/typescript/windows-amd64/src/lib/tsc.exe"
+ } else if (host_os == "mac") {
+--- a/third_party/devtools-frontend/src/third_party/typescript/typescript.py
++++ b/third_party/devtools-frontend/src/third_party/typescript/typescript.py
+@@ -10,6 +10,7 @@ import os
+ 
+ 
+ def GetBinaryPath():
++    return "/usr/bin/tsc"
+     if platform.machine() == 'arm64':
+         darwin_path = 'mac-arm64'
+     else:
+--- a/ui/webui/webui_features.gni
++++ b/ui/webui/webui_features.gni
+@@ -33,7 +33,7 @@ declare_args() {
+ 
+   # Enable the native TypeScript compiler (tsgo) instead of the JS-based one.
+   # TODO(crbug.com/423789047): Remove this flag once fully committed to v7.
+-  use_typescript_go = true
++  use_typescript_go = false
+ 
+   # Enable the WebUI tab strip new tab button
+   # (chrome://tabstrip-ntb.top-chrome).
+
+--- a/tools/typescript/ts_definitions.gni
++++ b/tools/typescript/ts_definitions.gni
+@@ -3,7 +3,11 @@
+ # found in the LICENSE file.
+ 
+ import("//third_party/node/node.gni")
+-import("//third_party/typescript/tsgo.gni")
++import("//ui/webui/webui_features.gni")
++
++if (use_typescript_go) {
++  import("//third_party/typescript/tsgo.gni")
++}
+ 
+ assert(is_chromeos)
+ 
+@@ -20,9 +24,12 @@ template("ts_definitions") {
+                            ])
+ 
+     inputs = [
+-               "//package.json",
+-               "//tools/typescript/tsconfig_definitions_base.json",
+-             ] + tsgo_inputs
++      "//package.json",
++      "//tools/typescript/tsconfig_definitions_base.json",
++    ]
++    if (use_typescript_go) {
++      inputs += tsgo_inputs
++    }
+     outputs = [ "$target_gen_dir/tsconfig_definitions.json" ]
+ 
+     root_dir = "."
+@@ -52,6 +59,10 @@ template("ts_definitions") {
+              "--js_files",
+            ] + js_files
+ 
++    if (use_typescript_go) {
++      args += [ "--use_typescript_go" ]
++    }
++
+     if (defined(deps)) {
+       args += [ "--deps" ]
+ 
+--- a/tools/typescript/ts_definitions.py
++++ b/tools/typescript/ts_definitions.py
+@@ -13,8 +13,9 @@ _CWD = os.getcwd()
+ _HERE_DIR = os.path.dirname(__file__)
+ _SRC_DIR = os.path.normpath(os.path.join(_HERE_DIR, '..', '..'))
+ 
+-sys.path.append(os.path.join(_SRC_DIR, 'third_party', 'typescript'))
+-import typescript
++sys.path.append(os.path.join(_SRC_DIR, 'third_party', 'node'))
++import node
++import node_modules
+ 
+ 
+ _TSCONFIG_BASE = 'tsconfig_definitions_base.json'
+@@ -40,6 +41,7 @@ def main(argv):
+   parser.add_argument('--root_dir', required=True)
+   parser.add_argument('--js_files', nargs='*', required=True)
+   parser.add_argument('--path_mappings', nargs='*')
++  parser.add_argument('--use_typescript_go', action='store_true')
+   args = parser.parse_args(argv)
+ 
+   with open(
+@@ -81,9 +83,22 @@ def main(argv):
+       if os.path.exists(to_delete):
+         os.remove(to_delete)
+ 
+-  stdout = typescript.RunTypeScript(
+-    ['--project', os.path.join(args.gen_dir, _TSCONFIG_GEN)]
+-  )
++  stdout = None
++  if args.use_typescript_go:
++    sys.path.append(os.path.join(_SRC_DIR, 'third_party', 'typescript'))
++    import typescript
++
++    stdout = typescript.RunTypeScript(
++      ['--project', os.path.join(args.gen_dir, _TSCONFIG_GEN)]
++    )
++  else:
++    stdout = node.RunNode(
++      [
++        node_modules.PathToTypescript(),
++        '--project',
++        os.path.join(args.gen_dir, _TSCONFIG_GEN),
++      ]
++    )
+ 
+   # Verify that that no unexpected .d.ts files were generated.
+   lines = stdout.splitlines()
+--- a/tools/typescript/ts_library.gni
++++ b/tools/typescript/ts_library.gni
+@@ -3,7 +3,11 @@
+ # found in the LICENSE file.
+ 
+ import("//third_party/node/node.gni")
+-import("//third_party/typescript/tsgo.gni")
++import("//ui/webui/webui_features.gni")
++
++if (use_typescript_go) {
++  import("//third_party/typescript/tsgo.gni")
++}
+ 
+ template("ts_library") {
+   node(target_name) {
+@@ -21,11 +25,14 @@ template("ts_library") {
+                            ])
+ 
+     inputs = [
+-               "//package.json",
+-               "//tools/typescript/path_utils.py",
+-               "//tools/typescript/tsconfig_base.json",
+-               "//tools/typescript/validate_tsconfig.py",
+-             ] + tsgo_inputs
++      "//package.json",
++      "//tools/typescript/path_utils.py",
++      "//tools/typescript/tsconfig_base.json",
++      "//tools/typescript/validate_tsconfig.py",
++    ]
++    if (use_typescript_go) {
++      inputs += tsgo_inputs
++    }
+ 
+     outputs = [ "$target_gen_dir/tsconfig_$target_name.json" ]
+ 
+@@ -77,6 +84,10 @@ template("ts_library") {
+       target_name,
+     ]
+ 
++    if (use_typescript_go) {
++      args += [ "--use_typescript_go" ]
++    }
++
+     if (defined(in_files)) {
+       args += [ "--in_files" ] + in_files
+     }
+--- a/tools/typescript/ts_library.py
++++ b/tools/typescript/ts_library.py
+@@ -15,8 +15,9 @@ _CWD = os.getcwd()
+ _HERE_DIR = os.path.dirname(__file__)
+ _SRC_DIR = os.path.normpath(os.path.join(_HERE_DIR, '..', '..'))
+ 
+-sys.path.append(os.path.join(_SRC_DIR, 'third_party', 'typescript'))
+-import typescript
++sys.path.append(os.path.join(_SRC_DIR, 'third_party', 'node'))
++import node
++import node_modules
+ 
+ from path_utils import isInAshFolder, getTargetPath
+ from validate_tsconfig import (
+@@ -70,6 +71,7 @@ def main(argv):
+   )
+   parser.add_argument('--enable_source_maps', action='store_true')
+   parser.add_argument('--output_suffix', required=True)
++  parser.add_argument('--use_typescript_go', action='store_true')
+   args = parser.parse_args(argv)
+ 
+   root_dir = os.path.relpath(args.root_dir, args.gen_dir)
+@@ -305,9 +307,21 @@ def main(argv):
+             os.remove(to_check)
+ 
+   try:
+-    typescript.RunTypeScript(
+-      ['--project', os.path.join(args.gen_dir, tsconfig_file)]
+-    )
++    if args.use_typescript_go:
++      sys.path.append(os.path.join(_SRC_DIR, 'third_party', 'typescript'))
++      import typescript
++
++      typescript.RunTypeScript(
++        ['--project', os.path.join(args.gen_dir, tsconfig_file)]
++      )
++    else:
++      node.RunNode(
++        [
++          node_modules.PathToTypescript(),
++          '--project',
++          os.path.join(args.gen_dir, tsconfig_file),
++        ]
++      )
+   finally:
+     if args.composite:
+       # `.tsbuildinfo` is generated by TypeScript for incremenetal compilation
+@@ -327,13 +341,24 @@ def main(argv):
+ 
+   # Invoke the TS compiler again, with the --listFilesOnly flag, to detect any
+   # files that are used by the build, but not properly declared as dependencies.
+-  out = typescript.RunTypeScript(
+-    [
+-      '--project',
+-      os.path.join(args.gen_dir, tsconfig_file),
+-      '--listFilesOnly',
+-    ]
+-  )
++  out = None
++  if args.use_typescript_go:
++    out = typescript.RunTypeScript(
++      [
++        '--project',
++        os.path.join(args.gen_dir, tsconfig_file),
++        '--listFilesOnly',
++      ]
++    )
++  else:
++    out = node.RunNode(
++      [
++        node_modules.PathToTypescript(),
++        '--project',
++        os.path.join(args.gen_dir, tsconfig_file),
++        '--listFilesOnly',
++      ]
++    )
+ 
+   files_list = out.split('\n')
+   definitions_files = list(filter(lambda f: f.endswith('.d.ts'), files_list))
+--- a/third_party/typescript/tsgo.gni
++++ b/third_party/typescript/tsgo.gni
+@@ -23,7 +23,7 @@ assert(defined(_platform_dir), "Did not
+ 
+ tsgo_inputs = [
+   "//third_party/typescript/typescript.py",
+-  "//third_party/typescript/$_platform_dir/src/lib/$_binary_name",
++  "/usr/bin/tsc",
+ ]
+ 
+ _tsgo_lib_files = [
+@@ -138,5 +138,5 @@ _tsgo_lib_files = [
+ ]
+ 
+ foreach(file, _tsgo_lib_files) {
+-  tsgo_inputs += [ "//third_party/typescript/$_platform_dir/src/lib/$file" ]
++  tsgo_inputs += [ "//third_party/node/node_modules/typescript/lib/$file" ]
+ }