1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
From e7f363e6010af2da97435d38ad33989f13ef996b Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Thu, 6 Nov 2025 23:25:32 +1000
Subject: [PATCH] M143 revert libpng testiness
This patch reverts 4f7637304eca894adf2e70078a55654a88224a30
which breaks system-libpng usage by making libpng a testonly target.
Really we just want to unbundle libpng at that point, though soon it
will be replaced by something perhaps a little more oxidised.
Probably we should just drop system-png at this point, but let's get
a working build for now.
Signed-off-by: Matt Jolly <kangie@gentoo.org>
---
chrome/test/BUILD.gn | 6 ++---
testing/libfuzzer/fuzzers/BUILD.gn | 2 +-
third_party/libpng/BUILD.gn | 8 -------
third_party/libpng/visibility.gni | 38 ++++++++++--------------------
tools/imagediff/BUILD.gn | 4 +---
ui/gfx/BUILD.gn | 2 +-
6 files changed, 18 insertions(+), 42 deletions(-)
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 11b17980ae54d..8796d789f929a 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -11191,7 +11191,7 @@ if (!is_android) {
"//testing/gtest",
"//third_party/hunspell",
"//third_party/icu",
- "//third_party/libpng:libpng_for_testonly",
+ "//third_party/libpng",
"//ui/base:test_support",
"//ui/events:test_support",
"//ui/ozone",
@@ -11561,7 +11561,7 @@ if (!is_android && !is_chromeos_device) {
"//testing/gtest",
"//third_party/hunspell",
"//third_party/icu",
- "//third_party/libpng:libpng_for_testonly",
+ "//third_party/libpng",
"//ui/base:base_interactive_ui_tests",
"//ui/base:ozone_buildflags",
"//ui/base:test_support",
@@ -12522,7 +12522,7 @@ if (!is_android) {
"//testing/gtest",
"//third_party/hunspell",
"//third_party/icu",
- "//third_party/libpng:libpng_for_testonly",
+ "//third_party/libpng",
"//ui/base:test_support",
"//ui/resources:ui_test_pak",
"//ui/views",
diff --git a/testing/libfuzzer/fuzzers/BUILD.gn b/testing/libfuzzer/fuzzers/BUILD.gn
index 82401e505324f..cde10308ebfea 100644
--- a/testing/libfuzzer/fuzzers/BUILD.gn
+++ b/testing/libfuzzer/fuzzers/BUILD.gn
@@ -103,7 +103,7 @@ fuzzer_test("libpng_progressive_read_fuzzer") {
sources = [ "libpng_read_fuzzer.cc" ]
deps = [
"//base",
- "//third_party/libpng:libpng_for_testonly",
+ "//third_party/libpng",
]
dict = "dicts/png.dict"
seed_corpuses = libpng_seed_corpuses
diff --git a/third_party/libpng/BUILD.gn b/third_party/libpng/BUILD.gn
index 3e31348b94f00..d4bdea1e33ce2 100644
--- a/third_party/libpng/BUILD.gn
+++ b/third_party/libpng/BUILD.gn
@@ -130,14 +130,6 @@ if (is_win) {
}
}
-group("libpng_for_testonly") {
- testonly = true
- public_deps = [ ":libpng" ]
-
- visibility = []
- visibility = libpng_testonly_visibility
-}
-
if (build_with_chromium) {
libpng_ossfuzz_seed_corpuses = [
"//components/test/data/viz",
diff --git a/third_party/libpng/visibility.gni b/third_party/libpng/visibility.gni
index 9c58928b1eb79..e0c61f794d191 100644
--- a/third_party/libpng/visibility.gni
+++ b/third_party/libpng/visibility.gni
@@ -1,6 +1,8 @@
# This list tracks all current users of libpng.
#
# libpng is actively being migrated, and calls to libpng should instead go
+ # This list tracks all current users of libpng.
+ # libpng is actively being migrated, and calls to libpng should instead go
# through Skia's `SkPngRustDecoder`. No new entries should be added to this
# list.
@@ -8,18 +10,18 @@
#
# TODO(https://crbug.com/443128323): Stop exposing `libpng` to Chrome
# (i.e. we should work on removing all entries on the list below).
-visibility = [
+ visibility = [
# Chrome => Skia => libpng dependency.
#
# TODO(https://crbug.com/381900683): Remove once Skia supports being
# built without `libpng`.
- "//skia/*",
+ "//skia/*",
# Chrome => ... => freetype => libpng dependency.
#
# TODO(https://crbug.com/42271123): Remove this once `freetype` has been
# replaced with Fontations in PDFium and in other Chrome dependencies.
- "//third_party/freetype:*",
+ "//third_party/freetype:*",
# Chrome => PDFium => libpng dependency.
#
@@ -27,38 +29,22 @@ visibility = [
# dependency has been made optional.
"//third_party:png", # In standalone PDFium
"//third_party/pdfium/third_party:png", # In Chromium
-]
-
-# Dependencies that do not really flow into Chrome binaries.
-visibility += [
- # `build/config/android/*.gni` =>
- # => `libwebp:cwebp` (`executable`)
- # => `libwebp:imagedec`
- # => `libpng` dependency.
- # The `cwebp` `executable` is used during build process, but depending on it
- # does not result in linking the `libpng` library into Chrome binary. See
- # also `cwebp_exe_allowed_visibility` in
- # `//third_party/libwebp/visibility.gni`.
- "//third_party/libwebp:imagedec",
- # `weston` => `libpng` is a test-only dependency as described in
- # `//third_party/weston/README.chromium`. The `weston` targets are not
- # marked as `testonly` but their `visibility` is restricted and (in build
- # configurations meant for testing) the only dependency of product code is
- # the `data_deps` edge from `//ui/ozone/platform/wayland` to the
- # `//third_party/weston` target (the latter one is an `executable`).
- "//third_party/weston:cairo_shared",
-]
+ # Other dependency edges that seem like Chrome => ... => libpng dependencies
+ # but really aren't. TODO: Clarify this comment in follow-up CLs.
+ "//third_party/libwebp:*",
+ "//third_party/weston/*",
+ ]
# Test/tool-only dependencies under `//third_party/angle`
# (migrating these to `libpng_testonly_visibility` would require editing
# ANGLE's `BUILD.gn` files to depend on the `libpng_for_testonly` target).
-visibility += [
+ visibility += [
"//third_party/angle/src/tests:angle_deqp_framework_qphelper",
"//third_party/angle/third_party/glmark2:glmark2_common_gl",
"//third_party/angle/third_party/glmark2:glmark2_common_gles",
"//third_party/angle/util:angle_png_utils",
-]
+ ]
# Test/tool-only dependencies.
libpng_testonly_visibility = [
diff --git a/tools/imagediff/BUILD.gn b/tools/imagediff/BUILD.gn
index 2b5f3d384881a..d56651bedc751 100644
--- a/tools/imagediff/BUILD.gn
+++ b/tools/imagediff/BUILD.gn
@@ -34,7 +34,6 @@ if (target_os == "win" && host_os != "win") {
# If the current toolchain is the test host toolchain, build the tool.
if (current_toolchain == imagediff_toolchain) {
executable("imagediff") {
- testonly = true
output_name = "image_diff" # Different than dir name for historical
# reasons.
sources = [
@@ -48,7 +47,7 @@ if (current_toolchain == imagediff_toolchain) {
deps = [
"//base",
"//build/win:default_exe_manifest",
- "//third_party/libpng:libpng_for_testonly",
+ "//third_party/libpng",
"//third_party/zlib",
]
}
@@ -61,7 +60,6 @@ if (current_toolchain == imagediff_toolchain) {
} else if (current_toolchain == default_toolchain &&
default_toolchain != imagediff_toolchain) {
binary_symlink("imagediff") {
- testonly = true
binary_label = ":$target_name($imagediff_toolchain)"
binary_output_name = "image_diff"
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index f29089286f484..95318abf2eddb 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -902,7 +902,7 @@ test("gfx_unittests") {
"//skia:skcms",
"//testing/gtest",
"//third_party/icu:icuuc",
- "//third_party/libpng:libpng_for_testonly",
+ "//third_party/libpng",
"//third_party/zlib",
"//ui/base",
"//ui/gfx/animation",
--
2.51.0
|