Skip to content

Commit 06cea96

Browse files
committed
fix: do not serialize Label() via "".join() when tar command fails (#2593)
While debugging an error in #2592 it was failing to output an error message instead saying: ``` expected string for sequence element 0, got '@@aspect_bazel_lib~~toolchains~bsd_tar_darwin_arm64//:tar' of type Label ``` This change makes it output the args in a format such as: ``` Failed to extract package tarball. '[Label("@@aspect_bazel_lib~~toolchains~bsd_tar_darwin_arm64//:tar"), "-xf", "package.tgz", "--strip-components", "1", "-C", "package", "--no-same-owner", "--no-same-permissions"]' exited with 1: ``` which might have the ugly `[...]` braces but at least it's not failing to output the error message. ### Changes are visible to end-users: no ### Test plan - Covered by existing test cases - Manual testing
1 parent e3d2256 commit 06cea96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

npm/private/npm_import.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def _download_and_extract_archive(rctx, package_json_only):
552552
if not package_json_only:
553553
result = rctx.execute(tar_args)
554554
if result.return_code:
555-
msg = "Failed to extract package tarball. '{}' exited with {}: \nSTDOUT:\n{}\nSTDERR:\n{}".format(" ".join(tar_args), result.return_code, result.stdout, result.stderr)
555+
msg = "Failed to extract package tarball. '{}' exited with {}: \nSTDOUT:\n{}\nSTDERR:\n{}".format(tar_args, result.return_code, result.stdout, result.stderr)
556556
fail(msg)
557557

558558
if not is_windows:

0 commit comments

Comments
 (0)