rules_kotlin
rules_kotlin copied to clipboard
Java executable path issue when running kt_jvm_test on macos
When we run the kt_jvm_test rule on mac os, it ends up looking for java executable in exec path instead of runfiles path, which causes the run failed with the error message like <java-path>/bin/java: No such file or directory.
It seems that the issue is caused by a bug in the rule implementation.
The location of the java binary is set here, which is using java_executable_exec_path. That seems inconsistent with what rules_scala is doing in the same scenario, which used java_executable_runfiles_path. According to the document, the later one should be using for execution during tests.
The solution will be changing java_executable_exec_path to java_executable_runfiles_path from here..
One workaround here is to add java_test rule instead, then depends on kt_jvm_library.