eclipse icon indicating copy to clipboard operation
eclipse copied to clipboard

object of type 'Target' has no field 'intellij_info_files'

Open brychcy opened this issue 6 years ago • 4 comments

While trying to setup an eclipse workspace for bazel according to https://bazel.build/contributing.html, an error is reported in the console and the Bazel Classpath Container is not initialized.: [...] File "/private/var/tmp/_bazel_till/1bf5324772cb2353440eae7781088d92/external/local_eclipse_aspect/e4b_aspect.bzl", line 96, in _aspect_impl dep.intellij_info_files object of type 'Target' has no field 'intellij_info_files' [...]

I'll send a PR that adds a check if the attribute exists

brychcy avatar Apr 24 '18 07:04 brychcy

I am not sure how this happens, can you give a bit more of the error message?

It sounds like a deeper problem to me.

damienmg avatar Apr 24 '18 08:04 damienmg

As requested, the whole error message:

*** Running /Users/till/homebrew/brew/bin/bazel build --watchfs --override_repository=local_eclipse_aspect=/Users/till/Applications/Eclipse4.8I20180327-2000.app/Contents/Eclipse/../../../../opensource/bazelbuild/eclipse/resources --aspects=@local_eclipse_aspect//:e4b_aspect.bzl%e4b_aspect -k --output_groups=ide-info-text,ide-resolve,-_,-defaults --experimental_show_artifacts //src/test/java/... //src/main/java/... from /Users/till/opensource/bazelbuild/bazel ***
Loading: 
Loading: 0 packages loaded
ERROR: /Users/till/opensource/bazelbuild/bazel/src/test/java/com/google/devtools/build/android/desugar/BUILD:743:1: in @local_eclipse_aspect//:e4b_aspect.bzl%e4b_aspect aspect on java_library rule //src/test/java/com/google/devtools/build/android/desugar:testdata_java8_like_in_android_studio: 
Traceback (most recent call last):
	File "/Users/till/opensource/bazelbuild/bazel/src/test/java/com/google/devtools/build/android/desugar/BUILD", line 743
		@local_eclipse_aspect//:e4b_aspect.bzl%e4b_aspect(...)
	File "/private/var/tmp/_bazel_till/1bf5324772cb2353440eae7781088d92/external/local_eclipse_aspect/e4b_aspect.bzl", line 96, in _aspect_impl
		dep.intellij_info_files
object of type 'Target' has no field 'intellij_info_files'
ERROR: /Users/till/opensource/bazelbuild/bazel/src/test/java/com/google/devtools/build/android/desugar/BUILD:732:1: in @local_eclipse_aspect//:e4b_aspect.bzl%e4b_aspect aspect on java_library rule //src/test/java/com/google/devtools/build/android/desugar:testdata_like_in_android_studio: 
Traceback (most recent call last):
	File "/Users/till/opensource/bazelbuild/bazel/src/test/java/com/google/devtools/build/android/desugar/BUILD", line 732
		@local_eclipse_aspect//:e4b_aspect.bzl%e4b_aspect(...)
	File "/private/var/tmp/_bazel_till/1bf5324772cb2353440eae7781088d92/external/local_eclipse_aspect/e4b_aspect.bzl", line 96, in _aspect_impl
		dep.intellij_info_files
object of type 'Target' has no field 'intellij_info_files'
Analyzing: 563 targets (0 packages loaded)
INFO: Analysed 563 targets (2 packages loaded).
INFO: Found 563 targets...
[0 / 1] [-----] BazelWorkspaceStatusAction stable-status.txt
Build artifacts:
ERROR: command succeeded, but not all targets were analyzed
INFO: Elapsed time: 2.417s, Critical Path: 0.03s
FAILED: Build did NOT complete successfully

brychcy avatar Apr 24 '18 08:04 brychcy

I added some logging to find out which targets don't have the intellij_info_files attribute:

DEBUG: /private/var/tmp/_bazel_till/1bf5324772cb2353440eae7781088d92/external/local_eclipse_aspect/e4b_aspect.bzl:100:12: NO intellij_info_files on: <output file target //src/test/java/com/google/devtools/build/android/desugar:libseparate.jar>
DEBUG: /private/var/tmp/_bazel_till/1bf5324772cb2353440eae7781088d92/external/local_eclipse_aspect/e4b_aspect.bzl:100:12: NO intellij_info_files on: <output file target //src/test/java/com/google/devtools/build/android/desugar:libseparate.jar>
DEBUG: /private/var/tmp/_bazel_till/1bf5324772cb2353440eae7781088d92/external/local_eclipse_aspect/e4b_aspect.bzl:100:12: NO intellij_info_files on: <output file target //src/test/java/com/google/devtools/build/android/desugar:libseparate_java8.jar>

brychcy avatar Apr 24 '18 08:04 brychcy

Ah ok make sense, the deps point to a .jar output artifact. The PR is ok to work around but it would be better to have a proper fix in the long time.

damienmg avatar Apr 24 '18 08:04 damienmg