File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ A brief description of the categories of changes:
63
63
dependencies improving initial build times involving external dependency
64
64
fetching.
65
65
66
+ * (gazelle) Improve runfiles lookup hermeticity.
67
+
66
68
## [ 0.25.0] - 2023-08-22
67
69
68
70
### Changed
Original file line number Diff line number Diff line change @@ -38,13 +38,20 @@ var (
38
38
)
39
39
40
40
func startParserProcess (ctx context.Context ) {
41
- parseScriptRunfile , err := runfiles .Rlocation ("rules_python_gazelle_plugin/python/parse" )
41
+ rfiles , err := runfiles .New ()
42
+ if err != nil {
43
+ log .Printf ("failed to create a runfiles object: %v\n " , err )
44
+ os .Exit (1 )
45
+ }
46
+
47
+ parseScriptRunfile , err := rfiles .Rlocation ("rules_python_gazelle_plugin/python/parse" )
42
48
if err != nil {
43
49
log .Printf ("failed to initialize parser: %v\n " , err )
44
50
os .Exit (1 )
45
51
}
46
52
47
53
cmd := exec .CommandContext (ctx , parseScriptRunfile )
54
+ cmd .Env = append (os .Environ (), rfiles .Env ()... )
48
55
49
56
cmd .Stderr = os .Stderr
50
57
Original file line number Diff line number Diff line change 39
39
func startStdModuleProcess (ctx context.Context ) {
40
40
stdModulesSeen = make (map [string ]struct {})
41
41
42
- stdModulesScriptRunfile , err := runfiles .Rlocation ("rules_python_gazelle_plugin/python/std_modules" )
42
+ rfiles , err := runfiles .New ()
43
+ if err != nil {
44
+ log .Printf ("failed to create a runfiles object: %v\n " , err )
45
+ os .Exit (1 )
46
+ }
47
+
48
+ stdModulesScriptRunfile , err := rfiles .Rlocation ("rules_python_gazelle_plugin/python/std_modules" )
43
49
if err != nil {
44
50
log .Printf ("failed to initialize std_modules: %v\n " , err )
45
51
os .Exit (1 )
@@ -49,7 +55,8 @@ func startStdModuleProcess(ctx context.Context) {
49
55
50
56
cmd .Stderr = os .Stderr
51
57
// All userland site-packages should be ignored.
52
- cmd .Env = []string {"PYTHONNOUSERSITE=1" }
58
+ cmd .Env = append ([]string {"PYTHONNOUSERSITE=1" }, rfiles .Env ()... )
59
+
53
60
stdin , err := cmd .StdinPipe ()
54
61
if err != nil {
55
62
log .Printf ("failed to initialize std_modules: %v\n " , err )
You can’t perform that action at this time.
0 commit comments