Revert "[rust png] Reinforce `testonly`-ness of some users of `libpng`." This reverts commit e800913378944238d93efb337e76afb44af08dfd. Reason for revert: Causing some bots failure: https://ci.chromium.org/ui/p/chromium/builders/ci/Libfuzzer%20Upload%20iOS%20Catalyst%20Debug/116009/overview Or https://ci.chromium.org/ui/p/chromium/builders/ci/ios-catalyst/201046/overview Original change's description: > [rust png] Reinforce `testonly`-ness of some users of `libpng`. > > This CL extracts a separate `third_party/libpng:libpng_for_testonly` > target which: > > 1) Is a `group` that proxies/forwards to the `libpng` target by listing > it as its `public_deps` > 2) Has limited visibility (based on the new `libpng_testonly_visibility` > introduced in the refactored `third_party/libpng/visibility.gni`). > The new visibility is almost unchanged, except for explicitly > spelling out some targets instead of using wildcards > 3) Is marked as `testonly` > > Bug: 443128323 > Change-Id: I15626f7ece79304f9649057e7e215c3e72d15b92 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6976870 > Reviewed-by: Nico Weber <thakis@chromium.org> > Commit-Queue: Ćukasz Anforowicz <lukasza@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1521521} Bug: 443128323 No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: I106b084528894950a44f52ce7e84c002c54a007e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6990712 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: Yi Gu <yigu@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Yi Gu <yigu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1521554} NOKEYCHECK=True GitOrigin-RevId: 7fa4c2d7ab42a48247ce8e0290cbb7e854990f1e
diff --git a/BUILD.gn b/BUILD.gn index 3e31348..d4bdea1 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -130,14 +130,6 @@ } } -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/visibility.gni b/visibility.gni index a53ccd5..e7a8dc8 100644 --- a/visibility.gni +++ b/visibility.gni
@@ -1,62 +1,23 @@ # 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. - -# Chrome => ... => libpng dependencies. -# -# TODO(https://crbug.com/443128323): Stop exposing `libpng` to Chrome -# (i.e. we should work on removing all entries on the list below). +# through skia. No new entries should be added to this list. visibility = [ - # Chrome => Skia => libpng dependency. - # - # TODO(https://crbug.com/381900683): Remove once Skia supports being - # built without `libpng`. + "//chrome/test:*", "//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. + "//testing/libfuzzer/fuzzers/*", + "//third_party/angle/src/tests/*", + "//third_party/angle/third_party/glmark2:*", + "//third_party/angle/util:*", "//third_party/freetype:*", - - # Chrome => PDFium => libpng dependency. - # - # TODO(https://crbug.com/444045690): Remove once PDFium => `libpng` - # dependency has been made optional. - "//third_party:png", # In standalone PDFium - "//third_party/pdfium/third_party:png", # In Chromium - - # Other dependency edges that seem like Chrome => ... => libpng dependencies - # but really aren't. TODO: Clarify this comment in follow-up CLs. + "//third_party/libpng/*", "//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 += [ - "//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 = [ - "//chrome/test:accessibility_live_site_tests", - "//chrome/test:captured_sites_interactive_tests", - "//chrome/test:interactive_ui_tests", - "//testing/libfuzzer/fuzzers:libpng_progressive_read_fuzzer", - "//tools/imagediff", - - # Using a wildcard, to cover template-generated targets (e.g. - # `//ui/gfx:gfx_unittests__library__jni_registration__native_sources` or - # `//ui/gfx:gfx_unittests__exec`). + "//tools/imagediff:*", "//ui/gfx:*", ] -# Self-dependency (for internal targets defined in -# `//third_party/libpng/BUILD.gn`). -visibility += [ "//third_party/libpng/*" ] +# PDFium dependency. +visibility += [ + "//third_party:png", # In standalone PDFium + "//third_party/pdfium/third_party:png", # In Chromium +]