Don't rely on TOP+OUT_DIR as the location for OUT_DIR.

OUT_DIR may not be in TOP (where the source tree is).

Test: presubmits
Test: set OUT_DIR=$HOME/out1; m --bazel-mode nothing

Fixes: 254022328
Change-Id: I8cf9fe2da3cdc0ba5489dfbe41d9d32f06ace83d
diff --git a/ui/build/soong.go b/ui/build/soong.go
index 28c6ec9..4ec0354 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -404,7 +404,7 @@
 	soongBuildEnv.Set("BAZEL_WORKSPACE", absPath(ctx, "."))
 	soongBuildEnv.Set("BAZEL_METRICS_DIR", config.BazelMetricsDir())
 	soongBuildEnv.Set("LOG_DIR", config.LogsDir())
-	soongBuildEnv.Set("BAZEL_DEPS_FILE", filepath.Join(os.Getenv("TOP"), config.OutDir(), "tools", "bazel.list"))
+	soongBuildEnv.Set("BAZEL_DEPS_FILE", absPath(ctx, filepath.Join(config.BazelOutDir(), "bazel.list")))
 
 	// For Soong bootstrapping tests
 	if os.Getenv("ALLOW_MISSING_DEPENDENCIES") == "true" {