Skip to content

Conversation

@jgautier-dd
Copy link
Contributor

In tools that run bazel commands from within bazel run the BUILD_WORKSPACE_DIRECTORY will be set and then in this code 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 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

@CLAassistant
Copy link

CLAassistant commented Jul 28, 2025

CLA assistant check
All committers have signed the CLA.

@ghost ghost changed the title pass in the repo root for the 'dir' argument Pass in the repo root for the 'dir' argument Aug 22, 2025
@ghost ghost changed the title Pass in the repo root for the 'dir' argument Fix: pass in the repo root for the 'dir' argument Aug 22, 2025
@ghost ghost merged commit a3128f1 into bufbuild:main Aug 22, 2025
4 of 5 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants