Hi Damien,
I'm using bazel version @ac08bab72 (pretty close to head) on an OSX 10.11.5 machine.
I created a filegroup with a large bunch of files and then passed this to a docker_build command as follows:
filegroup(
...
srcs = [...], // A large file list with some long paths.
)
docker_build(
...
files = [":data"],
...
)
The output of bazel build looks like the following:
____Loading...
____Found 1 target...
____Building...
____[0 / 2] BazelWorkspaceStatusAction stable-status.txt
...
>>>>>>>>> # //<docker_target> [action 'DockerLayer <docker target>.layer']
(cd /private/var/tmp/_bazel_rohit/a10731376421707628e091029859af4a/execroot/... && \
exec env - \
PATH='...' \
TMPDIR=/var/folders/p2/yz_3gtqd4z9d15l2ptzcjbsm0000gn/T/ \
bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/build_tar '--output=bazel-out/local-fastbuild/bin/<docker_target>.layer' '--directory=...' '--mode=0555' '--file=foo/bar/abc.txt=foo/bar/abc.txt' ... (many more file arguments ...)
ERROR: ...BUILD:10:1: null failed: build_tar failed: error executing command· (cd /private/var/tmp/_bazel_rohit/a10731376421707628e091029859af4a/execroot/beam && \
exec env - \
PATH='...' \
TMPDIR=/var/folders/p2/yz_3gtqd4z9d15l2ptzcjbsm0000gn/T/ \
bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/build_tar '--output=bazel-out/local-fastbuild/bin/<docker_target>.layer' '--directory=...' '--mode=0555' '--file=foo/bar/abc.txt=foo/bar/abc.txt' ... (many more file arguments ...)
...): java.io.IOException: Cannot run program "/private/var/tmp/_bazel_rohit/a10731376421707628e091029859af4a/execroot/.../_bin/process-wrapper" (in directory "/private/var/tmp/_bazel_rohit/a10731376421707628e091029859af4a/execroot/..."): error=7, Argument list too long.
Target ... failed to build
Thanks,
Rohit