Fix race condition when running tests
Tests running in parallel can trigger the race detector on
addLsdumpPath vs. reading the global paths in cc/makevars.go.
Move the lsdumpPaths variable into the Context instead of a
global variable.
Test: go test -race ./apex
Flag: EXEMPT bugfix
Change-Id: I0247358a5b3955d8e0e7d2ef54ce3942d973e948
diff --git a/cc/library.go b/cc/library.go
index 91a09fa..1f21614 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1463,7 +1463,7 @@
headerAbiChecker.Exclude_symbol_tags,
currVendorVersion)
}
- addLsdumpPath(string(tag) + ":" + llndkDump.String())
+ addLsdumpPath(ctx.Config(), string(tag)+":"+llndkDump.String())
} else if tag == apexLsdumpTag {
if apexVariantDump == nil {
apexVariantDump = library.linkApexSAbiDumpFiles(ctx,
@@ -1472,12 +1472,12 @@
headerAbiChecker.Exclude_symbol_tags,
currSdkVersion)
}
- addLsdumpPath(string(tag) + ":" + apexVariantDump.String())
+ addLsdumpPath(ctx.Config(), string(tag)+":"+apexVariantDump.String())
} else {
if tag.dirName() == "" {
optInTags = append(optInTags, tag)
}
- addLsdumpPath(string(tag) + ":" + implDump.String())
+ addLsdumpPath(ctx.Config(), string(tag)+":"+implDump.String())
}
}