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

Prepare {java|jvm}_import_external for --incompatible_load_java_rules_from_bzl option flip #10046

Closed
davido opened this issue Oct 16, 2019 · 3 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-Java Issues for Java rules

Comments

@davido
Copy link
Contributor

davido commented Oct 16, 2019

See #8746 for details.

@jin jin added team-Rules-Java Issues for Java rules untriaged labels Oct 16, 2019
@iirina iirina added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Oct 17, 2019
@iirina
Copy link
Contributor

iirina commented Oct 17, 2019

cc @jin

@ghost
Copy link

ghost commented Dec 12, 2019

Does this boil down to the following patch?

diff --git a/tools/build_defs/repo/jvm.bzl b/tools/build_defs/repo/jvm.bzl
index 9fb1229641..b15dd5606a 100644
--- a/tools/build_defs/repo/jvm.bzl
+++ b/tools/build_defs/repo/jvm.bzl
@@ -251,6 +251,10 @@ def jvm_maven_import_external(

     srcjar_urls = kwargs.pop("srcjar_urls", None)

+    rule_load = kwargs.pop(
+        "rule_load",
+        'load("@rules_java//java:defs.bzl", "java_import")',
+    )
     rule_name = kwargs.pop("rule_name", "java_import")

     if fetch_sources

qtprojectorg pushed a commit to qtqa/gerrit that referenced this issue Dec 26, 2019
Force loading the Java rules from the rules_java repo, as pointed out
in: [1]. Note that even with this change, gerrit cannot be built with
--incompatible_load_java_rules_from_bzl option passed yet:

  $ bazel build --incompatible_load_java_rules_from_bzl :release

The other transitive dependencies must be fixed first, most notably
rules_closure: [2], or more generally, Bazel's own: jvm_import_external
and java_import_external rules: [3].

[1] bazelbuild/bazel#8741
[2] bazelbuild/rules_closure#449
[3] bazelbuild/bazel#10046

Bug: Issue 11738
Change-Id: I153b6d3c14d6df465034041c3bf81c245df0aa04
@jin
Copy link
Member

jin commented Dec 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-Java Issues for Java rules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants