GN missing filter_labels function?

198 views
Skip to first unread message

Keith Teo

unread,
Dec 11, 2024, 1:45:17 PM12/11/24
to Chromium-dev
Hi all,

I'm trying to build chromium on Linux, but gn is missing the "filter_labels_include" function, causing this error.

gn gen out/defaultTest
ERROR at //third_party/webrtc/webrtc.gni:907:11: Unknown function.
          filter_labels_include(deps, [ "//third_party/abseil-cpp/*" ])
          ^--------------------
See //third_party/webrtc/api/task_queue/BUILD.gn:11:1: whence it was called.
rtc_library("task_queue") {
^--------------------------
See //third_party/blink/renderer/platform/BUILD.gn:2443:5: which caused the file to be included.
    "//third_party/webrtc/api/task_queue:task_queue_test",
    ^----------------------------------------------------

I checked with gn "help all" command on my machine and it is indeed missing filter_labels_include. Based on this reference there is such a function. I have both redownloaded depot_tools and git pull origin main on it.

Any help would be appreciated!

Lei Zhang

unread,
Dec 11, 2024, 1:58:27 PM12/11/24
to keithte...@gmail.com, Chromium-dev
What version of GN are you running? Check with: gn --version. Here is it 2204/468c6128db7f from November 2024. The function you are looking for got added in https://gn-review.googlesource.com/16680 earlier in the year.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/0448e5c7-d931-4ea3-ad84-9bf88e52a3a6n%40chromium.org.

Dirk Pranke

unread,
Dec 11, 2024, 1:59:54 PM12/11/24
to keithte...@gmail.com, Chromium-dev
`filter_labels_include()` was added to GN in mid-February, so it sounds like somehow you're getting a version of GN older than that.

The version of GN Chromium uses is controlled/configured via an entry in the DEPS file, and the binary is downloaded into the //buildtools directory (on Linux, it's at //buildtools/linux64/gn, specifically).

All the script in depot_tools does is look in a few common places in a repo to find the binary, so updating depot_tools isn't actually going to update the version of GN you're using.

I would check that you have synced everything in your checkout w/ `gclient sync` and that you're getting the right binary.

-- Dirk

--

Lei Zhang

unread,
Dec 12, 2024, 12:31:46 PM12/12/24
to Keith Teo, Chromium-dev
You can start by running "which gn" to figure out which gn executable you are running, and then go from there to figure out what is going on.

Locally for me, gn is ~/depot_tools/gn, which runs ~/depot_tools/gn.py. The Python script then figures out it is in a Chromium checkout and runs buildtools/linux64/gn.

On Thu, Dec 12, 2024 at 3:06 AM Keith Teo <keithte...@gmail.com> wrote:
My version is 1000 (5e19d2f), which appears much older. Possibly this is because I also compiled v8 from source and ran their install-build-deps, any idea how to change this? 

Keith Teo

unread,
Dec 12, 2024, 5:36:19 PM12/12/24
to Chromium-dev, Dirk Pranke, Chromium-dev, keithte...@gmail.com
I started everything only a few months ago and downloaded the Chromium repo only a few days ago. I also ran gclient sync. My older GN might be coming from having ran the ./install-build-deps.sh for v8. I used /buildtools/linux64/gn and I do have the function, but now I am running into another build error:

error: no member named 'GetCaptivePortalServerUrl' in namespace 'security_interstitials'
   89 |   const std::string url = security_interstitials::GetCaptivePortalServerUrl(
      |                           ~~~~~~~~~~~~~~~~~~~~~~~~^
../../chrome/browser/ssl/chrome_security_blocking_page_factory.cc:90:22: error: no member named 'AttachCurrentThread' in namespace 'base::android'
   90 |       base::android::AttachCurrentThread());
 
This is my args.gn file:
is_debug = false
is_component_build = false
symbol_level = 0
enable_nacl = false
blink_symbol_level = 0
v8_symbol_level = 0
is_cfi = false
use_thin_lto = true
treat_warnings_as_errors = false
enable_websockets = false
enable_backup_ref_ptr_support = false
v8_enable_sandbox = false
use_vaapi = false
enable_reading_list = false
enable_captive_portal_detection = false
target_os = "linux"
target_cpu = "x64"

Any idea why this is happening?

Keith Teo

unread,
Dec 12, 2024, 5:36:27 PM12/12/24
to Chromium-dev, Lei Zhang, Chromium-dev, keithte...@gmail.com
My version is 1000 (5e19d2f), which appears much older. Possibly this is because I also compiled v8 from source and ran their install-build-deps, any idea how to change this? 
On Thursday, December 12, 2024 at 2:58:27 AM UTC+8 Lei Zhang wrote:
Reply all
Reply to author
Forward
0 new messages