diff options
author | Jian Cai <jiancai@google.com> | 2020-09-18 14:20:02 -0700 |
---|---|---|
committer | Jian Cai <jiancai@google.com> | 2020-09-18 23:30:49 +0000 |
commit | 9ba2a4f453e3a5b5d35006e6bf72bc94b02fd5b0 (patch) | |
tree | cfa6f833630e225611e94c88b43ae46b9086d4f8 | |
parent | 7b73dcd8392259b7c67316d09c7bb799429f9a69 (diff) | |
download | toolchain-utils-9ba2a4f453e3a5b5d35006e6bf72bc94b02fd5b0.tar.gz |
compiler_wrapper: search compiler executable in $PATH
Search the compiler executable in the directories named by PATH
environment variable and add its parent directory as PYTHONPATH to
locate bisect_driver.py
BUG=chromium:1121018
TEST=verified locally
Change-Id: If1c397bedfc03b929d73ae490c1bb8f11b4edea5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2415130
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Jian Cai <jiancai@google.com>
-rw-r--r-- | compiler_wrapper/bisect_flag.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler_wrapper/bisect_flag.go b/compiler_wrapper/bisect_flag.go index f07d9a63..adfa8b03 100644 --- a/compiler_wrapper/bisect_flag.go +++ b/compiler_wrapper/bisect_flag.go @@ -7,6 +7,7 @@ package main import ( "errors" "os" + "os/exec" "path/filepath" ) @@ -52,7 +53,7 @@ func calcBisectCommand(env env, cfg *config, bisectStage string, compilerCmd *co } } absCompilerPath := getAbsCmdPath(env, compilerCmd) - pythonPath, err := filepath.Abs(os.Args[0]) + pythonPath, err := exec.LookPath(os.Args[0]) if err != nil { return nil, err } |