Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Cannot iterate over a depset in Bazel 0.27 #58

Closed
apt-itude opened this issue Jun 5, 2019 · 0 comments · Fixed by #59
Closed

Cannot iterate over a depset in Bazel 0.27 #58

apt-itude opened this issue Jun 5, 2019 · 0 comments · Fixed by #59

Comments

@apt-itude
Copy link
Contributor

Starting in Bazel 0.27, depsets will no longer be iterable without passing the --incompatible_depset_is_not_iterable=false flag (see bazelbuild/bazel#5816).

This results errors such as the following:

ERROR: /Users/athompson/code/bazel-javascript/examples/react-app-javascript/src/BUILD.bazel:5:1: in js_library rule //src:src:
Traceback (most recent call last):
	File "/Users/athompson/code/bazel-javascript/examples/react-app-javascript/src/BUILD.bazel", line 5
		js_library(name = 'src')
	File "/private/var/tmp/_bazel_athompson/b5cf6c1c8373f2d1d578c3715ed88e15/external/bazel_javascript/internal/js_library/rule.bzl", line 71, in _js_library_impl
		_js_library_create_full_src(ctx, internal_deps, npm_packages)
	File "/private/var/tmp/_bazel_athompson/b5cf6c1c8373f2d1d578c3715ed88e15/external/bazel_javascript/internal/js_library/rule.bzl", line 99, in _js_library_create_full_src
		ctx.actions.run(inputs = (([ctx.attr._internal_p...), <4 more arguments>)
	File "/private/var/tmp/_bazel_athompson/b5cf6c1c8373f2d1d578c3715ed88e15/external/bazel_javascript/internal/js_library/rule.bzl", line 104, in ctx.actions.run
		[d[JsLibraryInfo].compiled_javascript_dir for d in internal_deps]
type 'depset' is not iterable. Use the `to_list()` method to get a list. Use --incompatible_depset_is_not_iterable=false to temporarily disable this check.
ERROR: Analysis of target '//src:src' failed; build aborted: Analysis of target '//src:src' failed; build aborted```
apt-itude added a commit to 128technology/bazel-javascript that referenced this issue Jun 5, 2019
@fwouts fwouts closed this as completed in #59 Jun 6, 2019
fwouts pushed a commit that referenced this issue Jun 6, 2019
Fixes #58

All instances now call .to_list() on the depset to return a list. This ensures that when Bazel 0.27 is released, the --incompatible_depset_is_not_iterable=false flag will not need to be used.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant