From 77c4afab96331d48138f090cd1e395f4db8bd644 Mon Sep 17 00:00:00 2001 From: Eric Amorde Date: Wed, 4 Dec 2024 12:01:53 -0800 Subject: [PATCH] Avoid calling to_list in _get_cc_info_linker_inputs for performance (#930) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is slow for very large targets and slows down `_apple_framework_packaging_impl`. Before: ![Screenshot 2024-12-03 at 2 51 43 PM](https://github.com/user-attachments/assets/ad253422-9afb-4fed-aab9-cb835f9fe17b) After: ![Screenshot 2024-12-03 at 2 53 10 PM](https://github.com/user-attachments/assets/c3a79512-dae1-4bbb-812a-fa469725528d) --- rules/framework.bzl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rules/framework.bzl b/rules/framework.bzl index 9e5fcc7e..050e6853 100644 --- a/rules/framework.bzl +++ b/rules/framework.bzl @@ -562,10 +562,9 @@ def _get_cc_info_linker_inputs(*, deps): if not CcInfo in dep: continue - for linker_input in dep[CcInfo].linking_context.linker_inputs.to_list(): - linker_inputs.append(linker_input) + linker_inputs.append(dep[CcInfo].linking_context.linker_inputs) - return depset(linker_inputs) + return depset([], transitive = linker_inputs) def _create_swiftmodule(attrs): kwargs = {}