Pass -p . to hidl-gen so it doesn't use ANDROID_BUILD_TOP
ANDROID_BUILD_TOP should not be used inside the build, there is no
guarantee that envsetup.sh was sourced before the build. Pass -p .
to hidl-gen so that it doesn't fall back to ANDROID_BUILD_TOP.
Bug: 79250545
Test: m checkbuild
Change-Id: Ib24541b5177fcc35f70878beaf20defc5f6d9526
diff --git a/build/hidl_interface.go b/build/hidl_interface.go
index 1a4fa2c..9f2be74 100644
--- a/build/hidl_interface.go
+++ b/build/hidl_interface.go
@@ -175,7 +175,7 @@
}
func hidlGenCommand(lang string, roots []string, name *fqName) *string {
- cmd := "$(location hidl-gen) -d $(depfile) -o $(genDir)"
+ cmd := "$(location hidl-gen) -p . -d $(depfile) -o $(genDir)"
cmd += " -L" + lang
cmd += " " + strings.Join(wrap("-r", roots, ""), " ")
cmd += " " + name.string()