Skip to content
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

Bad syntax for proto_repository_tools_srcs.bzl #335

Open
ewhauser opened this issue Aug 1, 2023 · 3 comments
Open

Bad syntax for proto_repository_tools_srcs.bzl #335

ewhauser opened this issue Aug 1, 2023 · 3 comments

Comments

@ewhauser
Copy link
Contributor

ewhauser commented Aug 1, 2023

We occasionally run into the following issue:

ERROR: /home/runner/.cache/bazel/_bazel_runner/5c738117ebb090237e98e16aae223a35/external/build_stack_rules_proto/rules/private/proto_repository_tools_srcs.bzl:666:15: syntax error at 'newline': expected ]

It is unfortunately not easily reproduced. It often happens after a Bazel version upgrade. Once the repository gets in this state, only a bazel clean --expunge will let it recover. Interestingly, when you open that file, it is completely valid Starlark and the array is closed properly.

@ewhauser
Copy link
Contributor Author

ewhauser commented Aug 1, 2023

There is a difference between rules_proto and gazelle here. Gazelle is only checking to see if this list is up to date and rules_proto seems to be trying to generate the file in the action. Could it be that writing to the file while building is somehow corrupting?

https://github.com/stackb/rules_proto/blob/master/rules/private/proto_repository_tools.bzl#L72
https://github.com/bazelbuild/bazel-gazelle/blob/master/internal/go_repository_tools.bzl#L80

@ewhauser
Copy link
Contributor Author

ewhauser commented Aug 1, 2023

I was able to get this fixed for us by commented out L62-77 in a patch. Possible theory here is that updating this file while building causes a corruption and it gets cached remotely which is why it is non-deterministic.

@pcj
Copy link
Member

pcj commented Feb 17, 2024

I struggle with this occasionally as well. I have tried always enabling the -check but don't want to break users until it's sorted out.

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

No branches or pull requests

2 participants