envoyproxy / envoyproxy/envoy-mobile

kotlin: Integrate nhaarman/mockito-kotlin

Open
#504 0 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Java
Stars
566
Forks
85
PR merge metrics
No merged PRs in 30d

Description

https://github.com/nhaarman/mockito-kotlin

For `maven_install`:
`"com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"`

The using that repository causes some JVM inlining issue. The stacktrace I get when I try to use it is:

```
ERROR: /Users/achiu/Development/envoy-mobile/library/kotlin/test/io/envoyproxy/envoymobile/BUILD:95:1: Compiling Kotlin to JVM //library/kotlin/test/io/envoyproxy/envoymobile:grpc_stream_emitter_test { kt: 18, java: 0, srcjars: 0 } failed (Exit 2)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/private/var/tmp/_bazel_achiu/e95f0937739315919b86dd2afc724e3e/execroot/__main__/bazel-out/host/bin/external/io_bazel_rules_kotlin/src/main/kotlin/builder_jar_jar.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
exception: java.lang.IllegalStateException: Backend Internal error: Exception during code generation
Cause: Back-end (JVM) Internal error: Couldn't inline method call 'mock' into
```

Possibly fixed here: https://github.com/bazelbuild/rules_jvm_external/pull/69. However, I do get some other error which I decided not to venture down there yet:
`WORKSPACE`:
```
http_archive(
name = "rules_jvm_external",
sha256 = "809bfebd9dc10b544aa79636cbe7a2be756f67b05aaee4de25e0e4f99eada4e4",
strip_prefix = "rules_jvm_external-31bd8103eff605e66f7054b9b681dc826ee6b0a6",
urls = ["https://github.com/bazelbuild/rules_jvm_external/archive/31bd8103eff605e66f7054b9b681dc826ee6b0a6.tar.gz"],
)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.