remove stub dependency on source_library
Since the source_library attribute of _cc_stub_library_shared was a
label attribute, the source library was added as a dependency of the
stub which doesn't always make sense. E.g. it caused validation actions
for the source library to run even when we weren't building the source
library.
This change converts the label attriubte to a string attribute so that
we don't add the dependency.
Bug: 263390551
Change-Id: I19c62d1e14847dff68ab37156452addaa119eaf9
diff --git a/cc/library.go b/cc/library.go
index 27f0623..91960d5 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -454,12 +454,12 @@
}
soname := m.Name() + ".so"
stubSuitesAttrs := &bazelCcStubSuiteAttributes{
- Symbol_file: compilerAttrs.stubsSymbolFile,
- Versions: compilerAttrs.stubsVersions,
- Export_includes: exportedIncludes.Includes,
- Soname: &soname,
- Source_library: *bazel.MakeLabelAttribute(":" + m.Name()),
- Deps: baseAttributes.deps,
+ Symbol_file: compilerAttrs.stubsSymbolFile,
+ Versions: compilerAttrs.stubsVersions,
+ Export_includes: exportedIncludes.Includes,
+ Soname: &soname,
+ Source_library_label: proptools.StringPtr(m.GetBazelLabel(ctx, m)),
+ Deps: baseAttributes.deps,
}
ctx.CreateBazelTargetModule(stubSuitesProps,
android.CommonAttributes{Name: m.Name() + "_stub_libs"},
@@ -3033,12 +3033,12 @@
}
type bazelCcStubSuiteAttributes struct {
- Symbol_file *string
- Versions bazel.StringListAttribute
- Export_includes bazel.StringListAttribute
- Source_library bazel.LabelAttribute
- Soname *string
- Deps bazel.LabelListAttribute
+ Symbol_file *string
+ Versions bazel.StringListAttribute
+ Export_includes bazel.StringListAttribute
+ Source_library_label *string
+ Soname *string
+ Deps bazel.LabelListAttribute
}
type bazelCcHeaderAbiCheckerAttributes struct {