soong_ui: Build under a path that contains a symbolic link.
The build directory passed in to soong_ui can contain a
symbolic link. soong_ui was not evaluating the build
directory to retrieve the true path, hence failing to
execute the internal soong.
Fixes: b/135995632
Test: Unit test case and executed the scenario in the bug
description.
Change-Id: I5779c6aa3f3183810437dbe2b2d4e40acbafb205
diff --git a/ui/build/config.go b/ui/build/config.go
index 4a70f06..4e19e9e 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -266,6 +266,10 @@
if err != nil {
ctx.Fatalf("Error retrieving top directory: %v", err)
}
+ dir, err = filepath.EvalSymlinks(dir)
+ if err != nil {
+ ctx.Fatalf("Unable to evaluate symlink of %s: %v", dir, err)
+ }
dir, err = filepath.Abs(dir)
if err != nil {
ctx.Fatalf("Unable to find absolute path %s: %v", dir, err)