Skip to content

Commit e6dc7a3

Browse files
authored
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 cf7583d commit e6dc7a3

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
@@ -602,7 +602,7 @@ def _download_and_extract_archive(rctx, package_json_only):
602602
if not package_json_only:
603603
result = rctx.execute(tar_args)
604604
if result.return_code:
605-
msg = "Failed to extract package tarball. '{}' exited with {}: \nSTDOUT:\n{}\nSTDERR:\n{}".format(" ".join(tar_args), result.return_code, result.stdout, result.stderr)
605+
msg = "Failed to extract package tarball. '{}' exited with {}: \nSTDOUT:\n{}\nSTDERR:\n{}".format(tar_args, result.return_code, result.stdout, result.stderr)
606606
fail(msg)
607607

608608
if not is_windows:

0 commit comments

Comments
 (0)