Problem description
Under the following condition add_from_default_info() produces the index out of range error below:
include_runfiles=True,
src[DefaultInfo].files is empty,
src[DefaultInfo].default_runfiles is not empty.
In that case, add_from_default_info() assumes that (2) is False, and so causes the exception:
File "/home/grenker/.cache/bazel/_bazel_grenker/d2508ebd25597e9a92cadc5f3ae02937/external/rules_pkg/pkg/private/tar/tar.bzl", line 136, column 19, in _pkg_tar_impl
add_label_list(mapping_context, srcs = ctx.attr.srcs)
File "/home/grenker/.cache/bazel/_bazel_grenker/d2508ebd25597e9a92cadc5f3ae02937/external/rules_pkg/pkg/private/pkg_files.bzl", line 373, column 34, in add_label_list
add_from_default_info(
File "/home/grenker/.cache/bazel/_bazel_grenker/d2508ebd25597e9a92cadc5f3ae02937/external/rules_pkg/pkg/private/pkg_files.bzl", line 440, column 52, in add_from_default_info
base_file = the_executable or all_files[0]
Error: index out of range (index is 0, but sequence has 0 elements)
What to do
Return early if either (1) DefaultInfo is not an attribute of src or (2) src[DefaultInfo].files is empty.
Problem description
Under the following condition
add_from_default_info()produces theindex out of rangeerror below:include_runfiles=True,src[DefaultInfo].filesis empty,src[DefaultInfo].default_runfilesis not empty.In that case,
add_from_default_info()assumes that (2) isFalse, and so causes the exception:What to do
Return early if either (1)
DefaultInfois not an attribute ofsrcor (2)src[DefaultInfo].filesis empty.