Retrieve shared lib output from custom provider

Use of the native CcSharedLibraryInfo results in using a superfluous
symlink for shared libraries in mixed builds. The new provider
propagates an unwrapped output file (real file, not a symlink).

Test: With related rules changes, manually verified that installed
mixed-build libc was not a symlink. (cf_x86_64, inspected system.img
with `m droid`)

Change-Id: I2a59b348fbfc2a381c229d66c0098e87674a9ddc
This commit is contained in:
Chris Parsons
2022-08-18 12:25:47 -04:00
parent 4b32269d0a
commit 9ae019cc76

View File

@@ -134,13 +134,13 @@ else:
sharedLibraries = []
rootSharedLibraries = []
shared_info_tag = "@_builtins//:common/cc/experimental_cc_shared_library.bzl%CcSharedLibraryInfo"
shared_info_tag = "//build/bazel/rules/cc:cc_library_shared.bzl%CcSharedLibraryOutputInfo"
if shared_info_tag in providers(target):
shared_info = providers(target)[shared_info_tag]
for lib in shared_info.linker_input.libraries:
path = lib.dynamic_library.path
rootSharedLibraries += [path]
sharedLibraries.append(path)
path = shared_info.output_file.path
sharedLibraries.append(path)
rootSharedLibraries += [path]
else:
for linker_input in linker_inputs:
for library in linker_input.libraries: