Closed vorburger closed 7 months ago
What happens when you run bazel query //...
?
What happens when you run
bazel query //...
?
@achew22 this happens, as far as I can tell that works just fine:
$ bazel query //...
//cli:enola
//cli:src/test/java/dev/enola/cli/ClasspathHellDuplicatesCheckerTest
//cli:src/test/java/dev/enola/cli/EnolaTest
//cli:src/test/java/dev/enola/cli/SystemOutErrCaptureTest
//common/common:common
//common/common:src/test/java/dev/enola/common/io/mediatype/MediaTypeDetectorTest
//common/common:src/test/java/dev/enola/common/io/mediatype/MediaTypesTest
//common/common:src/test/java/dev/enola/common/io/resource/ClasspathUrlResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/EmptyResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/ErrorResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/FileDescriptorResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/FileResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/HttpUrlResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/MemoryResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/NullResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/ReplacingResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/ResourceProvidersTest
//common/common:src/test/java/dev/enola/common/io/resource/StringResourceTest
//common/common:src/test/java/dev/enola/common/io/resource/URIsTest
//common/common:src/test/java/dev/enola/common/protobuf/ProtobufMediaTypesTest
//common/markdown:markdown
//common/markdown:src/test/java/dev/enola/common/markdown/exec/ExecMDTest
//common/markdown:src/test/java/dev/enola/common/markdown/exec/RunnerTest
//common/protobuf:protobuf
//common/protobuf:src/test/java/dev/enola/common/protobuf/MessageValidatorTest
//common/protobuf:src/test/java/dev/enola/common/protobuf/ProtoIOTest
//common/protobuf:validation_proto
//common/protobuf:validation_proto_java_library
//common/yamljson:src/test/java/dev/enola/common/yamljson/YamlJsonTest
//common/yamljson:yamljson
//connectors/demo:demo
//connectors/demo:demo_java_proto
//connectors/demo:demo_proto
//connectors/demo:src/test/java/dev/enola/demo/ServerTest
//connectors/k8s:enola-k8s
//core/impl:impl
//core/impl:src/test/java/dev/enola/core/EntityServiceProviderTest
//core/impl:src/test/java/dev/enola/core/EntityTest
//core/impl:src/test/java/dev/enola/core/grpc/EnolaGrpcServerTest
//core/impl:src/test/java/dev/enola/core/iri/URITemplateMatcherChainTest
//core/impl:src/test/java/dev/enola/core/iri/URITemplatePatternizerTest
//core/impl:src/test/java/dev/enola/core/iri/URITemplateTest
//core/impl:src/test/java/dev/enola/core/meta/EntityKindRepositoryTest
//core/impl:src/test/java/dev/enola/core/meta/EntityKindValidationsTest
//core/impl:src/test/java/dev/enola/core/meta/SchemaAspectTest
//core/impl:src/test/java/dev/enola/core/meta/TypeRegistryWrapperTest
//core/impl:src/test/java/dev/enola/core/meta/docgen/MarkdownDocGeneratorTest
//core/impl:src/test/java/dev/enola/core/meta/docgen/StringUtilTest
//core/impl:src/test/java/dev/enola/core/tbd/RosettaTest
//core/lib:connector_go_proto
//core/lib:connector_java_grpc
//core/lib:connector_proto
//core/lib:core_buf_proto_lint
//core/lib:core_go_proto
//core/lib:core_java_grpc
//core/lib:core_java_proto
//core/lib:core_proto
//core/lib:core_proto_doc
//core/lib:lib_java
//core/lib:meta_go_proto
//core/lib:meta_proto
//core/lib:src/test/java/dev/enola/core/ERITest
//core/lib:src/test/java/dev/enola/core/IDsTest
//core/lib:util_go_proto
//core/lib:util_proto
//tools/hello:hello
//web/api:api
//web/rest:rest
//web/rest:src/test/java/dev/enola/web/rest/RestTest
//web/sun:src/test/java/dev/enola/web/sun/test/SunServerTest
//web/sun:sun
//web/ui-soy:src/test/java/dev/enola/web/ui/SoyTest
//web/ui-soy:src/test/java/dev/enola/web/ui/UiTest
//web/ui-soy:ui-soy
Loading: 0 packages loaded
NB also, as above, just to make sure it wasn't overlooked:
$ bazel query --output=build //...
...
see https://gist.github.com/vorburger/8868ecae9418d8bfe16cdeb9c3bcbbb9
Yeah, I took a look at the link and misread it. You had a code fence, ``, at the bottom which I misinterpreted as a
...` thinking you'd truncated the results.
Next up is to run a couple more queries and see where it failed.
bazel query "kind('source file', deps(set(//...)))"
and
bazel query "buildfiles(deps(set(//...)))"
If those don't break then I'm officially perplexed and we'll need to build a patched binary with more debugging to figure out what's going on. Not sure what kind of patch yet, but a thing to be aware of
As suggested above:
$ git clone https://github.com/enola-dev/enola.git && cd enola
$ git checkout 5383cf9
$ bazelisk query "kind('source file', deps(set(//...)))"
Starting local Bazel server and connecting to it...
INFO: Repository bazel_tools~remote_coverage_tools_extension~remote_coverage_tools instantiated at:
callstack not available
Repository rule http_archive defined at:
/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
INFO: Repository rules_license~0.0.7 instantiated at:
callstack not available
Repository rule http_archive defined at:
/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
INFO: Repository protoc_gen_buf_lint_darwin_x86_64 instantiated at:
/home/vorburger/git/github.com/enola-dev/enola/WORKSPACE.bazel:70:27: in <toplevel>
/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_proto_grpc/buf/repositories.bzl:20:38: in buf_repos
/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_proto_grpc/repositories.bzl:527:24: in protoc_gen_buf_lint_darwin_x86_64
/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/rules_proto_grpc/repositories.bzl:409:22: in _generic_dependency
Repository rule http_file defined at:
/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/bazel_tools/tools/build_defs/repo/http.bzl:466:28: in <toplevel>
ERROR: Evaluation of subquery "deps(set(//...))" failed (did you want to use --keep_going?): preloading transitive closure failed: no such package '@com_google_protobuf_javalite//': The repository '@com_google_protobuf_javalite' could not be resolved: Repository '@com_google_protobuf_javalite' is not defined
Loading: 61 packages loaded
currently loading: @bazel_tools//third_party/zlib
Fetching https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.6.zip
Fetching https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz
Fetching https://github.com/bufbuild/buf/releases/download/v1.9.0/protoc-gen-buf-lint-Darwin-x86_64
as well as:
$ bazelisk query "buildfiles(deps(set(//...)))"
INFO: Repository bazel_tools~remote_coverage_tools_extension~remote_coverage_tools instantiated at:
callstack not available
Repository rule http_archive defined at:
/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
ERROR: Evaluation of subquery "deps(set(//...))" failed (did you want to use --keep_going?): preloading transitive closure failed: no such package '@com_google_protobuf_javalite//': The repository '@com_google_protobuf_javalite' could not be resolved: Repository '@com_google_protobuf_javalite' is not defined
Loading: 7 packages loaded
Fetching https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.6.zip
Aha! I may have a bit of a mess around this in my project, so this helps me to dig in more (some other day, not now); it's something related to:
ERROR: Evaluation of subquery "deps(set(//...))" failed (did you want to use --keep_going?): preloading transitive closure failed: no such package '@com_google_protobuf_javalite//': The repository '@com_google_protobuf_javalite' could not be resolved: Repository '@com_google_protobuf_javalite' is not defined
binary with more debugging to figure out what's going on. Not sure what kind of patch yet, but a thing to be aware of
Yeah, so perhaps ibazel
could be improved to not "swallow" this (above) kind of failures, and show them to a user, and exit? How would you like to proceed? I'm happy to close this issue, as a "problem in my project and not ibazel", now that it's clearer - and perhaps you can use #642 about such an enhancement?
BTW it's also slightly strange to me as a user that I can build the project without the problem (above), but need to fix it to be able to use the watcher - but that's probably due to design details which are much harder to change, and it needs this.
Stale issue message
Describe the bug Bazel Watcher seems to be broken for https://github.com/enola-dev/enola.
The root cause appears to be something about
Error querying for source files: exit status 7
.Reproduction instructions Steps to reproduce the behavior:
git clone https://github.com/enola-dev/enola
cd enola
git checkout c87a80e027852d31ad4219813d281d9bede1c6b2
ibazel test //...
//common/common/src/main/java/dev/enola/common/io/resource/FileResource.java
to have a smiley face at the topExpected behavior It should fail to build the Java file with the smiley face at the top? 🤣
Actual behavior Nothing, the change is ignored. It's because of these errors at start-up:
bazel query --output=build //path/to:target
If your issue is about a specific target in your system working, Please include the output ofbazel query --output=build //path/to:target
,see https://gist.github.com/vorburger/8868ecae9418d8bfe16cdeb9c3bcbbb9
Version (please complete the following information):
Additional context It also seems weird (to me) that those Bazel query failed problems don't cause
ibazel
to "give up" and fail with a non-0 exit code. But let's keep this issue for fixing this specific actual problem - I'll file another issue for the general "exit if Bazel query failed fatally (exit status 7)".