From 3eb214b2a35b072fdca5c3a75945a0f79462f0af Mon Sep 17 00:00:00 2001 From: Tyler Williams Date: Mon, 10 Jun 2024 14:53:32 -0700 Subject: [PATCH] Always set KYTHE_DIR env var --- enterprise/server/cmd/ci_runner/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/enterprise/server/cmd/ci_runner/main.go b/enterprise/server/cmd/ci_runner/main.go index e77c9b9d32e..e036f889302 100644 --- a/enterprise/server/cmd/ci_runner/main.go +++ b/enterprise/server/cmd/ci_runner/main.go @@ -265,6 +265,9 @@ func provisionArtifactsDir(ws *workspace, bazelCommandIndex int) error { func provisionKythe(ctx context.Context, ws *workspace) error { kytheRootPath := filepath.Join(ws.rootDir, kytheDirName) + if err := os.Setenv(kytheDirEnvVarName, kytheRootPath); err != nil { + return err + } if _, err := os.Stat(kytheRootPath); err == nil { return nil // dir already exists; we're done. } @@ -276,9 +279,6 @@ func provisionKythe(ctx context.Context, ws *workspace) error { if err := runCommand(ctx, "bash", args, nil /*=env*/, "" /*=dir*/, ws.log); err != nil { return err } - if err := os.Setenv(kytheDirEnvVarName, kytheRootPath); err != nil { - return err - } return nil }