bazel: Regression in 3.5.0RC1: external repo with malformed WORKSPACE causes spurious errors
Description of the problem / feature request:
In the WORKSPACE file we have git_repository rule which pulls in another git repo. That git repo happens to have its own WORKSPACE file which is very old and is not correct for the recent versions of Bazel. Up until Bazel 3.4.1 that secondary WORKSPACE was rightfully completely ignored. Starting with the Bazel 3.5.0RC1 external WORKSPACE file seems to be analyzed for some reason and causes build errors.
Feature requests: what underlying problem are you trying to solve with this feature?
Accordingly to the docs only the primary WORKSPACE matters, all others should be ignored.
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Use git_repository to pull several years old com_google_protobuf. Its workspace file would not be correct from the recent Bazel point of view and cause errors, while it should be ignored.
What operating system are you running Bazel on?
Linux, Mac, Windows
What’s the output of bazel info release
?
3.5.0RC1
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (21 by maintainers)
Commits related to this issue
- Stop needlessly parsing WORKSPACE files from external repositories. Fixes: https://github.com/bazelbuild/bazel/issues/11936 I have an additional test to prove the spurious error message is gone and ... — committed to bazelbuild/bazel by aiuto 4 years ago
- Stop needlessly parsing WORKSPACE files from external repositories. Fixes: https://github.com/bazelbuild/bazel/issues/11936 I have an additional test to prove the spurious error message is gone and ... — committed to bazelbuild/bazel by aiuto 4 years ago
- Stop needlessly parsing WORKSPACE files from external repositories. Fixes: https://github.com/bazelbuild/bazel/issues/11936 I have an additional test to prove the spurious error message is gone and ... — committed to michaeleisel/bazel by aiuto 4 years ago
- Stop needlessly parsing WORKSPACE files from external repositories. Fixes: https://github.com/bazelbuild/bazel/issues/11936 I have an additional test to prove the spurious error message is gone and ... — committed to bazelbuild/bazel by aiuto 4 years ago
- Stop needlessly parsing WORKSPACE files from external repositories. Fixes: https://github.com/bazelbuild/bazel/issues/11936 I have an additional test to prove the spurious error message is gone and ... — committed to bazelbuild/bazel by aiuto 4 years ago
- Stop needlessly parsing WORKSPACE files from external repositories. Fixes: https://github.com/bazelbuild/bazel/issues/11936 I have an additional test to prove the spurious error message ... — committed to luca-digrazia/DatasetCommitsDiffSearch by deleted user 2 years ago
I think we have a handle on the problem so we are going to try to fix forward and remove the unneeded parsing of the workspace. I have some tests I can try on Monday.
Could we revert to the previous behavior (for now) and ask @philwo’s team to investigate why WORKSPACE files are loaded?
@aiuto Here is what you asked for: https://github.com/Bazel-snippets/repro_11936 Secondary WORKSPACE file only contains the word
garbage
.Despite the error the second build claims it is successful, so @michajlo is probably right that
workspaces were always being analyzed but errors were ignored and/or lost until now