Skip to content
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

CLion plugin is incompatible to bazel flag incompatible_disable_target_provider_fields #4714

Open
martis42 opened this issue Apr 7, 2023 · 8 comments
Labels
lang: python Python rules integration P3 We're not considering working on this, but happy to review a PR. (No assignee) product: CLion CLion plugin topic: bazel Bazel integration (external repositories, aspects, flags, etc) type: bug

Comments

@martis42
Copy link

martis42 commented Apr 7, 2023

Description of the bug:

A Bazel project using incompatible_disable_target_provider_fields to make sure it is not by accident using deprecated behavior is not compatible to the CLion Bazel plugin.

Desired solution:
Changing the implementation to use the forward path pattern and then to use incompatible_disable_target_provider_fields in the CI to make sure the issue does not reappear until Bazel flips this flag in a future release.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Setup a Bazel project with CLion
  2. Create a .bazelrc file in the project and add --incompatible_disable_target_provider_fields
  3. Start a project sync

Exemplary error:

ERROR: <path_to_build_file>/BUILD:3:10: in @intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect aspect on py_binary rule //src/apply_fixes:main: 
Traceback (most recent call last):
	File "<path_into_cache>/e663c61e10a8ed8d3fb71670c233b37b/external/intellij_aspect/intellij_info_bundled.bzl", line 67, column 37, in _aspect_impl
		return intellij_info_aspect_impl(target, ctx, semantics)
	File "<path_into_cache>/e663c61e10a8ed8d3fb71670c233b37b/external/intellij_aspect/intellij_info_impl.bzl", line 1017, column 28, in intellij_info_aspect_impl
		direct_deps = make_deps(direct_dep_targets, COMPILE_TIME)
	File "<path_into_cache>/e663c61e10a8ed8d3fb71670c233b37b/external/intellij_aspect/intellij_info_impl.bzl", line 263, column 21, in make_deps
		return [make_dep(dep, dependency_type) for dep in deps]
	File "<path_into_cache>/e663c61e10a8ed8d3fb71670c233b37b/external/intellij_aspect/intellij_info_impl.bzl", line 258, column 21, in make_dep
		target = dep.intellij_info.target_key,
Error: Accessing providers via the field syntax on structs is deprecated and will be removed soon. It may be temporarily re-enabled by setting --incompatible_disable_target_provider_fields=false. See https://github.com/bazelbuild/bazel/issues/9014 for details.

Which Intellij IDE are you using? Please provide the specific version.

CLion 2023.1.1 Build #CL-231.8109.2222

What programming languages and tools are you using? Please provide specific versions.

Python 3.8, rules_python 0.8.0, bazel_skylib 1.4.1

What Bazel plugin version are you using?

2023.03.10.0.1-api-version-231

Have you found anything relevant by searching the web?

There are several automatically created issues which are closed without any comment:

Linked to the tracking issue for this incompatibility flag is this issue bazel-contrib/SIG-rules-authors#36. An existing bug bounty for resolving this is in my opinion a sign that the Bazel team indeed intends to flip this flag.

Any other information, logs, or outputs that you want to share?

To my knowledge flipping this flag (with an adapted implementation of course) is backwards compatible up until at least Bazel 4.0.0. I don't know what the status for even older versions is.

@ShreeM01 ShreeM01 added type: bug product: CLion CLion plugin topic: bazel Bazel integration (external repositories, aspects, flags, etc) awaiting-maintainer Awaiting review from Bazel team on issues labels Apr 7, 2023
@ShreeM01 ShreeM01 added the lang: python Python rules integration label Apr 7, 2023
@keertk keertk moved this from Not Started to Triaged in Bazel IntelliJ Plugin Apr 7, 2023
@tpasternak
Copy link
Collaborator

@mai93 same as here, do you know if Google team plans to work on it?

@tpasternak tpasternak added the P3 We're not considering working on this, but happy to review a PR. (No assignee) label Apr 20, 2023
@keertk keertk moved this from Triaged to Backlog in Bazel IntelliJ Plugin Apr 20, 2023
@mai93 mai93 assigned mai93 and unassigned tpasternak Apr 24, 2023
@mai93
Copy link
Collaborator

mai93 commented Apr 24, 2023

I just noticed that this required moving the minimum supported version of Bazel to be 4.0.0. I'm not sure how many users are still on older versions, we can discuss this in the SIG meeting

@mai93 mai93 removed the awaiting-maintainer Awaiting review from Bazel team on issues label Jul 7, 2023
@mai93 mai93 removed their assignment Jul 7, 2023
@martis42
Copy link
Author

@mai93 did you receive feedback in the SIC meeting? With the release of Bazel 7, Bazel 4 is now deprecated. I don't know your user base, but to me requiring at least Bazel 4.0.0 from users seems like a reasonable thing.

@mai93
Copy link
Collaborator

mai93 commented Dec 21, 2023

I think we already have Bazel 4.0.0 as the oldest supported Bazel version for a while now 8ec7779

@martis42
Copy link
Author

So this issue is unblocked then by now?
If and when somebody has time to fix this is of course a different question.

@mai93
Copy link
Collaborator

mai93 commented Dec 27, 2023

I think we will keep it at P3 for now, meaning that we do not have a plan to fix it but we can review PRs that address this.

Copy link

Thank you for contributing to the IntelliJ repository! This issue has been marked as stale since it has not had any activity in the last 6 months. It will be closed in the next 14 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Jun 28, 2024
@martis42
Copy link
Author

The issue is still relevant

@github-actions github-actions bot removed the stale Issues or PRs that are stale (no activity for 30 days) label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: python Python rules integration P3 We're not considering working on this, but happy to review a PR. (No assignee) product: CLion CLion plugin topic: bazel Bazel integration (external repositories, aspects, flags, etc) type: bug
Projects
Status: Backlog
Development

No branches or pull requests

4 participants