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