aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/bisect_flag.go
diff options
context:
space:
mode:
Diffstat (limited to 'compiler_wrapper/bisect_flag.go')
-rw-r--r--compiler_wrapper/bisect_flag.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler_wrapper/bisect_flag.go b/compiler_wrapper/bisect_flag.go
index 6271e23f..8aec3e7e 100644
--- a/compiler_wrapper/bisect_flag.go
+++ b/compiler_wrapper/bisect_flag.go
@@ -6,6 +6,7 @@ package main
import (
"errors"
+ "os"
"path/filepath"
)
@@ -51,6 +52,15 @@ func calcBisectCommand(env env, cfg *config, bisectStage string, compilerCmd *co
}
}
absCompilerPath := getAbsCmdPath(env, compilerCmd)
+ pythonPath, err := filepath.Abs(os.Args[0])
+ if err != nil {
+ return nil, err
+ }
+ pythonPath, err = filepath.EvalSymlinks(pythonPath)
+ if err != nil {
+ return nil, err
+ }
+ pythonPath = filepath.Dir(pythonPath)
return &command{
Path: "/usr/bin/env",
Args: append([]string{
@@ -61,6 +71,6 @@ func calcBisectCommand(env env, cfg *config, bisectStage string, compilerCmd *co
bisectDir,
absCompilerPath,
}, compilerCmd.Args...),
- EnvUpdates: compilerCmd.EnvUpdates,
+ EnvUpdates: append(compilerCmd.EnvUpdates, "PYTHONPATH="+pythonPath),
}, nil
}