Don't copy host cross variants to testcases
Checking for os == BuildOS isn't sufficient if we are also cross
compiling to other architectures for that OS, for example when
BuildOS is linux_musl and we are building for x86_64 and cross
compiling to arm64. Also skip variants that are HostCross.
Bug: 236052820
Test: linux musl x86_64 + arm64 build
Change-Id: I58ce0d8cbfa7c3e209d22c03e49f6d094ff5e107
diff --git a/build/art.go b/build/art.go
index 8272335..c39b7e3 100644
--- a/build/art.go
+++ b/build/art.go
@@ -305,7 +305,7 @@
// The 'key' is the file in testcases and 'value' is the path to copy it from.
// The actual copy will be done in make since soong does not do installations.
func addTestcasesFile(ctx android.InstallHookContext) {
- if ctx.Os() != ctx.Config().BuildOS || ctx.Module().IsSkipInstall() {
+ if ctx.Os() != ctx.Config().BuildOS || ctx.Target().HostCross || ctx.Module().IsSkipInstall() {
return
}