-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading to gazelle v0.18.1 requires a root BUILD file #609
Comments
This is admittedly a really confusing error message. Unfortunately, I can't think of a way to work around this without removing the whole feature. The issue is that The default configuration file is Maybe we could require users to set the label explicitly, opting into the new feature? I'm guessing most people won't though, so I'd prefer to keep this behavior the default if possible. Not having a root build file seems like a relatively rare case. |
sgtm, if its not easy to resolve then lets close. Thanks for the clarifications! |
this is causing a bit of friction as now all dependent projects need to add a BUILD file. A better error message would be awesome as it did take a couple of minutes for my head to jolt and remember the error message corresponded to a missing build file. We're updating our README in rules_docker to make this explicit, but I can imagine other repos will run into the same kind of friction. @laurentlb Do you think there is a better way to do this with Starlark so that the error message is clearer? |
Can you file a bug? We can look at it. |
created bazelbuild/bazel#9364, thanks! Closing here. |
@laurentlb If there were a way for a repository rule to resolve a file in the root of another workspace without requiring a build file to be present, that would avoid the error entirely. I don't think build files are completely loaded at the point where these repository rules are evaluated, so the content of the build files shouldn't matter. Is that a change that could be made in Bazel? I'd be happy to file an issue if it would be useful. |
Just to clarify, you use the label Reading the documentation of |
It needs to read the WORKSPACE file in the main workspace though, not the repository's own WORKSPACE file. We have an internal repository rule, |
cc @aehlig, any idea?
|
@laurentlb To be honest, I'm a bit surprised by that question, given that you recently handled an incompatible change that forces |
Has this been resolved? I think I'm running into the same issue now on a recent version of bazel-gazelle. |
I also run into the same issue, any updates? |
Hi,
Were updating our dependency on bazel-gazelle from rules_docker in this PR.
The update is failing as one of the projects we test with on CI does not have a BUILD file at the same level as the WORKSPACE file. .
The error is as follows:
Note the bit: Unable to load package for //:WORKSPACE: BUILD file not found in any of the following directories.
I am able to fix this error by simply adding an empty BUILD file at the same level as the WORKSPACE file.
I think that this PR is the one that added the dependency on
//:WORKSPACE
.While having this empty BUILD file is not problematic, the error messaging is quite confusing.
Sample PR with failing test: bazelbuild/rules_docker#1013
Sample PR with fix that adds empty BUILD file: bazelbuild/rules_docker#1045
The text was updated successfully, but these errors were encountered: