Convert abi warnings to errors.
Convert abi warnings to errors by removing the -advice-only flag from the invocation of header-abi-diff. This will only apply to branches with reference abi dumps checked into prebuilts/abi-dumps/(v)ndk (since abi-diffing will only be triggered on them.) Also allow for: 1) Extensions. 2) Changes to types in exported headers, unreferenced by public symbols still trigger warnings. 3) Any removal of symbols appearing in a shared library's .dynsym table, but not in exported headers is still a warning. Bug: 64267858 Test: make -j64 from ToT. Change-Id: Iadeac8d060cb693d4310afb841dc48d91f38597d
This commit is contained in:
@@ -36,6 +36,14 @@ const (
|
|||||||
staticLibraryExtension = ".a"
|
staticLibraryExtension = ".a"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
abiCheckAllowFlags = []string{
|
||||||
|
"-allow-extensions",
|
||||||
|
"-allow-unreferenced-changes",
|
||||||
|
"-allow-unreferenced-elf-symbol-changes",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
pctx = android.NewPackageContext("android/soong/cc")
|
pctx = android.NewPackageContext("android/soong/cc")
|
||||||
|
|
||||||
@@ -191,10 +199,10 @@ var (
|
|||||||
// Abidiff check turned on in advice-only mode. Builds will not fail on abi incompatibilties / extensions.
|
// Abidiff check turned on in advice-only mode. Builds will not fail on abi incompatibilties / extensions.
|
||||||
sAbiDiff = pctx.AndroidStaticRule("sAbiDiff",
|
sAbiDiff = pctx.AndroidStaticRule("sAbiDiff",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
Command: "$sAbiDiffer -lib $libName -arch $arch -advice-only -check-all-apis -o ${out} -new $in -old $referenceDump",
|
Command: "$sAbiDiffer $allowFlags -lib $libName -arch $arch -check-all-apis -o ${out} -new $in -old $referenceDump",
|
||||||
CommandDeps: []string{"$sAbiDiffer"},
|
CommandDeps: []string{"$sAbiDiffer"},
|
||||||
},
|
},
|
||||||
"referenceDump", "libName", "arch")
|
"allowFlags", "referenceDump", "libName", "arch")
|
||||||
|
|
||||||
unzipRefSAbiDump = pctx.AndroidStaticRule("unzipRefSAbiDump",
|
unzipRefSAbiDump = pctx.AndroidStaticRule("unzipRefSAbiDump",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
@@ -709,6 +717,7 @@ func SourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD
|
|||||||
"referenceDump": referenceDump.String(),
|
"referenceDump": referenceDump.String(),
|
||||||
"libName": baseName,
|
"libName": baseName,
|
||||||
"arch": ctx.Arch().ArchType.Name,
|
"arch": ctx.Arch().ArchType.Name,
|
||||||
|
"allowFlags": strings.Join(abiCheckAllowFlags, " "),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return android.OptionalPathForPath(outputFile)
|
return android.OptionalPathForPath(outputFile)
|
||||||
|
Reference in New Issue
Block a user