Skip to content

[IDE integration] code not resolving under "transitive" mode #1359

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

Open
wisechengyi opened this issue Feb 19, 2022 · 1 comment
Open

[IDE integration] code not resolving under "transitive" mode #1359

wisechengyi opened this issue Feb 19, 2022 · 1 comment

Comments

@wisechengyi
Copy link
Contributor

wisechengyi commented Feb 19, 2022

I have created a minimal repro at https://github.com/bazelbuild/rules_scala/pull/1358/files

3 targets: a -> b -> c. Temporarily setting the following for scala toolchain to show the point.

--- a/scala/BUILD
+++ b/scala/BUILD
@@ -23,7 +23,8 @@ toolchain(
 
 scala_toolchain(
     name = "unused_dependency_checker_error_toolchain_impl",
-    unused_dependency_checker_mode = "error",
+    unused_dependency_checker_mode = "off",
+    dependency_mode = "transitive",
     visibility = ["//visibility:public"],
 )

When importingtmp/src/scala/a into intellij with the bazel plugin:

directories:
  tmp/src/scala/a

# Automatically includes all relevant targets under the 'directories' above
derive_targets_from_directories: true

targets:
  # If source code isn't resolving, add additional targets that compile it here

additional_languages:
  scala

Screen Shot 2022-02-18 at 5 03 26 PM

You can see that B can resolve correct, but C fails to resolve.

So was wondering if it's a rules_scala issue that it fails to let bazel plugin's aspect know about C, or a bazel plugin issue for asking for too little?

References

  • Importing tmp/src/scala would have C resolved.
  • building aworks just fine:
% bazel build tmp/src/scala/a
DEBUG: /private/var/tmp/_bazel_yic/2ceecb63e72239e50b9654ebbc6f2a73/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14: 
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
DEBUG: /private/var/tmp/_bazel_yic/2ceecb63e72239e50b9654ebbc6f2a73/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:125:14: buildkite_config not using checked in configs; Bazel version 4.1.0 was picked/selected but no checked in config was found in map {"0.20.0": ["8.0.0"], "0.21.0": ["8.0.0"], "0.22.0": ["8.0.0", "9.0.0"], "0.23.0": ["8.0.0", "9.0.0"], "0.23.1": ["8.0.0", "9.0.0"], "0.23.2": ["9.0.0"], "0.24.0": ["9.0.0"], "0.24.1": ["9.0.0"], "0.25.0": ["9.0.0"], "0.25.1": ["9.0.0"], "0.25.2": ["9.0.0"], "0.26.0": ["9.0.0"], "0.26.1": ["9.0.0"], "0.27.0": ["9.0.0"], "0.27.1": ["9.0.0"], "0.28.0": ["9.0.0"], "0.28.1": ["9.0.0"], "0.29.0": ["9.0.0"], "0.29.1": ["9.0.0", "10.0.0"], "1.0.0": ["9.0.0", "10.0.0"], "1.0.1": ["10.0.0"], "1.1.0": ["10.0.0"], "1.2.0": ["10.0.0"], "1.2.1": ["10.0.0"], "2.0.0": ["10.0.0"], "2.1.0": ["10.0.0"], "2.1.1": ["10.0.0", "11.0.0"], "2.2.0": ["11.0.0"], "3.0.0": ["11.0.0"], "3.1.0": ["11.0.0"], "3.2.0": ["11.0.0"], "3.3.0": ["11.0.0"], "3.3.1": ["11.0.0"], "3.4.1": ["11.0.0"], "3.5.0": ["11.0.0"], "3.5.1": ["11.0.0"], "3.6.0": ["11.0.0"], "3.7.0": ["11.0.0"], "3.7.1": ["11.0.0"], "3.7.2": ["11.0.0"], "4.0.0": ["11.0.0"]}
INFO: Analyzed target //tmp/src/scala/a:a (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //tmp/src/scala/a:a up-to-date:
  bazel-bin/tmp/src/scala/a/a.jar
INFO: Elapsed time: 0.240s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
@wisechengyi
Copy link
Contributor Author

Seems known at bazelbuild/intellij#1825 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant