|
@@ -351,6 +351,9 @@ func (r *builtinBazelRunner) issueBazelCommand(paths *bazelPaths, runName bazel.
|
|
|
"HOME="+paths.homeDir,
|
|
|
pwdPrefix(),
|
|
|
"BUILD_DIR="+absolutePath(paths.buildDir),
|
|
|
+ // Make OUT_DIR absolute here so tools/bazel.sh uses the correct
|
|
|
+ // OUT_DIR at <root>/out, instead of <root>/out/soong/workspace/out.
|
|
|
+ "OUT_DIR="+absolutePath(paths.outDir()),
|
|
|
// Disables local host detection of gcc; toolchain information is defined
|
|
|
// explicitly in BUILD files.
|
|
|
"BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1")
|
|
@@ -576,6 +579,11 @@ func (p *bazelPaths) syntheticWorkspaceDir() string {
|
|
|
return filepath.Join(p.buildDir, "workspace")
|
|
|
}
|
|
|
|
|
|
+// Returns the path to the top level out dir ($OUT_DIR).
|
|
|
+func (p *bazelPaths) outDir() string {
|
|
|
+ return filepath.Dir(p.buildDir)
|
|
|
+}
|
|
|
+
|
|
|
// Issues commands to Bazel to receive results for all cquery requests
|
|
|
// queued in the BazelContext.
|
|
|
func (context *bazelContext) InvokeBazel() error {
|