When I invoke a Bazel command and there are analysis errors, it only displays one of them. For example:
ERROR: /Users/oliver/src/github.com/monzo/wearedev/service.transaction-enrichment/handler/BUILD.bazel:3:1: target '//service.personal-account-signup/domain:go_default_library' is not visible from target '//service.transaction-enrichment/handler:go_default_library'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /Users/oliver/src/github.com/monzo/wearedev/service.transaction-enrichment/handler/BUILD.bazel:3:1: target '//service.prepaid-bridge/domain:go_default_library' is not visible from target '//service.transaction-enrichment/handler:go_default_library'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: Analysis of target '//service.transaction-enrichment/handler:go_default_test' failed; build aborted: Analysis of target '//service.transaction-enrichment/handler:go_default_library' failed; build aborted
INFO: Elapsed time: 1.049s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
When I go and fix this specific visibility problem and re-run the command, I might see a new analysis error.
Does Bazel stop analysing when it encounters an error? Is there a way to get it to display all analysis errors to avoid needing to repeatedly run a command to flush out each error serially?
To be clear, the command I'm running is trying to build multiple targets, several of which fail to analyse. Even if it's only possible to output a single error per-target, is there a way to get it to at analyse all targets?
Isn't this what you are looking for? From CLI help (bazel help --long build
).
--[no]keep_going [-k] (a boolean; default: "false")
Continue as much as possible after an error. While the target that failed
and those that depend on it cannot be analyzed, other prerequisites of
these targets can be.
Tags: eagerness_to_exit
Not sure this applies to all scenarios, but I've mangled a target and instead of error got:
WARNING: errors encountered while analyzing target '//xxx:xxx': it will not be built
And went on to the other targets specified.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With