Commit a3128f1
Fix: pass in the repo root for the 'dir' argument (#119)
In tools that run bazel commands from within `bazel run` the
`BUILD_WORKSPACE_DIRECTORY` will be set and then in this
[code](https://github.com/bazel-contrib/bazel-gazelle/blob/master/cmd/gazelle/fix-update.go#L122-L139)
the directory will eventually be set to the top level repo root. An
example of a tool that this can happen to is the
[gopackagesdriver](https://github.com/bazel-contrib/rules_go/wiki/Editor-setup)
in rules_go.
This results in error messages like:
```
no such package '@@rules_buf++buf+buf_deps//buf/validate': failed with code: 1, error: gazelle: .: not a subdirectory of repo root
```
By passing in additional argument it explicitly sets the `dir` to the
directory of the repo. Gazelle itself does something
[similar](https://github.com/bazel-contrib/bazel-gazelle/blob/6803436a9c39209bd56ea1dba2dddda323a3c98b/internal/go_repository.bzl#L363)
Co-authored-by: jchadwick-buf <[email protected]>1 parent 8bdf33e commit a3128f1
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
0 commit comments