higherkindness/rules_scala

Error on build: depset elements must not be mutable values

nhyne opened this issue · 4 comments

nhyne commented

I'm trying to setup a Bazel repo for some basic Scala work. I'm currently trying to use the example workspace setup defined in the readme with a small build file defining a single Scala source with a small main class. When I try to build the target, it results in the following error:

➜  zio-bazel git:(master) bazel build //example:example
ERROR: /home/nhyne/developer/scala/zio-bazel/example/BUILD:6:1: in scala_binary rule //example:example: 
Traceback (most recent call last):
	File "/home/nhyne/developer/scala/zio-bazel/example/BUILD", line 6
		scala_binary(name = 'example')
	File "/home/nhyne/.cache/bazel/_bazel_nhyne/abaab53ad3df8166be1876850462f4b7/external/rules_scala_annex/rules/scala.bzl", line 222, in _scala_binary_implementation
		_run_phases(ctx, <1 more arguments>)
	File "/home/nhyne/.cache/bazel/_bazel_nhyne/abaab53ad3df8166be1876850462f4b7/external/rules_scala_annex/rules/private/phases/api.bzl", line 28, in _run_phases
		function(ctx, g)
	File "/home/nhyne/.cache/bazel/_bazel_nhyne/abaab53ad3df8166be1876850462f4b7/external/rules_scala_annex/rules/private/phases/phase_zinc_compile.bzl", line 99, in function
		_ZincInfo(apis = apis, <4 more arguments>)
	File "/home/nhyne/.cache/bazel/_bazel_nhyne/abaab53ad3df8166be1876850462f4b7/external/rules_scala_annex/rules/private/phases/phase_zinc_compile.bzl", line 104, in _ZincInfo
		depset(<2 more arguments>)
depset elements must not be mutable values
ERROR: Analysis of target '//example:example' failed; build aborted: Analysis of target '//example:example' failed
INFO: Elapsed time: 0.098s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 3 targets configured)

I'm wondering if I've set something up wrong or if I'm missing something entirely. Any and all assistance would be much appreciated! Thank you ahead of time!

Repo I'm working with: https://github.com/nhyne/zio-bazel

nhyne commented

It seems like this is specifically an issue with Bazel 3.0.0. Downgrading to 2.2.0 fixes this problem.

Hey @nhyne, thanks for opening this issue.

higherkindness/rules_scala might not be Bazel 3.0 compatible yet. We've been very busy at Lucid lately and have not had time to visit that yet. I'm glad 2.2.0 is working for you. Let us know if you run into any other issues.

@nhyne FYI, it's compatible with Bazel 3.0.0 and 3.1.0 now.

nhyne commented

@borkaehw Thank you!

@SrodriguezO Everything else has been working great!