From 85eb97817caaeb18c98a8f90a61dfefc8a1cb7a6 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 24 Dec 2019 14:47:17 +0100 Subject: [PATCH 1/3] Bazel: Replace deprecated dependency mode LOOSE with PRUNE_LEGACY This fixes this warning in closure_js_binary rule: dependency_mode=LOOSE is deprecated and will be removed soon; prefer to use its equivalent PRUNE_LEGACY that was added in this PR: [1]. [1] https://github.com/bazelbuild/rules_closure/pull/444 Change-Id: I648f581a8f585402543b97ce7a7ef056ca298c3e --- polygerrit-ui/app/rules.bzl | 1 + tools/bzl/js.bzl | 1 + 2 files changed, 2 insertions(+) diff --git a/polygerrit-ui/app/rules.bzl b/polygerrit-ui/app/rules.bzl index ca8c402227..075e34a39d 100644 --- a/polygerrit-ui/app/rules.bzl +++ b/polygerrit-ui/app/rules.bzl @@ -20,6 +20,7 @@ def polygerrit_bundle(name, srcs, outs, app): ], language = "ECMASCRIPT5", deps = [name + "_closure_lib"], + dependency_mode = "PRUNE_LEGACY", ) # TODO(davido): Remove JSC_REFERENCE_BEFORE_DECLARE when this is fixed upstream: diff --git a/tools/bzl/js.bzl b/tools/bzl/js.bzl index 2726f4154c..e6c48709df 100644 --- a/tools/bzl/js.bzl +++ b/tools/bzl/js.bzl @@ -484,6 +484,7 @@ def polygerrit_plugin(name, app, srcs = [], deps = [], assets = None, plugin_nam deps = [ name + "_closure_lib", ], + dependency_mode = "PRUNE_LEGACY", ) if html_plugin: From 61786574816a69aaad50ccf04f51e478f70120f5 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 24 Dec 2019 17:04:44 +0100 Subject: [PATCH 2/3] Bazel: Make maven_jar rule forward compatible 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] https://github.com/bazelbuild/bazel/issues/8741 [2] https://github.com/bazelbuild/rules_closure/issues/449 [3] https://github.com/bazelbuild/bazel/issues/10046 Bug: Issue 11738 Change-Id: I153b6d3c14d6df465034041c3bf81c245df0aa04 --- tools/bzl/maven_jar.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bzl/maven_jar.bzl b/tools/bzl/maven_jar.bzl index 0bad778fe6..7730804e88 100644 --- a/tools/bzl/maven_jar.bzl +++ b/tools/bzl/maven_jar.bzl @@ -74,6 +74,7 @@ def _generate_build_files(ctx, binjar, srcjar): srcjar_attr = 'srcjar = "%s",' % srcjar contents = """ {header} +load("@rules_java//java:defs.bzl", "java_import") package(default_visibility = ['//visibility:public']) java_import( name = 'jar', From 235eccffe0e062e6c1e018da390dbfffa1a63a2b Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 24 Dec 2019 21:02:17 +0100 Subject: [PATCH 3/3] Bazel: Remove unused polygerrit-ui/app:bower_components rule The last usage was removed in I21f3ed67ade1, but the rule itself was missed to be removed. Bug: Issue 12110 Change-Id: Ib595e8ab2d3dd0e8ecd8635ad48670d9610062ed --- polygerrit-ui/app/BUILD | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/polygerrit-ui/app/BUILD b/polygerrit-ui/app/BUILD index bba0640e92..17c45a4881 100644 --- a/polygerrit-ui/app/BUILD +++ b/polygerrit-ui/app/BUILD @@ -45,16 +45,6 @@ filegroup( ), ) -filegroup( - name = "bower_components", - srcs = glob( - [ - "bower_components/**/*.html", - "bower_components/**/*.js", - ], - ), -) - genrule2( name = "pg_code_zip", srcs = [":pg_code"],