Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e04753b authored by Mu-Le Lee's avatar Mu-Le Lee
Browse files

Diff source dump and current version dump for Cross-Version ABI Check

In the newly proposed Cross-Verison ABI Check, the path of dump that
LLNDK, NDK and mainline reference to is changed to:
Before finalization: current/
After finalization: {PLATFORM_SDK_VERSION}/
In addition, a related CL(aosp/2147882) modifies the script to create
dump to folders that match the current finalization stage.

Test: make libbinder_ndk
Bug: 238387082
Change-Id: I92a4a52c26c85cf4c866b441e54291c6a624fbf4
parent 28ee99f3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -761,6 +761,10 @@ func (c *config) PlatformSdkVersion() ApiLevel {
	return uncheckedFinalApiLevel(*c.productVariables.Platform_sdk_version)
}

func (c *config) PlatformSdkFinal() bool {
	return Bool(c.productVariables.Platform_sdk_final)
}

func (c *config) PlatformSdkCodename() string {
	return String(c.productVariables.Platform_sdk_codename)
}
+10 −6
Original line number Diff line number Diff line
@@ -1616,14 +1616,18 @@ func getRefAbiDumpFile(ctx ModuleContext, vndkVersion, fileName string) android.

func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objects, fileName string, soFile android.Path) {
	if library.sabi.shouldCreateSourceAbiDump() {
		var vndkVersion string

		var version string
		if ctx.useVndk() {
			// For modules linking against vndk, follow its vndk version
			vndkVersion = ctx.Module().(*Module).VndkVersion()
			version = ctx.Module().(*Module).VndkVersion()
		} else {
			// After sdk finalizatoin, the ABI of the latest API level must be consistent with the source code
			// so the chosen reference dump is the PLATFORM_SDK_VERSION.
			if ctx.Config().PlatformSdkFinal() {
				version = ctx.Config().PlatformSdkVersion().String()
			} else {
			// Regard the other modules as PLATFORM_VNDK_VERSION
			vndkVersion = ctx.DeviceConfig().PlatformVndkVersion()
				version = "current"
			}
		}

		exportIncludeDirs := library.flagExporter.exportedIncludes(ctx)
@@ -1642,7 +1646,7 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec

		addLsdumpPath(classifySourceAbiDump(ctx) + ":" + library.sAbiOutputFile.String())

		refAbiDumpFile := getRefAbiDumpFile(ctx, vndkVersion, fileName)
		refAbiDumpFile := getRefAbiDumpFile(ctx, version, fileName)
		if refAbiDumpFile != nil {
			library.sAbiDiff = sourceAbiDiff(ctx, library.sAbiOutputFile.Path(),
				refAbiDumpFile, fileName, exportedHeaderFlags,