-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
target_compatible_with
failing with analysis_test
#12366
Comments
Looking at this now. |
philsc
added a commit
to philsc/bazel
that referenced
this issue
Oct 28, 2020
In bazelbuild#12366, Keith Smiley (@keith) reported that he was having trouble using the new `target_compatible_with` attribute in `rules_swift`. Specifically, setting it on an `analysistest` test target was giving him the following error: ERROR: /workdir/test/BUILD:13:29: in coverage_xcode_prefix_map_test rule //test:coverage_settings_xcode_prefix_map: rules with analysis_test=true must return an instance of AnalysisTestResultInfo ERROR: Analysis of target '//test:coverage_settings_xcode_prefix_map' failed; build aborted: Analysis of target '//test:coverage_settings_xcode_prefix_map' failed This was caused by the fact that for incompatible targets we create a dummy `ConfiguredTarget` that only provides the bare minimum to make the rest of bazel happy before it gets skipped. It turns out that `analysistest` rules have additional checks that need to be satisfied. This patch aims to satisfy those additional checks without impacting functionality.
philsc
added a commit
to philsc/bazel
that referenced
this issue
Oct 28, 2020
In bazelbuild#12366, Keith Smiley (@keith) reported that he was having trouble using the new `target_compatible_with` attribute in `rules_swift`. Specifically, setting it on an `analysistest` test target was giving him the following error: ERROR: /workdir/test/BUILD:13:29: in coverage_xcode_prefix_map_test rule //test:coverage_settings_xcode_prefix_map: rules with analysis_test=true must return an instance of AnalysisTestResultInfo ERROR: Analysis of target '//test:coverage_settings_xcode_prefix_map' failed; build aborted: Analysis of target '//test:coverage_settings_xcode_prefix_map' failed This was caused by the fact that for incompatible targets we create a dummy `ConfiguredTarget` that only provides the bare minimum to make the rest of bazel happy before it gets skipped. It turns out that `analysistest` rules have additional checks that need to be satisfied. This patch aims to satisfy those additional checks without impacting functionality. Fixes bazelbuild#12366
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the new
target_compatible_with
feature with ananalysis_test
fails with this error on incompatible platforms:https://buildkite.com/bazel/rules-swift-swift/builds/1980#af8b4f17-01b9-4e2d-99d0-93ef5abc6203
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Example failure here for a test that is only compatible with macOS, and therefore fails with the above error on Linux bazelbuild/rules_swift#514
Flipping the
target_compatible_with
condition to only support Linux also makes it fail the same way on macOS.What operating system are you running Bazel on?
macOS / Linux
What's the output of
bazel info release
?If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.USE_BAZEL_VERSION=last_green
with bazeliskThe text was updated successfully, but these errors were encountered: