higherkindness/rules_scala

Cannot build a scala_test rule

Shastick opened this issue · 2 comments

Hello,

Not sure I am missing something here, but I have exhausted my other venues so I'm turning to an issue.

I'm trying to migrate to the rules_scala offered by this repository.

I'm using Bazel 3.1.0, and importing rules_scala via a git_repository rule that points to the commit that introduced support for 3.0.0/3.1.0.

I have a scala_library that builds fine. But the scala_test that attempts to test it fails to build with:

ERROR: <REDACTED>/BUILD:58:1: in scala_test rule <REDACTED>:test:
Traceback (most recent call last):
	File "<REDACTED>/BUILD", line 58
		scala_test(name = 'test')
	File "<REDACTED>/f59bdc1effcf46af8775bc0572ca07eb/external/rules_scala_annex/rules/scala.bzl", line 236, in _scala_test_implementation
		_run_phases(ctx, <1 more arguments>)
	File "<REDACTED>/f59bdc1effcf46af8775bc0572ca07eb/external/rules_scala_annex/rules/private/phases/api.bzl", line 28, in _run_phases
		function(ctx, g)
	File "<REDACTED>/f59bdc1effcf46af8775bc0572ca07eb/external/rules_scala_annex/rules/private/phases/phase_test_launcher.bzl", line 19, in function
		g.compile
'struct' value has no field or method 'compile'

Does this ring any bell? I'm happy to provide more details on my setup if required. I'm still relatively new to Bazel and don't really know if this is a bug in my own setup or an issue with the rules_scala in this repository.

Also, not sure if this plays into this: I still need to import the vanilla rules_scala into the workspace because of some other rules that depend on them, so this could be a factor.

Kindly

Small update: so far I've only configured a configure_bootstrap_scala and I see the build fail due to g.compile.zinc_info.apis, which may be due to the fact that zinc is not setup.

Will try to set that up properly and see where that leads.

So, it seems that when using a properly configured zinc compiler things work. Apologies for the noise.