Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

[WIP] Bazel 25 compatibility #185

Merged
merged 3 commits into from
May 17, 2019
Merged

Conversation

jjudd
Copy link
Collaborator

@jjudd jjudd commented May 8, 2019

Includes a few extra commits. Currently a work in progress.

The older version of protobuf is causing a warning like:
An illegal reflective access operation has occurred
@jjudd jjudd force-pushed the bazel25 branch 3 times, most recently from 4415cf1 to 905f377 Compare May 8, 2019 19:25
@andyscott
Copy link
Member

When do you think this one will be ready?

@jjudd
Copy link
Collaborator Author

jjudd commented May 9, 2019

Early next week if that works.

@jjudd jjudd force-pushed the bazel25 branch 7 times, most recently from 55dc9aa to c3e8963 Compare May 16, 2019 22:11
@andyscott
Copy link
Member

🤞

James Judd added 2 commits May 16, 2019 22:39
Includes updating the _java attribute to use current_java_runtime and get rid
of warnings.

The current code with more recent versions of Bazel causes a warning about
using the deprecated target '@local_jdk//:java' and to use use
@bazel_tools//tools/jdk:current_java_runtime instead (see
bazelbuild/bazel#5594).

Resolves higherkindness#122
@jjudd
Copy link
Collaborator Author

jjudd commented May 17, 2019

CI is good. Commits are squashed into something more reasonable. This is ready for review.

Copy link
Member

@andyscott andyscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. LGTM!

@andyscott andyscott merged commit 81dd793 into higherkindness:master May 17, 2019
@borkaehw borkaehw deleted the bazel25 branch November 13, 2019 16:59

bazel_bin=$(bazel info bazel-bin)
# TODO(Andy Scott): Reenable this test after fixing coverage in Bazel 25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andyscott @jjudd any idea how to fix coverage? I've tried to get this file working, and managed to make a bit of progress with

diff --git a/rules/common/private/utils.bzl b/rules/common/private/utils.bzl
index b6be98a..ffe03e0 100644
--- a/rules/common/private/utils.bzl
+++ b/rules/common/private/utils.bzl
@@ -83,7 +83,7 @@ def write_launcher(
         metadata_file = ctx.actions.declare_file("%s.jacoco_metadata.txt" % ctx.attr.name, sibling = output)
         ctx.actions.write(metadata_file, "\n".join([
             jar.short_path.replace("../", "external/")
-            for jar in jacoco_classpath
+            for jar in jacoco_classpath.to_list()
         ]))
         more_outputs = [metadata_file]
         more_substitutions = {
diff --git a/rules/private/phases/phase_test_launcher.bzl b/rules/private/phases/phase_test_launcher.bzl
index d0d107b..15f1bce 100644
--- a/rules/private/phases/phase_test_launcher.bzl
+++ b/rules/private/phases/phase_test_launcher.bzl
@@ -25,7 +25,7 @@ def phase_test_launcher(ctx, g):
             ctx,
             base = g.coverage.replacements,
         ).replacements
-        coverage_runner_jars = depset(direct = [ctx.files._jacocorunner + ctx.files._lcov_merger])
+        coverage_runner_jars = depset(direct = ctx.files._jacocorunner + ctx.files._lcov_merger)
 
     test_jars = depset(direct = [
         coverage_replacements[jar] if jar in coverage_replacements else jar

(by "a bit of progress" I mean it now fails during the execution step instead of during analysis). But I am now getting java.lang.NoClassDefFoundError: org/jacoco/agent/rt/internal_b0d6a23/Offline which doesn't have as obvious of a fix. Figured I'd ask if anyone had any ideas before I banged my head against a wall repeatedly

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

Successfully merging this pull request may close these issues.

3 participants