Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rules_scala fails under --all_incompatible_changes: + operator on a depset is forbidden #430

Closed
iphydf opened this issue Feb 28, 2018 · 5 comments · Fixed by #453 or #480
Closed

Comments

@iphydf
Copy link

iphydf commented Feb 28, 2018

$ bazel build //jvm-toxcore-c/... --all_incompatible_changes
Loading:
Loading: 0 packages loaded
ERROR: /private/var/tmp/_bazel_iphy/178403b66d944445b84ccba31dd03db8/external/io_bazel_rules_scala/third_party/plugin/src/main/BUILD:5:1: in scala_library_for_plugin_bootstrapping rule @io_bazel_rules_scala//third_party/plugin/src/main:dependency_analyzer:
Traceback (most recent call last):
	File "/private/var/tmp/_bazel_iphy/178403b66d944445b84ccba31dd03db8/external/io_bazel_rules_scala/third_party/plugin/src/main/BUILD", line 5
		scala_library_for_plugin_bootstrapping(name = 'dependency_analyzer')
	File "/private/var/tmp/_bazel_iphy/178403b66d944445b84ccba31dd03db8/external/io_bazel_rules_scala/scala/scala.bzl", line 733, in _scala_library_impl
		_lib(ctx, True)
	File "/private/var/tmp/_bazel_iphy/178403b66d944445b84ccba31dd03db8/external/io_bazel_rules_scala/scala/scala.bzl", line 660, in _lib
		_collect_jars_from_common_ctx(ctx)
	File "/private/var/tmp/_bazel_iphy/178403b66d944445b84ccba31dd03db8/external/io_bazel_rules_scala/scala/scala.bzl", line 621, in _collect_jars_from_common_ctx
		collect_jars(((ctx.attr.deps + auto_deps) + e...), ...)
	File "/private/var/tmp/_bazel_iphy/178403b66d944445b84ccba31dd03db8/external/io_bazel_rules_scala/scala/scala.bzl", line 597, in collect_jars
		_collect_jars_when_dependency_analyzer_is_off(dep_targets)
	File "/private/var/tmp/_bazel_iphy/178403b66d944445b84ccba31dd03db8/external/io_bazel_rules_scala/scala/scala.bzl", line 549, in _collect_jars_when_dependency_analyzer_is_off
		compile_jars += java_provider.compile_jars
`+` operator on a depset is forbidden. See https://docs.bazel.build/versions/master/skylark/depsets.html for recommendations. Use --incompatible_depset_union=false to temporarily disable this check.
ERROR: Analysis of target '//jvm-toxcore-c:AudioReceiveFrameCallbackTest' failed; build aborted: Analysis of target '@io_bazel_rules_scala//third_party/plugin/src/main:dependency_analyzer' failed; build aborted
INFO: Elapsed time: 0.196s
FAILED: Build did NOT complete successfully (0 packages loaded)
@iphydf
Copy link
Author

iphydf commented Feb 28, 2018

There are several more issues:

external/io_bazel_rules_scala/scala/scala.bzl", line 405, in write_manifest
                ctx.file_action(output = ctx.outputs.manifest, con...)
Use ctx.actions.write instead of ctx.file_action.

and

external/io_bazel_rules_scala/scala/scala.bzl", line 354, in _compile_or_empty
                len(srcjars)
depset is not iterable. You may use `len(<depset>.to_list())` instead.

@johnynek
Copy link
Member

johnynek commented Mar 1, 2018

PRs welcome especially when they don't close off old bazel versions. I somewhat would like to support as many versions as we reasonable can without ugly hacks and always supporting the latest version of bazel.

@ittaiz
Copy link
Member

ittaiz commented Mar 1, 2018 via email

@johnynek
Copy link
Member

So, why don't we start doing this:

  1. run with this flag set from now on.
  2. start making branches of the rules for each bazel. We won't necessarily cherry-pick all the changes, but we can try for a while.
  3. make master always working cleanly with the latest released versions.

What do you think of this plan?

@ittaiz
Copy link
Member

ittaiz commented Mar 25, 2018

SGTM
We can also encourage users of old versions to contribute in the cherry-picking if it's important for them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants