tools/test/test-setup.sh assumes zip is available in test sandbox
https://github.com/bazelbuild/bazel/blob/8e9d30039d913c883b52b9677f88cb82a0dd00ee/tools/test/test-setup.sh#L418 uses the command zip without considering that it may not be available within the test sandbox.
test-setup.sh should make use of @bazel_tools//tools/zip:zipper to remove this assumption.
There is disconnect unfortunately between flags that zip & zipper supports:
https://github.com/bazelbuild/bazel/blob/030d94cf4cb23c3e4581141774a1b3d8cf828a85/tools/test/test-setup.sh#L430
vs.
Usage: zipper [vxc[fC]] x.zip [-d exdir] [[zip_path1=]file1 ... [zip_pathn=]filen]
v verbose - list all file in x.zip
x extract - extract files in x.zip to current directory, or
an optional directory relative to the current directory
specified through -d option
c create - add files to x.zip
f flatten - flatten files to use with create or extract operation
C compress - compress files when using the create operation
x and c cannot be used in
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
The implicit dependency on zip is now more problematic, since https://github.com/bazelbuild/bazel/commit/8e639dfa8c7aa0723123ee90dc933d528a4f2b68 . With that change and zip missing, undeclared outputs are just summarily deleted.
@alanfalloon as author of https://github.com/bazelbuild/bazel/commit/8e639dfa8c7aa0723123ee90dc933d528a4f2b68 can you comment on why the outputs are deleted if zip isn't present?
Looks like a bug. The rm should probably be conditional on the zip success.
One correct answer here is for this to depend on a toolchain type symbol, then even if zip falls through to the system by default, users would be able to register a hermetic zip toolchain to correct that.
Likely most will see this issue vanish as 489d08bf472 propagates.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.