diff options
author | Lukacs T. Berki <lberki@google.com> | 2021-03-02 10:09:41 +0100 |
---|---|---|
committer | Lukacs T. Berki <lberki@google.com> | 2021-03-08 08:27:58 +0100 |
commit | 7d613bfe2cf0a864ce8b676212958dcb62bd2894 (patch) | |
tree | 49b4fae7485f1ac1d902a58b3f7d9627948cca70 /ui | |
parent | 6d3e72688729ea72bf64f1e7dacccc5b57f384be (diff) | |
download | soong-7d613bfe2cf0a864ce8b676212958dcb62bd2894.tar.gz |
Make it possible to debug soong_ui.
This works by setting the SOONG_UI_DELVE= environment variable to the
port on which soong_ui should accept a Delve connection on.
This is achieved by reusing the Delve execution logic between soong_ui
and soong_build.
Test: Manual.
Change-Id: Id2c1d4b6faac1a4a3918c91030ce2239f7daf54f
Diffstat (limited to 'ui')
-rw-r--r-- | ui/build/soong.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/build/soong.go b/ui/build/soong.go index 242282bf3..c2fa427bf 100644 --- a/ui/build/soong.go +++ b/ui/build/soong.go @@ -105,11 +105,6 @@ func runSoong(ctx Context, config Config) { soongBuildEnv.Set("BAZEL_WORKSPACE", absPath(ctx, ".")) soongBuildEnv.Set("BAZEL_METRICS_DIR", config.BazelMetricsDir()) - if os.Getenv("SOONG_DELVE") != "" { - // SOONG_DELVE is already in cmd.Environment - soongBuildEnv.Set("SOONG_DELVE_PATH", shared.ResolveDelveBinary()) - } - err := writeEnvironmentFile(ctx, envFile, soongBuildEnv.AsMap()) if err != nil { ctx.Fatalf("failed to write environment file %s: %s", envFile, err) @@ -176,6 +171,11 @@ func runSoong(ctx Context, config Config) { "-f", filepath.Join(config.SoongOutDir(), file)) cmd.Environment.Set("SOONG_OUTDIR", config.SoongOutDir()) + if os.Getenv("SOONG_DELVE") != "" { + // SOONG_DELVE is already in cmd.Environment + cmd.Environment.Set("SOONG_DELVE_PATH", shared.ResolveDelveBinary()) + } + cmd.Sandbox = soongSandbox cmd.RunAndStreamOrFatal() } |