intellij icon indicating copy to clipboard operation
intellij copied to clipboard

superfluous errors "no such target..." on incremental sync

Open cnsgsz opened this issue 1 year ago • 3 comments

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 avatar Feb 29 '24 18:02 cnsgsz

@cnsgsz Could you please provide complete steps to reproduce this issue?

iancha1992 avatar Feb 29 '24 20:02 iancha1992

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

srdo avatar Mar 04 '24 22:03 srdo

Some errors still occur

image

tpasternak avatar Apr 03 '24 09:04 tpasternak