Use copy of apex_available in AvailableToSameApexes
Modifying the list in-place causes some non-determinism. Test: go test ./cc -run TestStubsForLibraryInMultipleApexes -count 1000 Bug: 275313114 Change-Id: Ia2519e146d97667ad5900cf68ab9935fcbaf08a4
This commit is contained in:
@@ -502,8 +502,9 @@ func (m *ApexModuleBase) checkApexAvailableProperty(mctx BaseModuleContext) {
|
|||||||
// exactly the same set of APEXes (and platform), i.e. if their apex_available
|
// exactly the same set of APEXes (and platform), i.e. if their apex_available
|
||||||
// properties have the same elements.
|
// properties have the same elements.
|
||||||
func AvailableToSameApexes(mod1, mod2 ApexModule) bool {
|
func AvailableToSameApexes(mod1, mod2 ApexModule) bool {
|
||||||
mod1ApexAvail := SortedUniqueStrings(mod1.apexModuleBase().ApexProperties.Apex_available)
|
// Use CopyOf to prevent non-determinism (b/275313114#comment1)
|
||||||
mod2ApexAvail := SortedUniqueStrings(mod2.apexModuleBase().ApexProperties.Apex_available)
|
mod1ApexAvail := SortedUniqueStrings(CopyOf(mod1.apexModuleBase().ApexProperties.Apex_available))
|
||||||
|
mod2ApexAvail := SortedUniqueStrings(CopyOf(mod2.apexModuleBase().ApexProperties.Apex_available))
|
||||||
if len(mod1ApexAvail) != len(mod2ApexAvail) {
|
if len(mod1ApexAvail) != len(mod2ApexAvail) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@@ -3573,9 +3573,6 @@ func TestVersionedStubs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStubsForLibraryInMultipleApexes(t *testing.T) {
|
func TestStubsForLibraryInMultipleApexes(t *testing.T) {
|
||||||
// TODO(b/275313114): Test exposes non-determinism which should be corrected and the test
|
|
||||||
// reenabled.
|
|
||||||
t.Skip()
|
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := testCc(t, `
|
ctx := testCc(t, `
|
||||||
cc_library_shared {
|
cc_library_shared {
|
||||||
|
Reference in New Issue
Block a user