From b1d8c99e12c62cf28915467dbcf4a958032d7a08 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 21 Jan 2020 11:43:29 -0800 Subject: [PATCH] Pass desired size proptools.FilterPropertyStructSharded proptools.FilterPropertyStructSharded now takes a desired max size of the name. Fixes: 146234651 Test: all soong tests Change-Id: Ifa10039e5f55a5d0f4a35172983d43f33af88e93 --- android/arch.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/android/arch.go b/android/arch.go index 91864f139..62c7db7fc 100644 --- a/android/arch.go +++ b/android/arch.go @@ -938,7 +938,14 @@ type archPropRoot struct { // returns lists of reflect.Types that contains the arch-variant properties inside structs for each // arch, multilib and target property. func createArchPropTypeDesc(props reflect.Type) []archPropTypeDesc { - propShards, _ := proptools.FilterPropertyStructSharded(props, filterArchStruct) + // Each property struct shard will be nested many times under the runtime generated arch struct, + // which can hit the limit of 64kB for the name of runtime generated structs. They are nested + // 97 times now, which may grow in the future, plus there is some overhead for the containing + // type. This number may need to be reduced if too many are added, but reducing it too far + // could cause problems if a single deeply nested property no longer fits in the name. + const maxArchTypeNameSize = 500 + + propShards, _ := proptools.FilterPropertyStructSharded(props, maxArchTypeNameSize, filterArchStruct) if len(propShards) == 0 { return nil }