Detect invalid arch specific properties in snapshot
Previously, the snapshot code did not know whether a specific property
could be arch specific or not and assumed that they all were which
meant that it could generate snapshots containing arch specific values
for properties that are not arch specific and so would fail when
unpacked.
This change requires arch specific fields in SdkMemberProperties to be
tagged as such using `android:"arch_variant"` (just as in module input
property structures). Any property without that must have properties
that are common across all variants.
Bug: 155628860
Test: m nothing
Change-Id: Ifc8116e11d987cfe7aec2eeaa964f3bbf36b5dc2
diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go
index 2c8e311..730012c 100644
--- a/cc/library_sdk_member.go
+++ b/cc/library_sdk_member.go
@@ -307,7 +307,7 @@
// The list of possibly common exported include dirs.
//
// This field is exported as its contents may not be arch specific.
- ExportedIncludeDirs android.Paths
+ ExportedIncludeDirs android.Paths `android:"arch_variant"`
// The list of arch specific exported generated include dirs.
//
@@ -322,23 +322,23 @@
// The list of possibly common exported system include dirs.
//
// This field is exported as its contents may not be arch specific.
- ExportedSystemIncludeDirs android.Paths
+ ExportedSystemIncludeDirs android.Paths `android:"arch_variant"`
// The list of possibly common exported flags.
//
// This field is exported as its contents may not be arch specific.
- ExportedFlags []string
+ ExportedFlags []string `android:"arch_variant"`
// The set of shared libraries
//
// This field is exported as its contents may not be arch specific.
- SharedLibs []string
+ SharedLibs []string `android:"arch_variant"`
// The set of system shared libraries. Note nil and [] are semantically
// distinct - see BaseLinkerProperties.System_shared_libs.
//
// This field is exported as its contents may not be arch specific.
- SystemSharedLibs []string
+ SystemSharedLibs []string `android:"arch_variant"`
// The specific stubs version for the lib variant, or empty string if stubs
// are not in use.