https://github.com/chromium/chromium/commit/570332aad61afab5d9d88a8438bae53ea28a298a From: Noah Rose Ledesma Date: Wed, 31 Jul 2024 17:59:12 +0000 Subject: [PATCH] Use libs instead of pkg_config for linux deps pkg_config can cause builds to fail if the requested packages are not present, regardless of if the lib is depended upon by the target being built. This issue can be avoided by setting 'libs' instead. I'm not sure why we didn't do so in the first place. Bug: 355967882 Change-Id: Ie5dc4c03b08d7c1e26458ea143f6dc812b670544 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749680 Reviewed-by: Sorin Jianu Commit-Queue: Noah Rose Ledesma Cr-Commit-Position: refs/heads/main@{#1335558} --- a/chrome/updater/BUILD.gn +++ b/chrome/updater/BUILD.gn @@ -367,9 +367,10 @@ if (is_win || is_mac || is_linux) { "update_service_internal_impl_qualifying_linux.cc", "update_usage_stats_task_linux.cc", ] - public_configs = [ - "linux:libcurl", - "linux:libsystemd", + + libs = [ + "curl", + "systemd", ] } } @@ -1040,7 +1041,7 @@ if (is_win || is_mac || is_linux) { data += [ "//chrome/test/data/updater/updater_qualification_app.crx" ] data_deps += [ "//chrome/updater/linux:updater_test" ] - public_configs = [ "linux:libsystemd" ] + libs = [ "systemd" ] } if (is_posix) { --- a/chrome/updater/linux/BUILD.gn +++ b/chrome/updater/linux/BUILD.gn @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/linux/pkg_config.gni") import("//chrome/updater/zip.gni") # This target builds the updater executable and unittests. @@ -13,18 +12,10 @@ group("linux") { ] } -pkg_config("libcurl") { - packages = [ "libcurl" ] -} - -pkg_config("libsystemd") { - packages = [ "libsystemd" ] -} - source_set("updater_executable") { sources = [ "main.cc" ] deps = [ "//chrome/updater:base" ] - public_configs = [ ":libsystemd" ] + libs = [ "systemd" ] } executable("updater") {