intellij
intellij copied to clipboard
superfluous errors "no such target..." on incremental sync
Description of the bug:
ERROR: Skipping '//:.bazelrc': no such target '//:.bazelrc': target '.bazelrc' not declared in package '' defined by /home/swang/CLionProjects/moffett/BUILD; however, a source file of this name exists. (Perhaps add 'exports_files([".bazelrc"])' to /BUILD?) ERROR: Skipping '//:.bazelversion': no such target '//:.bazelversion': target '.bazelversion' not declared in package '' defined by /home/swang/CLionProjects/moffett/BUILD; however, a source file of this name exists. (Perhaps add 'exports_files([".bazelversion"])' to /BUILD?) ERROR: Skipping '//:README.md': no such target '//:README.md': target 'README.md' not declared in package '' defined by /home/swang/CLionProjects/moffett/BUILD; however, a source file of this name exists. (Perhaps add 'exports_files(["README.md"])' to /BUILD?) ERROR: Skipping '//:WORKSPACE': no such target '//:WORKSPACE': target 'WORKSPACE' not declared in package '' defined by /home/swang/CLionProjects/moffett/BUILD; however, a source file of this name exists. (Perhaps add 'exports_files(["WORKSPACE"])' to /BUILD?)
It does not seem to affect the syncing of other targets, but it would be nice to not show these non-existent targets as errors.
Which category does this issue belong to?
CLion
@cnsgsz Could you please provide complete steps to reproduce this issue?
We had this issue too. As far as we could tell, it's happening because the VCS scan that happens by default during a sync tells the plugin to include files that aren't Bazel targets.
It would be nice if this could be fixed, but a workaround is to disable the VCS scan, by disabling the feature described at https://ij.bazel.build/docs/bazel-plugin.html#expand-sync-to-working-set
Some errors still occur