dropbox / dbx_build_tools

Dropbox's Bazel rules and tools
Other
209 stars 37 forks source link

map_each must be a function that accepts a single positional argument #11

Closed fcorange closed 3 years ago

fcorange commented 4 years ago

Getting below error when following README.md to setup a project:

ERROR: /.../external/dbx_build_tools/build_tools/BUILD:68:1: in dbx_py_binary rule @dbx_build_tools//build_tools:bzl: Traceback (most recent call last): File "/.../external/dbx_build_tools/build_tools/BUILD", line 68 dbx_py_binary(name = 'bzl') File "/.../external/dbx_build_tools/build_tools/py/py.bzl", line 610, in _dbx_py_binary_impl dbx_py_binary_base_impl(ctx, <1 more arguments>) File "/.../external/dbx_build_tools/build_tools/py/py.bzl", line 659, in dbx_py_binary_base_impl emit_py_binary(ctx, main = main, <10 more arguments>) File "/.../external/dbx_build_tools/build_tools/py/common.bzl", line 416, in emit_py_binary conflict_args.add_all(<2 more arguments>) map_each must be a function that accepts a single positional argument

Env: Ubuntu 16.04.6 (docker image running on Mac) Bazel 2.1.1

It seems to be related to this change: https://github.com/dropbox/dbx_build_tools/commit/e95b030dfbd2f9882450f1d73c31f7c2631c1c65

I switched to its parent commit in http_archive and all worked fine:

http_archive( name = "dbx_build_tools", urls = ["https://github.com/dropbox/dbx_build_tools/archive/c599cbe093c813ced631aa7bd6a5b12a69840f1b.tar.gz"], strip_prefix = "dbx_build_tools-c599cbe093c813ced631aa7bd6a5b12a69840f1b", sha256 = '9b5ebf16589c9f55a3976def46a0a8d600015b99717421542a2a36086ae4eb06', )

armooo commented 4 years ago

Args.for_each was updated in Bazel 3.4.0 to take an optional DirectoryExpander, https://docs.bazel.build/versions/3.4.0/skylark/lib/Args.html#add_all.map_each . We tend to stay with the newest releases and are currently testing this rule set on 3.7.0. This seems like another opportunity for us to improve the documentation.