Revert "Revert "mixed builds correctly reference stubs libs""
This reverts commit 1db4348734
.
Changes from original:
- extracted function to add the current version to stub
versions for bp2build.
- added libc++ to mixed builds denylist
Reason for revert: re-uploading with fix in topic
Change-Id: Ifa0ed456bf8cb4a7f861d6826263adfedb4fdd9c
This commit is contained in:
committed by
Spandan Das
parent
28cbb75a09
commit
75dbca2eae
@@ -936,9 +936,17 @@ func (handler *ccLibraryBazelHandler) generateSharedBazelBuildActions(ctx androi
|
||||
func (handler *ccLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
||||
bazelCtx := ctx.Config().BazelContext
|
||||
bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
|
||||
if v := handler.module.library.stubsVersion(); v != "" {
|
||||
stubsLabel := label + "_stub_libs-" + v
|
||||
bazelCtx.QueueBazelRequest(stubsLabel, cquery.GetCcInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
|
||||
}
|
||||
}
|
||||
|
||||
func (handler *ccLibraryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
|
||||
if v := handler.module.library.stubsVersion(); v != "" {
|
||||
// if we are a stubs variant, just use the Bazel stubs target
|
||||
label = label + "_stub_libs-" + v
|
||||
}
|
||||
bazelCtx := ctx.Config().BazelContext
|
||||
ccInfo, err := bazelCtx.GetCcInfo(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
|
||||
if err != nil {
|
||||
@@ -967,6 +975,9 @@ func (handler *ccLibraryBazelHandler) ProcessBazelQueryResponse(ctx android.Modu
|
||||
}
|
||||
|
||||
handler.module.setAndroidMkVariablesFromCquery(ccInfo.CcAndroidMkInfo)
|
||||
|
||||
cctx := moduleContextFromAndroidModuleContext(ctx, handler.module)
|
||||
addStubDependencyProviders(cctx)
|
||||
}
|
||||
|
||||
func (library *libraryDecorator) setFlagExporterInfoFromCcInfo(ctx android.ModuleContext, ccInfo cquery.CcInfo) {
|
||||
@@ -1792,6 +1803,12 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext,
|
||||
Target: ctx.Target(),
|
||||
})
|
||||
|
||||
addStubDependencyProviders(ctx)
|
||||
|
||||
return unstrippedOutputFile
|
||||
}
|
||||
|
||||
func addStubDependencyProviders(ctx ModuleContext) {
|
||||
stubs := ctx.GetDirectDepsWithTag(stubImplDepTag)
|
||||
if len(stubs) > 0 {
|
||||
var stubsInfo []SharedStubLibrary
|
||||
@@ -1806,12 +1823,9 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext,
|
||||
}
|
||||
ctx.SetProvider(SharedLibraryStubsProvider, SharedLibraryStubsInfo{
|
||||
SharedStubLibraries: stubsInfo,
|
||||
|
||||
IsLLNDK: ctx.IsLlndk(),
|
||||
IsLLNDK: ctx.IsLlndk(),
|
||||
})
|
||||
}
|
||||
|
||||
return unstrippedOutputFile
|
||||
}
|
||||
|
||||
func (library *libraryDecorator) unstrippedOutputFilePath() android.Path {
|
||||
@@ -2397,7 +2411,10 @@ func (library *libraryDecorator) stubsVersions(ctx android.BaseMutatorContext) [
|
||||
}
|
||||
|
||||
// Future API level is implicitly added if there isn't
|
||||
vers := library.Properties.Stubs.Versions
|
||||
return addCurrentVersionIfNotPresent(library.Properties.Stubs.Versions)
|
||||
}
|
||||
|
||||
func addCurrentVersionIfNotPresent(vers []string) []string {
|
||||
if inList(android.FutureApiLevel.String(), vers) {
|
||||
return vers
|
||||
}
|
||||
@@ -2662,7 +2679,7 @@ func LinkageMutator(mctx android.BottomUpMutatorContext) {
|
||||
// normalizeVersions modifies `versions` in place, so that each raw version
|
||||
// string becomes its normalized canonical form.
|
||||
// Validates that the versions in `versions` are specified in least to greatest order.
|
||||
func normalizeVersions(ctx android.BaseModuleContext, versions []string) {
|
||||
func normalizeVersions(ctx android.BazelConversionPathContext, versions []string) {
|
||||
var previous android.ApiLevel
|
||||
for i, v := range versions {
|
||||
ver, err := android.ApiLevelFromUser(ctx, v)
|
||||
|
Reference in New Issue
Block a user