From 7d6555b11f181bdc24ba56577f753a07add6e8c7 Mon Sep 17 00:00:00 2001 From: Matt Jolly Date: Tue, 16 Jun 2026 21:57:07 -0700 Subject: [PATCH] build: Fix get_path_info on empty ar in unbundle toolchain Some toolchains leave ar empty during initial setup, causing GN to error when get_path_info() is called with an empty string. Guard the check to only run when ar is not empty. Signed-off-by: Matt Jolly Change-Id: I87615806ddfda6f262a7500b0c5b6fed1f452985 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7949777 Reviewed-by: Takuto Ikuta Commit-Queue: Takuto Ikuta Reviewed-by: Matt Stark Cr-Commit-Position: refs/heads/main@{#1648076} --- diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index ec66ab3..d8457bfa 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -409,8 +409,9 @@ } else { command = "rm -f {{output}} && $command" - # Add ar to inputs if it's not from $PATH. - if (get_path_info(ar, "file") != ar) { + # Add ar to inputs if it's not from $PATH. Some toolchains leave + # |ar| empty during toolchain setup, so guard get_path_info() here. + if (ar != "" && get_path_info(ar, "file") != ar) { inputs = [ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ] }