Merge "Deprecate ABI reference dumps in gzip"
This commit is contained in:
@@ -292,12 +292,6 @@ var (
|
||||
},
|
||||
"extraFlags", "referenceDump", "libName", "arch", "errorMessage")
|
||||
|
||||
// Rule to unzip a reference abi dump.
|
||||
unzipRefSAbiDump = pctx.AndroidStaticRule("unzipRefSAbiDump",
|
||||
blueprint.RuleParams{
|
||||
Command: "gunzip -c $in > $out",
|
||||
})
|
||||
|
||||
// Rule to zip files.
|
||||
zip = pctx.AndroidStaticRule("zip",
|
||||
blueprint.RuleParams{
|
||||
@@ -911,18 +905,6 @@ func transformDumpToLinkedDump(ctx android.ModuleContext, sAbiDumps android.Path
|
||||
return android.OptionalPathForPath(outputFile)
|
||||
}
|
||||
|
||||
// unzipRefDump registers a build statement to unzip a reference abi dump.
|
||||
func unzipRefDump(ctx android.ModuleContext, zippedRefDump android.Path, baseName string) android.Path {
|
||||
outputFile := android.PathForModuleOut(ctx, baseName+"_ref.lsdump")
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: unzipRefSAbiDump,
|
||||
Description: "gunzip" + outputFile.Base(),
|
||||
Output: outputFile,
|
||||
Input: zippedRefDump,
|
||||
})
|
||||
return outputFile
|
||||
}
|
||||
|
||||
func transformAbiDumpToAbiDiff(ctx android.ModuleContext, inputDump, referenceDump android.Path,
|
||||
baseName, nameExt string, extraFlags []string, errorMessage string) android.Path {
|
||||
|
||||
|
@@ -1794,10 +1794,8 @@ func (library *libraryDecorator) coverageOutputFilePath() android.OptionalPath {
|
||||
return library.coverageOutputFile
|
||||
}
|
||||
|
||||
// pathForRefAbiDump returns an OptionalPath representing the path of the
|
||||
// reference abi dump for the given module. This is not guaranteed to be valid.
|
||||
func pathForRefAbiDump(ctx android.ModuleInstallPathContext,
|
||||
versionedDumpDir, fileName string, isGzip bool) android.OptionalPath {
|
||||
func getRefAbiDumpFile(ctx android.ModuleInstallPathContext,
|
||||
versionedDumpDir, fileName string) android.OptionalPath {
|
||||
|
||||
currentArchType := ctx.Arch().ArchType
|
||||
primaryArchType := ctx.Config().DevicePrimaryArchType()
|
||||
@@ -1806,15 +1804,8 @@ func pathForRefAbiDump(ctx android.ModuleInstallPathContext,
|
||||
archName += "_" + primaryArchType.String()
|
||||
}
|
||||
|
||||
var ext string
|
||||
if isGzip {
|
||||
ext = ".lsdump.gz"
|
||||
} else {
|
||||
ext = ".lsdump"
|
||||
}
|
||||
|
||||
return android.ExistentPathForSource(ctx, versionedDumpDir, archName, "source-based",
|
||||
fileName+ext)
|
||||
fileName+".lsdump")
|
||||
}
|
||||
|
||||
func getRefAbiDumpDir(isNdk, isVndk bool) string {
|
||||
@@ -1829,25 +1820,6 @@ func getRefAbiDumpDir(isNdk, isVndk bool) string {
|
||||
return filepath.Join("prebuilts", "abi-dumps", dirName)
|
||||
}
|
||||
|
||||
func getRefAbiDumpFile(ctx ModuleContext, versionedDumpDir, fileName string) android.Path {
|
||||
refAbiDumpTextFile := pathForRefAbiDump(ctx, versionedDumpDir, fileName, /* isGzip */ false)
|
||||
refAbiDumpGzipFile := pathForRefAbiDump(ctx, versionedDumpDir, fileName, /* isGzip */ true)
|
||||
|
||||
if refAbiDumpTextFile.Valid() {
|
||||
if refAbiDumpGzipFile.Valid() {
|
||||
ctx.ModuleErrorf(
|
||||
"Two reference ABI dump files are found: %q and %q. Please delete the stale one.",
|
||||
refAbiDumpTextFile, refAbiDumpGzipFile)
|
||||
return nil
|
||||
}
|
||||
return refAbiDumpTextFile.Path()
|
||||
}
|
||||
if refAbiDumpGzipFile.Valid() {
|
||||
return unzipRefDump(ctx, refAbiDumpGzipFile.Path(), fileName)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func prevRefAbiDumpVersion(ctx ModuleContext, dumpDir string) int {
|
||||
sdkVersionInt := ctx.Config().PlatformSdkVersion().FinalInt()
|
||||
sdkVersionStr := ctx.Config().PlatformSdkVersion().String()
|
||||
@@ -1958,8 +1930,8 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
|
||||
prevVersion := strconv.Itoa(prevVersionInt)
|
||||
prevDumpDir := filepath.Join(dumpDir, prevVersion, binderBitness)
|
||||
prevDumpFile := getRefAbiDumpFile(ctx, prevDumpDir, fileName)
|
||||
if prevDumpFile != nil {
|
||||
library.crossVersionAbiDiff(ctx, prevDumpFile,
|
||||
if prevDumpFile.Valid() {
|
||||
library.crossVersionAbiDiff(ctx, prevDumpFile.Path(),
|
||||
fileName, isLlndk || isNdk,
|
||||
strconv.Itoa(prevVersionInt+1), prevVersion)
|
||||
}
|
||||
@@ -1968,8 +1940,8 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec
|
||||
currVersion := currRefAbiDumpVersion(ctx, isVndk)
|
||||
currDumpDir := filepath.Join(dumpDir, currVersion, binderBitness)
|
||||
currDumpFile := getRefAbiDumpFile(ctx, currDumpDir, fileName)
|
||||
if currDumpFile != nil {
|
||||
library.sameVersionAbiDiff(ctx, currDumpFile,
|
||||
if currDumpFile.Valid() {
|
||||
library.sameVersionAbiDiff(ctx, currDumpFile.Path(),
|
||||
fileName, isLlndk || isNdk, ctx.IsVndkExt())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user