From cbf1148b5b1c1cf1cbeee55f96a167aaf190eab1 Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 3 Feb 2025 07:09:47 -0800 Subject: [PATCH] Fix owner label The code now matches native implementation. Those owner labels are used by cc_shared_library. If target names aren't used, several libraries get dropped by that rule. PiperOrigin-RevId: 722645525 Change-Id: Id72224a9dbb129aa91bc1c662f24c8e9651171a1 --- .../cc/link/create_linking_context_from_compilation_outputs.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/starlark/builtins_bzl/common/cc/link/create_linking_context_from_compilation_outputs.bzl b/src/main/starlark/builtins_bzl/common/cc/link/create_linking_context_from_compilation_outputs.bzl index f388e56166bb76..8edfb572e15aab 100644 --- a/src/main/starlark/builtins_bzl/common/cc/link/create_linking_context_from_compilation_outputs.bzl +++ b/src/main/starlark/builtins_bzl/common/cc/link/create_linking_context_from_compilation_outputs.bzl @@ -125,7 +125,7 @@ def create_linking_context_from_compilation_outputs( linker_input = cc_common_internal.create_linker_input( # TODO(b/331164666): remove cheat, we always produce a file, file.owner gives us a label - owner = cc_internal.actions2ctx_cheat(actions).label, + owner = cc_internal.actions2ctx_cheat(actions).label.same_package_label(name), libraries = depset([cc_linking_outputs.library_to_link]) if cc_linking_outputs.library_to_link else None, user_link_flags = user_link_flags, additional_inputs = additional_inputs,